← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1305860] [NEW] nova allows to resize from a flavor with disk_size=0 defined

 

Public bug reported:

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.

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1305860

Title:
  nova allows to resize from a flavor with disk_size=0 defined

Status in OpenStack Compute (Nova):
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1305860/+subscriptions


Follow ups

References