nova allows to resize from a flavor with disk_size=0 defined
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Liyingjun |
Bug Description
For some reason nova allows creating a flavor with a disk_size of 0, when an instance is booted using such flavor its disk will use the native base image size as the size of the ephemeral root volume (from the ops docs).
Even though having the disk_size=0 means that the instance's disk can have any imaginable size, nova will still allow to resize that instance to any flavor defining disk_size >= 0 but it won't shrink the disk if it is bigger than the new disk_size.
Take for example the following:
* we've an image of 2GB in glance
* we boot an instance using this image and a flavor1 (with disk_size=0)
-> The instance's disk will be of 2GB (same as image)
* Afterwards, we resize this instance to flavor2 (with disk_size=1GB) which is allowed b/c new_disk_size > old_disk_size
* The new instance will be using flavor2 according to the papers, but its ephemeral disk will still be 2GB (nova won't try to shrink the image)
A couple of solutions are possible here, either nova forbids to resize from any flavor with a disk_size=0 or nova checks the *real* size of the disk before even trying to resize, failing if it is bigger than the one defined by the new flavor. The drastic solution would be to forbid defining flavors with a disk_size=0, but I guess it wouldn't be possible to keep backwards compatibility.
tags: | added: compute |
Changed in nova: | |
importance: | Undecided → Low |
status: | New → Confirmed |
Changed in nova: | |
assignee: | nobody → Liyingjun (liyingjun) |
Changed in nova: | |
milestone: | none → juno-2 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | juno-2 → 2014.2 |
No resize to/from zero disk flavor is probably my preference. Its kinda confusing when zero = any.
I think the XenAPI driver will check the actual disk size, but that still leaves things very confusing in some cases.