Activity log for bug #1565590

Date Who What changed Old value New value Message
2016-04-04 02:47:56 John Wood bug added bug
2016-04-04 02:50:00 John Wood nova: assignee John Wood (john-wood-w)
2016-04-04 06:11:40 Belmiro Moreira bug added subscriber Belmiro Moreira
2016-04-04 14:14:55 Markus Zoeller (markus_z) tags xen
2016-04-04 15:10:49 John Wood 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://github.com/openstack/nova/blob/master/nova/virt/xenapi/vm_utils.py#L901 This error is seen in a deployment using Xen hypervisors with Glance/Swift for image storage. 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://github.com/openstack/nova/blob/master/nova/virt/xenapi/vm_utils.py#L901 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://github.com/openstack/nova/blob/master/nova/utils.py#L1229). When a snapshot image is created from the instance, the instance’s ‘min_disk’ value is added to image’s properties. This ‘min_disk’ setting can then be used as per step #4 above. 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’: min_disk = resize flavor’s root_gb else: min_disk = max(min_disk, resize flavor’s root_gb) The instance’s ‘min_disk’ could stay set to the original image properties for historical purposes.
2016-04-04 20:07:57 Matt Riedemann tags xen resize xen
2016-04-04 20:07:59 Matt Riedemann nova: status New Triaged
2016-04-04 20:08:03 Matt Riedemann nova: importance Undecided Medium
2016-04-05 23:09:10 OpenStack Infra nova: status Triaged In Progress
2017-06-27 19:22:36 Sean Dague nova: status In Progress Triaged
2017-06-27 19:22:43 Sean Dague nova: assignee John Wood (john-wood-w)