simple tenant usage api calculating disk usages incorrectly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Medium
|
Shilpa Devharakar |
Bug Description
As of now on current master the simple tenant usage api is calculating disk usages information incorrectly in case in instance is booted from volume.
If user boots the instance from volume then the disk usages should not be considered but it's taking the flavor.root_gb as local_gb used.
Steps to reproduce:
1. Create bootable volume
$ cinder create 1 --name bootable_volume --image 33a7f2aa-
+------
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+------
| 0399f203-
+------
2. Flavor details:
$ nova flavor-show 1
+------
| Property | Value |
+------
| OS-FLV-
| OS-FLV-
| disk | 1 |
| extra_specs | {} |
| id | 1 |
| name | m1.tiny |
| os-flavor-
| ram | 512 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+------
3. Create instance from volume:
$ nova boot --flavor 1 --boot-volume 0399f203-
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| c46243b7-
+------
4. Check the simple tenant usage:
$ nova usage --tenant f77f8f0f6f1b46f
Usage from 2017-09-07 to 2017-09-08:
+------
| Servers | RAM MB-Hours | CPU Hours | Disk GB-Hours |
+------
| 2 | 3602.99 | 7.04 | 7.04 |
+------
Note: You can see the more details of resource usage below for individual instances under tenant:
See the second indtsnce usages there it's showing local_gb as 1 that means flavor.root_gb is used
even if the instance is booted from volume.
$ curl -g -i -X GET "http://
HTTP/1.1 200 OK
Date: Thu, 07 Sep 2017 07:00:29 GMT
Server: Apache/2.4.18 (Ubuntu)
Content-Length: 993
Content-Type: application/json
OpenStack-
X-OpenStack-
Vary: OpenStack-
x-openstack-
x-compute-
Connection: close
{
"tenant_usage": {"total_
{"instance_id": "0280c4ff-
{"instance_id": "c46243b7-
}
Changed in nova: | |
assignee: | nobody → Bhagyashri Shewale (bhagyashri-shewale) |
Changed in nova: | |
assignee: | Pooja Jadhav (poojajadhav) → Shilpa Devharakar (shilpasd) |
Changed in nova: | |
assignee: | Shilpa Devharakar (shilpasd) → Bhagyashri Shewale (bhagyashri-shewale) |
Set the status 'In-progress' because this report has an assignee.