Booting an instance from snapshot (which is an instance booted from Cinder volume) fails with: "Volume is smaller than the minimum size specified in image metadata."
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Medium
|
Chris Martin |
Bug Description
Description
===========
Booting an instance from snapshot (which is an instance booted from Cinder volume) fails with:
ERROR (BadRequest): Volume is smaller than the minimum size specified in
image metadata. Volume size is 1073741824 bytes, minimum size is
3221225472 bytes. (HTTP 400) (Request-ID:
req-
[Source: Originally reported by <email address hidden> as a downstream bug report.]
I reproduced this issue with upstream Nova on a single-node DevStack. Details below:
Steps to reproduce
==================
(1) Create a new Nova flavor (`nova flavor-create <name> <id> <ram>
<disk> <vcpus>`):
$ nova flavor-create m1.test 6 256 3 1
(2) Create a Cinder volume (the UUID here is of
cirros-
$ cinder create --display-name cirr-vol1 \
--image-id 577d309a-
(3) Boot an instance from the created volume the UUID below is of
the the Cinder volume created above:
$ nova boot --boot-volume 360f97a0-
--flavor 6 instance-
(4) Create a snapshot of the instance we just booted:
$ nova image-create --poll instance-
(5) Enumerate Glance images to get the UUID of the snapshot created
above:
$ glance image-list | grep snap-of-
| awk '{print$2}'
a8b8b3b1-
(6) Boot an instance using the above snapshot UUID as the image:
$ nova boot --flavor 6 --image a8b8b3b1-
Actual Results
==============
$ nova boot --flavor 6 --image a8b8b3b1-
ERROR (BadRequest): Volume is smaller than the minimum size specified in
image metadata. Volume size is 1073741824 bytes, minimum size is
3221225472 bytes. (HTTP 400) (Request-ID:
req-
Expected Results
================
Booting an instance from snapshot of a Cinder volume should succeed
Environment
===========
When I reproduced this issue with upstream Nova on DevStack, I was on
these commits:
-------
cinder
1eef3c7 (Merge "NetApp: Add iterator handling to client library", 2016-05-26)
devstack
327f8d1 (Merge "Fix typo in local variable name in time_stop", 2016-05-27)
devstack-
d2d9575 (Added .gitreview, 2016-04-21)
glance
24fae90 (Merge "Normalize the options use singele quotes", 2016-05-24)
keystone
0b65a96 (Merge "Add identity providers integration tests", 2016-05-26)
neutron
d320df5 (Merge "Don't load DNS integration in l3_router_plugin", 2016-05-26)
nova
784f88b (Merge "Updated from global requirements", 2016-05-27)
requirements
2d2d21d (Merge "Raise mock requirement to 2.0", 2016-05-26)
-------
Changed in nova: | |
status: | New → Confirmed |
tags: | added: snapshot volumes |
Changed in nova: | |
importance: | Undecided → Medium |
Changed in nova: | |
assignee: | nobody → Chris Martin (cm876n) |
status: | Confirmed → In Progress |
Matthew Booth has also reproduced this issue, and noting his comments from the downstream bug here:
-------------
I just reproduced this in devstack, and this looks like a real bug to me. The issue is the image metadata generated when creating the snapshot.
In my reproducer, I've created a volume from a cirros image with no min_disk. I booted a flavor with a 2G root disk, although obviously that root disk is not created when booting from volume. I then snapshotted the instance. The resulting image metadata in the snapshot contains:
min_disk | 2
min_ram | 0
size | 0
I assume that min_disk here has been copied from the flavor size. This is obviously bogus. I believe that when we create the snapshot metadata we should copy image metadata from the source, and set size to the actual size.
Just to clarify, in the above reproducer I think that the bug has occurred by the time the snapshot is created. That may mean that the bug is in the creation of the snapshot, or it may mean that some metadata copied during that process is already wrong and the bug happened even earlier.
A workaround would be to update the image metadata of the snapshot to set min_disk to 0.
-------------