Horizon: Project->Compute->Overview does not reflect accurate VCPU usage, if a instance is shelved

Bug #1843947 reported by Chris DeVita on 2019-09-13
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Undecided
Unassigned

Bug Description

The overview panel Project->Compute->Overview does not reflect accurate
resource usage, if a instance is shelved[1]. This is true as a admin or
normal user. The panel still shows shelved VMs using VCPU resources

To Reproduce:
=============
As a admin user in the admin project create several instances
$ openstack server list -c ID -c Name -c Status
+--------------------------------------+------------+--------+
| ID | Name | Status |
+--------------------------------------+------------+--------+
| c833339b-1782-4dac-8d95-27e67a6452a9 | advmtest-2 | ACTIVE |
| 60f4bc62-bdf1-4c21-983c-40b066fe7307 | advmtest-1 | ACTIVE |
+--------------------------------------+------------+--------+

and look at the VCPU used on that panel, ( VCPU used 2 0f 20 )

Hypervisor stats show 2 are in use too.
( Note: these are for 1 VCPU instances, Instance with more than 1 VCPU will be higher)

$ openstack hypervisor stats show | grep vcpus_used
| vcpus_used | 2 |

Shelve one of them, now check resources

$ openstack server shelve 60f4bc62-bdf1-4c21-983c-40b066fe7307
$ openstack server list -c ID -c Name -c Status
+--------------------------------------+------------+-------------------+
| ID | Name | Status |
+--------------------------------------+------------+-------------------+
| c833339b-1782-4dac-8d95-27e67a6452a9 | advmtest-2 | ACTIVE |
| 60f4bc62-bdf1-4c21-983c-40b066fe7307 | advmtest-1 | SHELVED_OFFLOADED |
+--------------------------------------+------------+-------------------+

$ openstack hypervisor stats show | grep vcpus_used
| vcpus_used | 1 |

Horizon Overview still shows ( VCPU used 2 0f 20 )

As the demo user
----------------
create 2 instances

$ openstack server list -c ID -c Name -c Status
+--------------------------------------+-------------+--------+
| ID | Name | Status |
+--------------------------------------+-------------+--------+
| 8713c7af-d0f0-4ae7-bcb8-07576f95b09b | demo-test-2 | ACTIVE |
| 4f1cd938-c084-4466-bec8-9a4f78d123a0 | demo-test-1 | ACTIVE |
+--------------------------------------+-------------+--------+

$ openstack server shelve 4f1cd938-c084-4466-bec8-9a4f78d123a0
$ openstack server list -c ID -c Name -c Status
+--------------------------------------+-------------+-------------------+
| ID | Name | Status |
+--------------------------------------+-------------+-------------------+
| 8713c7af-d0f0-4ae7-bcb8-07576f95b09b | demo-test-2 | ACTIVE |
| 4f1cd938-c084-4466-bec8-9a4f78d123a0 | demo-test-1 | SHELVED_OFFLOADED |
+--------------------------------------+-------------+-------------------+

Horizon Overview still shows ( VCPU used 2 0f 20 ).

If you try to view hypervisor stats as the demo user you encounter:

$ openstack hypervisor stats show
Policy doesn't allow os_compute_api:os-hypervisors to be performed.

As a non admin user you cannot run "openstack hypervisor" but as the admin user you can get a
accurate count of the number of VCPUs in use.

If this is not a bug then:
1) Should the overview be changed so that, when logged in as admin it show
   VCPUS in use, and when a normal users opens the overview it shows # of instances created,
   not necessarily how many VCPUS are active
2) Is it realistic to change policy.json so that users have access to this API
3) Is there a different way to count up VPCUs in use as a non admin user

[1] Shelve an instance - Shuts down the instance, and stores it together with associated data and resources (a snapshot is taken if not volume backed). Anything in memory is lost. ( https://docs.openstack.org/newton/user-guide/cli-stop-and-start-an-instance.html )

Ivan Kolodyazhny (e0ne) on 2019-09-18
tags: added: nova
Changed in horizon:
status: New → Confirmed
Chris DeVita (cdev3) wrote :

Bump... Any news on this?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers