the snapshot of a volume-backed instance cannot be used to boot a new instance
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| OpenStack Compute (nova) |
High
|
Unassigned | ||
| Havana |
High
|
Unassigned |
Bug Description
After the changes in the block device mappings introduced for Havana, if we try to create an snapshot of a volume-backed instance the resulting image cannot be used to boot a new instance due to conflicts with the bootindex between the block_device_
The steps to reproduce are:
$ glance image-create --name f20 --disk-format qcow2 --container-format bare --min-disk 2 --is-public True --min-ram 512 --copy-from http://
$ cinder create --image-id <uuid of the new image> --display-name f20 2
$ nova boot --boot-volume <uuid of the new volume> --flavor m1.tiny test-instance
$ nova image-create test-instance test-snap
This will create an snapshot of the volume and an image in glance with a block_device_
| Property 'block_
When we try latter to use this image to boot a new instance, the API won't let us because both, the device in the image bdm and the image (which is empty) are considered to be the boot device:
$ nova boot --image test-snap --flavor m1.nano test-instance2
ERROR: Block Device Mapping is Invalid: Boot sequence for the instance and image/block device mapping combination is not valid. (HTTP 400) (Request-ID: req-3e502a29-
If we check the internal flow we can see that nova considers the image to be the boot device even thought the image itself doesn't define any local disk but only a block_device_
To be able to generate proper images from volume-backed instances we should:
1. copy only the relevant keys from the original block_device_
2. prevent nova from adding a new block device for the image if this one doesn't define any local disk
Changed in nova: | |
importance: | Undecided → Medium |
Changed in nova: | |
status: | New → In Progress |
OpenStack Infra (hudson-openstack) wrote : | #2 |
Fix proposed to branch: master
Review: https:/
Raising importance because instance volume-backed snapshots are the only type of snapshots the EC2 API use.
Changed in nova: | |
importance: | Medium → Critical |
Changed in nova: | |
importance: | Critical → High |
Reviewed: https:/
Committed: http://
Submitter: Jenkins
Branch: master
commit eddd8a14cd2393c
Author: Xavier Queralt <email address hidden>
Date: Wed Oct 30 20:21:03 2013 +0100
Clean BDM when snapshoting volume-backed instances
When snapshoting a volume-backed instance, its block device mapping is
copied entirely into the image properties of the resulting snapshot.
This may lead to some errors when booting from that snapshot because the
fields 'id', 'insance_uuid' and 'connection_info' must be generated for
each instance instead of reusing the ones from the original instance.
For example, sharing the connection_info will cause the new instance to
try to connect to the original volume instead of creating a new one.
This patch cleans all the database-specific plus the connection_info
fields from the block device mapping when creating the snapshot.
Change-Id: I4190e9519d641c
Partial-Bug: #1246327
Changed in nova: | |
status: | In Progress → Fix Committed |
OpenStack Infra (hudson-openstack) wrote : | #5 |
Reviewed: https:/
Committed: http://
Submitter: Jenkins
Branch: master
commit 482dfeb113f1e0f
Author: Xavier Queralt <email address hidden>
Date: Wed Oct 30 21:25:55 2013 +0100
Process image BDM earlier to avoid duplicates
If the block device mapping from the image properties are not handled at
the same time as the ones defined from the API, we might make the false
assumption that the instance has no root and failing or, in the case
we're booting from an image that only defines a BDM and has no disk,
creating a local disk BDM as root and ending up with two root devices
which is forbidden.
This patch moves the handling of the image block device mappings to the
same method were we check the ones provided throught the API. This
allows nova to decide wether the instance needs a local disk from an
image if no root device is defined in any of the block device mappings.
Change-Id: Ide95357895ab4d
Closes-Bug: #1246327
Fix proposed to branch: stable/havana
Review: https:/
OpenStack Infra (hudson-openstack) wrote : | #7 |
Fix proposed to branch: stable/havana
Review: https:/
Changed in nova: | |
status: | Fix Committed → Fix Released |
Reviewed: https:/
Committed: http://
Submitter: Jenkins
Branch: stable/havana
commit cad49c3f2aac14b
Author: Xavier Queralt <email address hidden>
Date: Wed Oct 30 20:21:03 2013 +0100
Clean BDM when snapshoting volume-backed instances
When snapshoting a volume-backed instance, its block device mapping is
copied entirely into the image properties of the resulting snapshot.
This may lead to some errors when booting from that snapshot because the
fields 'id', 'insance_uuid' and 'connection_info' must be generated for
each instance instead of reusing the ones from the original instance.
For example, sharing the connection_info will cause the new instance to
try to connect to the original volume instead of creating a new one.
This patch cleans all the database-specific plus the connection_info
fields from the block device mapping when creating the snapshot.
Change-Id: I4190e9519d641c
Partial-Bug: #1246327
(cherry picked from commit eddd8a14cd2393c
tags: | added: in-stable-havana |
tags: | removed: in-stable-havana |
OpenStack Infra (hudson-openstack) wrote : | #9 |
Reviewed: https:/
Committed: http://
Submitter: Jenkins
Branch: stable/havana
commit 1d2a0b8cc640efc
Author: Xavier Queralt <email address hidden>
Date: Wed Oct 30 21:25:55 2013 +0100
Process image BDM earlier to avoid duplicates
If the block device mapping from the image properties are not handled at
the same time as the ones defined from the API, we might make the false
assumption that the instance has no root and failing or, in the case
we're booting from an image that only defines a BDM and has no disk,
creating a local disk BDM as root and ending up with two root devices
which is forbidden.
This patch moves the handling of the image block device mappings to the
same method were we check the ones provided throught the API. This
allows nova to decide wether the instance needs a local disk from an
image if no root device is defined in any of the block device mappings.
Change-Id: Ide95357895ab4d
Closes-Bug: #1246327
(cherry picked from commit 482dfeb113f1e0f
Changed in nova: | |
milestone: | icehouse-1 → 2014.1 |
LnxSlck (brunomiguelqueiros) wrote : | #10 |
This bug still affects me and i'm running openstack 1.0.1
Fix proposed to branch: master /review. openstack. org/54633
Review: https:/