CiscoSystems/nova — pull request #5 by MartinFalatic (2014-06-19 21:07:47+00:00)
Title: cherrypick: Update block_device_info to contain swap and ephemeral disks (backport of bug 1305423)

Original bug report (fixed in Juno master) is at https://bugs.launchpad.net/nova/+bug/1305423

Upstream review for this backported bugfix is at: https://review.openstack.org/#/c/100362/

An ephemeral or swap disk is attached to an instance on boot
as follows: nova boot --flavor FLAVOR --image IMAGE_ID
--swap 512 --ephemeral size=2 INSTANCE. When a hard reboot is
performed on the instance, nova fails to recreate the
appropriate libvirt XML definition, containing the ephemeral
disk. This is because the correct block_device_info dict that
is passed to the compute manager's reboot_instance method does
not contain swap or ephemeral disk key values that are necessary
to recreate those disks. In addition to nova boot, the correct
block_device_info dict is also needed by nova rebuild, reboot,
resize, and migrate to recreate those disks. This patch updates
_get_instance_volume_block_device_info (renamed
_get_instance_block_device_info) to return the swap and ephemeral
disk key values, in addition to the block_device_mapping it
already returns today.

Change-Id: Iec329d1c12a48ea90ba9d57decd0996fde6544f0
Closes-Bug: #1305423
(cherry picked from commit f087a6f77ef1338bb8d10943d2a18712220c3c44)
(cherry picked from commit a4fd1b5a65d6419d9507f3c0d97f977aa4a9d837)