[cinder][nova] Migrating servers' root block devices from a cinder backend to another

Lee Yarwood lyarwood at redhat.com
Thu Jan 30 08:57:02 UTC 2020


On 29-01-20 15:50:13, Jean-Philippe Méthot wrote:
> Hi,
> 
> We have a several hundred VMs which were built on cinder block devices
> as root drives which use a SAN backend. Now we want to change their
> backend from the SAN to Ceph.  We can shutdown the VMs but we will not
> destroy them. I am aware that there is a cinder migrate volume command
> to change a volume’s backend, but it requires that the volume be
> completely detached. Forcing a detached state on that volume does let
> the volume migration take place, but the volume’s path in Nova
> block_device_mapping doesn’t update, for obvious reasons.
> 
> So, I am considering forcing the volumes to a detached status in
> Cinder and then manually updating the nova db block_device_mapping
> entry for each volume so that the VM can boot back up afterwards.
> However, before I start toying with the database and accidentally
> break stuff, has anyone else ever done something similar? Got any tips
> or hints on how best to proceed?

Assuming you're using the Libvirt driver, a hackaround here is to cold
migrate the instance to another host, this refreshes the connection_info
from c-api and should allow the instance to boot correctly.

FWIW https://review.opendev.org/#/c/696834/ will hopefully support live
attached volume migrations to and from Ceph volumes thanks to recently
-blockdev changes in Libvirt and QEMU.

I also want to look into offline attached volume migration in the V
cycle, IIRC swap_volume fails when the instance isn't running but in
that case it's essentially a noop for n-cpu and assuming c-vol rebases
the data on the backend it should succeed.

Anyway, hope this helps!

-- 
Lee Yarwood                 A5D1 9385 88CB 7E5F BE64  6618 BCA6 6E33 F672 2D76
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20200130/13e30083/attachment.sig>


More information about the openstack-discuss mailing list