Create first instance using a image with create new volume(new volume size is smaller than the favor's root disk size), then create a snapshot of the first instance ,failed to create a second instance using the instance snapshot.

Bug #1748348 reported by sunjiazz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Medium
sunjiazz

Bug Description

You can use the following steps to reproduce:
1.Specifically,create first instance using a image with create new volume(new volume size is smaller than the favor's root disk size).
2.create a snapshot of the first instance.
3.failed to create a second instance using the first instance snapshot.
Error info is as follows:
Volume is smaller than minimum size specified in image metadata.Volume size is XXX bytes,minimum size is XXX bytes.(HTTP 400)

Tags: api snapshot
sunjiazz (sunjiazz)
Changed in nova:
assignee: nobody → sunjiazz (sunjiazz)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/542646

Changed in nova:
status: New → In Progress
Matt Riedemann (mriedem)
tags: added: api snapshot
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
Matt Riedemann (mriedem) wrote :

I was able to recreate this. I created a volume-backed server from an image where nova creates the volume:

$ nova boot --block-device id=7340f38d-faf4-43fa-bbd1-fbc034b0b770,source=image,dest=volume,bootindex=0,size=1 --flavor m1.small --poll bug1748348

That creates a 1GB volume. The root_gb disk size on the m1.small flavor in devstack is 20GB.

I then created a snapshot of the volume-backed instance which gives me this image:

http://paste.openstack.org/show/677911/

This is the important information from the image:

| min_disk | 20 |
| properties | base_image_ref='', bdm_v2='True', block_device_mapping='[{"guest_format": null, "boot_index": 0, "delete_on_termination": false, "no_device": null, "snapshot_id": "1158debc-9922-458d-9b46-8ef688334d65", "device_name": "/dev/vda", "disk_bus": "virtio", "image_id": null, "source_type": "snapshot", "tag": null, "device_type": "disk", "volume_id": null, "destination_type": "volume", "volume_size": 1}]', boot_roles='Member,anotherrole', owner_project_name='demo', owner_user_name='demo', root_device_name='/dev/vda' |

So the image says it requires a minimum disk of 20 and the volume says it is size 1, and then trying to create a server with that fails:

$ openstack server create --image 79d58c3a-80c1-4de2-afa8-b2927e4cb5cc --flavor m1.small server-from-vol-backed-snapshot
Volume is smaller than the minimum size specified in image metadata. Volume size is 1073741824 bytes, minimum size is 21474836480 bytes. (HTTP 400) (Request-ID: req-5b263cff-3da5-4073-9fc6-a4d8ab231818)

That's due to this code:

https://github.com/openstack/nova/blob/e6a36034bd43ed979e1e453fc3f2cfa28f1dd4c4/nova/compute/api.py#L574-L610

Which was added way back in Liberty:

https://github.com/openstack/nova/commit/642c986f0636d52a9ba279c87e25082b4aa9b3b8

We likely want mdbooth to look at the proposed fix.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: master
Review: https://review.openstack.org/542646
Reason: Moving focus to https://review.openstack.org/#/c/407397/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.