The documentation of disk=0 in flavor is misleading
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Balazs Gibizer |
Bug Description
Description
===========
Current nova api documentation states the following about disk=0 in flavor:
The size of the root disk that will be created in GiB. If 0 the
root disk will be set to exactly the size of the image used to
deploy the instance. [1]
However scheduler does not check the actual image size during select destintation and also resource tracker does not calculate the used space properly.
[1] https:/
Steps to reproduce
==================
1. Create a sizeable image. e.g. 8GB
+------
| Property | Value |
+------
| checksum | bde0b00c072a8b5
| container_format | bare |
| created_at | 2016-07-
| disk_format | qcow2 |
| id | ea14a784-
| min_disk | 0 |
| min_ram | 0 |
| name | my_image |
| owner | 0878b2a9a9fa4c5
| protected | False |
| size | 8591507456 |
| status | active |
| tags | [] |
| updated_at | 2016-07-
| virtual_size | None |
| visibility | private |
+------
2. Check the current host-describe output to see the available and used space
vagrant@
+------
| HOST | PROJECT | cpu | memory_mb | disk_gb |
+------
| controller | (total) | 8 | 7794 | 39 |
| controller | (used_now) | 0 | 512 | 0 |
| controller | (used_max) | 0 | 64 | 0 |
+------
3. boot a vm with a flavor disk=0
vagrant@
+----+-
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 42 | m1.nano | 64 | 0 | 0 | | 1 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
| 84 | m1.micro | 128 | 0 | 0 | | 1 | 1.0 | True |
| c1 | cirros256 | 256 | 0 | 0 | | 1 | 1.0 | True |
| d1 | ds512M | 512 | 5 | 0 | | 1 | 1.0 | True |
| d2 | ds1G | 1024 | 10 | 0 | | 1 | 1.0 | True |
| d3 | ds2G | 2048 | 10 | 0 | | 2 | 1.0 | True |
| d4 | ds4G | 4096 | 20 | 0 | | 4 | 1.0 | True |
+----+-
vagrant@
+------
| Property | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | building |
| OS-SRV-
| OS-SRV-
| accessIPv4 | |
| accessIPv6 | |
| adminPass | MmVFaJr7B5Rp |
| config_drive | |
| created | 2016-07-
| description | - |
| flavor | m1.nano (42) |
| hostId | |
| host_status | |
| id | 16c2e302-
| image | my_image (ea14a784-
| key_name | - |
| locked | False |
| metadata | {} |
| name | vm2 |
| os-extended-
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tags | [] |
| tenant_id | 0878b2a9a9fa4c5
| updated | 2016-07-
| user_id | d2046b30b0e6459
+------
Server building... 0% complete
Server building... 0% complete
Server building... 100% complete
Finished
vagrant@
4. Check the host-describe output again.
vagrant@
+------
| HOST | PROJECT | cpu | memory_mb | disk_gb |
+------
| controller | (total) | 8 | 7794 | 39 |
| controller | (used_now) | 1 | 576 | 0 |
| controller | (used_max) | 1 | 64 | 0 |
| controller | 0878b2a9a9fa4c5
+------
To see the data used by the scheduler decision you shall add an extra log line to the disk_filter.py
vagrant@
diff --git a/nova/
index 3476ace..d16dcbf 100644
--- a/nova/
+++ b/nova/
@@ -37,6 +37,8 @@ class DiskFilter(
+ LOG.error(
+
Then in the scheduler log you will see that during the boot the requested_disk is 0 and not 8G as expected based on the documentation.
2016-07-07 09:19:18.480 ERROR nova.scheduler.
Expected result
===============
The documentation correctly states that disk=0 means that the scheduler will not select the host based on image size.
Environment
===========
Devstack on master.
vagrant@
commit 2d551ce83d186ad
Merge: 94c96f2 7451862
Author: Jenkins <email address hidden>
Date: Mon Jul 4 15:40:25 2016 +0000
Merge "Improve the help text for configdrive options"
Changed in nova: | |
assignee: | nobody → Balazs Gibizer (balazs-gibizer) |
Changed in nova: | |
status: | Confirmed → In Progress |
Hmm, so disk=0 should only be used for testing really.
Maybe thats what the documentation should be updated to say?
The fact the resource tracker doesn't report correctly is a separate bug that should be fixed. I don't think it totally makes sense to fix up the scheduler in this case.