Openstack usage list not showing all projects
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
In a customer environment running nova 2:17.0.
when querying projects usage list most recent projects are not listed in the reply.
Example:
$ openstack usage list --print-empty --start 2019-01-01 --end 2019-02-01
Not showing any information about project a897ea83f01c436
But querying for the usage of the specific project we can retrieve the results:
openstack usage show --project a897ea83f01c436
Usage from 2019-01-01 to 2019-02-01 on project a897ea83f01c436
+------
| Field | Value |
+------
| CPU Hours | 528.3 |
| Disk GB-Hours | 10566.07 |
| RAM MB-Hours | 2163930.45 |
| Servers | 43 |
+------
As a workaround we are able to get projects_uuid like this:
projects_
And iterate over them and get individuals usage:
for prog in $projects_uuid; do openstack project show $prog; openstack usage show --project $prog --start 2019-01-01 --end 2019-02-01; done
I had a look through the code and don't see anything that jumps out that would cause this behavior. I need a bit more information from you to understand what the problem could be.
Are you call the API with the admin role or a non-admin role? How is your policy.json configured for the usage API? The default [1] is like this:
# List per tenant usage statistics for all tenants tenant- usage compute_ api:os- simple- tenant- usage:list" : "rule:admin_api"
# GET /os-simple-
#"os_
which means that by default, only users with the admin role will be able to list usage for all projects.
Please let us know what role and policy you have configured, so we may investigate further.
[1] https:/ /docs.openstack .org/nova/ latest/ configuration/ sample- policy. html