On cloud-vps, a command for * or a:all takes around 90 seconds to complete. This results from making several OpenStack calls per project.
It would be good to speed things up for the most-common use case which is a search on every project. The nova API supports an all_tenants argument[0]:
GET /servers List Servers <snip> all_tenants (Optional) query boolean Specify the all_tenants query parameter to list all instances for all projects. By default this is only allowed by administrators. If this parameter is specified without a value, the value defaults to True. If the value is specified, 1, t, true, on, y and yes are treated as True. 0, f, false, off, n and no are treated as False. (They are case-insensitive.)
The endpoint allows the novaobserver to see all projects that it has a role on; because the observer inherits a role on the default domain that means it can effectively query all projects.
The line, above, about 'allowed by administrators' is I believe referring to the nova policy rule "os_compute_api:servers:detail:get_all_tenants" which has a default value of "rule:context_is_admin". In our current deployment we have that policy (and all read-only policies) overridden to "" which means any user can access them.
In the future when we adopt the new 'reader' model for policy enforcement (T276018), that endpoint may be opened up to reader roles by default or we may need to continue to override it; in either case it should be possible to maintain access to that endpoint for the 'observer' role.
Other openstack clouds that don't override their policy files might or might not be able to make use of the all_tenants flag; it would all depend on what service user they assign for Cumin's use. We could add a try/fallback feature for service users that don't have access to the all_tenants option but I'm unclear on how much we want to speculate about rbac models in other unknown clouds.
[0] https://docs.openstack.org/api-ref/compute/?expanded=list-servers-detail#servers-run-an-action-servers-action
[1] https://docs.openstack.org/nova/latest/admin/configuration/samples/policy.yaml.html