How to connect a running VM into openstack

asked 2014-12-22 18:09:31 -0600

Richard gravatar image

Hi all,

Is that possible to connect a running VM, created by libvirt, into Openstack? Or say, if I use libvirt to take a live snapshot for VM-1 on the host machine 1, and then I copy the files onto host machines 2. How can I start a VM-2 with the snapshot of VM-1, and Openstack can manage the VM-2? We can use libvirt to start the VM-2 with the snapshot, but then I need to connect this running VM into openstack.

The VM-1 should keep running.

Is there any hint on doing this, or any other ways to perform a live clone between host machines on Openstack (not live migration)? Many thanks!

Regards, Richard

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-12-23 05:46:31 -0600

bishoy gravatar image

updated 2014-12-23 05:50:38 -0600

You can take a snapshot and upload it to the Glance images of openstack and then relaunch it. after obtaining the snapshot you can use glance image-create command to create the image from the snapshot. If you need to specify a specific host to launch the machine you can add to the nova boot command this option: --availability-zone nova:host2.

edit flag offensive delete link more


Thank you so much, Bihsoy! But I think if use this way, then the new VM does not have the same memory state with the old VM. The snapshot taken by image-create is the snapshot of the disk, it does not contain memory status.

Richard gravatar imageRichard ( 2014-12-24 14:12:09 -0600 )edit

answered 2014-12-23 18:26:20 -0600

Darkinvader gravatar image

Tell us more about your running VM. Is it using also kvm? Is it using the same storage backend to store its disk? For example file or LVM? If you have same storing mechanism I would try to create new VM with similar specs (memory, cpu, disk space) then scp the file into new VM replacing its content or dd/over ssh entire lvm.

You can also do something 100% proven which would be, boot original VM from live CD, built new VM with similar specs and also boot it from live CD. Mount both filesystem and rsync --delete it.

edit flag offensive delete link more


Thank you so much Darkinvader! The VM type and storage backend are all not limited, so just assume they are the same. What I need is to "live clone" an old VM, so we get the memspec and disk of it, and then we scp to create a new VM in another openstack project. For the new VM, it looks like that i

Richard gravatar imageRichard ( 2014-12-24 14:12:30 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-12-22 18:09:31 -0600

Seen: 205 times

Last updated: Dec 23 '14