Resized instance doesn't track new flavor, leading to possible instance-from-snapshot creation failures
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Triaged
|
Medium
|
Unassigned |
Bug Description
To reproduce the issue, follow these steps:
1) Create s small instance
2) Resize to a larger instance
3) Create a snapshot image from the resized instance
4) Create an instance from this snapshot image, selecting the smallest flavor based on the snapshot image’s ‘min_disk’ value
The expected result is that in step #4 the image’s ‘min_disk’ value can be used to select a minimum sized flavor for a new instance, leading to a successful instance creation.
The actual result is that the minimum sized flavor suggested by ‘min_disk’ is too small for the snapshot image, so instance creation fails with a 'VM too large for selected flavor' error here: https:/
This error is seen in a deployment using Xen hypervisors with Glance/Swift for image storage.
For more detailed information:
When an instance is created information about it’s image is placed into the instance’s system metadata. One image property is specially treated however: min_disk. The instance’s ‘min_disk’ value is set based on the re-size flavor’s ‘root_gb’ (see https:/
When the instance is resized (typically to a larger flavor) the instance’s ‘min_disk’ is *not* updated with the new flavor’s ‘root_gb’ (however the instance’s ‘root_gb’ is updated from the flavor). Hence when a snapshot image is created from this instance, the resultant image’s ‘min_disk’ is also set to the pre-resized value. For resize ups then, this value is then too small for the virtual disk size the snapshot will consume when instances are created from it.
A proposed fix for this issue then is to set the snapshot image’s ‘min_disk’ property in a similar way to the nova/utils.py call above:
min_disk = instance’s min_disk
if flavor:
if instance’s disk_format == ‘vhd’:
else:
The instance’s ‘min_disk’ could stay set to the original image properties for historical purposes.
Changed in nova: | |
assignee: | nobody → John Wood (john-wood-w) |
tags: | added: xen |
description: | updated |
tags: | added: resize |
Changed in nova: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Fix proposed to branch: master /review. openstack. org/301966
Review: https:/