Quantcast
Viewing all articles
Browse latest Browse all 7

Answer by schegi for Hi, my problem, i got a couple of KVM/Qemu virtual machines running on some old server backed in local lvm storage. In paralell, i got a newly deployed openstack private cloud with cinder/ceph as storage backend. Now i somehow like to migrate these VMs from the old infrastructure to the new. I general it is very easy to just run the VMs on the openstack server, just: dd if=the_lvm_volume | pv | ssh storage_node 'rbd -p my_volume_pool import - new_volume' And then start a VM from this volume, e.g. using virsh. But this way, the volume is not recognized by cinder and the vm not by nova. Therefore i could not manage it with openstack. It worked to import the volume as glance image and then start a machine from this image. But i like to have it as volume not image, especially because some of the VMs i like to migrate have multiple volumes attached to the VM. And doing all via glance is a whole bunch of extra work. I also tried to just create a volume in cinder, same size as the original volume and import to that volume but unfortunately rbd does not allow to import to an existing volume. Would it make sense to create a volume in cinder, delete it with rbd and import to a new volume with the same name? UPDATE: Ok tested this option and it seemed to work. Created a volume (Size of the volume to import) in cinder, get the uuid of the volume then delete the corresponding volume in ceph manually using rbd. Then i did the rbd import with destination of the delete volume and made it bootable. Afterwards i was able to use this volume to start an instance using nova. A litte dirty workaround but it seems to do the job. Is there any other 'recommended' way to import whole VMs to a openstack environment? Thx Stefan

Next: Comment by dbaxps for Hi, my problem, i got a couple of KVM/Qemu virtual machines running on some old server backed in local lvm storage. In paralell, i got a newly deployed openstack private cloud with cinder/ceph as storage backend. Now i somehow like to migrate these VMs from the old infrastructure to the new. I general it is very easy to just run the VMs on the openstack server, just: dd if=the_lvm_volume | pv | ssh storage_node 'rbd -p my_volume_pool import - new_volume' And then start a VM from this volume, e.g. using virsh. But this way, the volume is not recognized by cinder and the vm not by nova. Therefore i could not manage it with openstack. It worked to import the volume as glance image and then start a machine from this image. But i like to have it as volume not image, especially because some of the VMs i like to migrate have multiple volumes attached to the VM. And doing all via glance is a whole bunch of extra work. I also tried to just create a volume in cinder, same size as the original volume and import to that volume but unfortunately rbd does not allow to import to an existing volume. Would it make sense to create a volume in cinder, delete it with rbd and import to a new volume with the same name? UPDATE: Ok tested this option and it seemed to work. Created a volume (Size of the volume to import) in cinder, get the uuid of the volume then delete the corresponding volume in ceph manually using rbd. Then i did the rbd import with destination of the delete volume and made it bootable. Afterwards i was able to use this volume to start an instance using nova. A litte dirty workaround but it seems to do the job. Is there any other 'recommended' way to import whole VMs to a openstack environment? Thx Stefan
This process did the job for me 1. Get the size of the of the volume you like to transfer. 2. Create a volume of that size, using cinder API or dashboard. Remember the UUID oft that Volumen. 3. Delete the corresponding Volumen in ceph using rbd. With default cinder naming scheme, the corresponding CH Volumen is called volume-. 4. Import the data from the original volume using dd and rbd import into a volume oft the same name as the deleted. 5. Make the volume bootable.

Viewing all articles
Browse latest Browse all 7

Trending Articles