VMware: resize always fails for image with capacity larger than 1 GB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Eric Brown |
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.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.676 9404 TRACE oslo.messaging.
2015-04-13 23:32:10.678 9404 ERROR oslo.messaging.
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
reason = _("Unable to shrink disk.")
raise exception.
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).
Changed in nova: | |
importance: | Undecided → Medium |
tags: | added: vmware |
Changed in nova: | |
milestone: | none → liberty-1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | liberty-1 → 12.0.0 |
Fix proposed to branch: master /review. openstack. org/173170
Review: https:/