← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1443697] Re: VMware: resize always fails for image with capacity larger than 1 GB

 

** Changed in: nova
       Status: Fix Committed => Fix Released

** Changed in: nova
    Milestone: None => liberty-1

-- 
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/1443697

Title:
  VMware: resize always fails for image with capacity larger than 1 GB

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  Resize will fail if using 0 disk flavors in combination with images
  that have disks larger than 1 GB.

  Steps to reproduce:
  1. Create two new flavors with disk sizes of 0.  tiny and small will do
  2. Create an image with a disk larger than 1 GB
  3. Boot this image with tiny.0
  4. Resize this image to small.0
  5. Notice Horizon says nothing and the resize does nothing
  6. An exception is in the Nova compute logs (stacktrace from Icehouse, but believe also an issue in Kilo)

  2015-04-13 23:32:10.676 9404 ERROR oslo.messaging.rpc.dispatcher [-] Exception during message handling: Resize error: Unable to shrink disk.
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 133, in _dispatch_and_reply
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     incoming.message))
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 176, in _dispatch
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     return self._do_dispatch(endpoint, method, ctxt, args)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 122, in _do_dispatch
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     result = getattr(endpoint, method)(ctxt, **new_args)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 88, in wrapped
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     payload)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/openstack/common/excutils.py", line 68, in __exit__
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 71, in wrapped
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     return f(self, context, *args, **kw)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 282, in decorated_function
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     pass
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/openstack/common/excutils.py", line 68, in __exit__
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 268, in decorated_function
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     return function(self, context, *args, **kwargs)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 335, in decorated_function
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     function(self, context, *args, **kwargs)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 256, in decorated_function
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     migration.instance_uuid, exc_info=True)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/openstack/common/excutils.py", line 68, in __exit__
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 243, in decorated_function
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     return function(self, context, *args, **kwargs)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 311, in decorated_function
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     e, sys.exc_info())
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/openstack/common/excutils.py", line 68, in __exit__
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 298, in decorated_function
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     return function(self, context, *args, **kwargs)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 3506, in resize_instance
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     self.instance_events.clear_events_for_instance(instance)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     self.gen.throw(type, value, traceback)
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 5613, in _error_out_instance_on_exception
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher     raise error.inner_exception
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher ResizeError: Resize error: Unable to shrink disk.
  2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.rpc.dispatcher 
  2015-04-13 23:32:10.678 9404 ERROR oslo.messaging._drivers.common [-] Returning exception Resize error: Unable to shrink disk. to caller


  It appears that nova compute will throw an error when attempting to
  resize an instance _from_ a flavor with disk size of 0 _to_ a flavor
  with disk size 0.

  The trick to reproducing this error is using any image that has a disk
  greater than 1 GB.  I initially tested with cirros, tiny-iso, etc
  which are all less than 1 GB.

  The root cause of the problem is this code in vmops.py:1332

          # Checks if the migration needs a disk resize down.
          if (flavor['root_gb'] < instance['root_gb'] or
              flavor['root_gb'] < vmdk.capacity_in_bytes / units.Gi):
              reason = _("Unable to shrink disk.")
              raise exception.InstanceFaultRollback(
                  exception.ResizeError(reason=reason))

  Dividing the capacity by 1 GB will result in 0 for any number less
  than 1 GB.  However anything larger will be a positive integer.  And
  the flavor size is always 0, so this exception is always raised in a
  resize of any image with capacity larger than 1 GB (which is most
  images).

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


References