Wednesday, July 27, 2011

Migrating running VMs using virsh


  1. All VM images are mounted on a shared location,  for example: /vmimages. If any images are qcow2 images with a backing file, those files also need to be present on shared locations.
  2. kvm-pxe needs to be installed. If not, the migration occurs, but the VM is suspended at the destination.
  3. Optional: If you want to be able to do this from scripts, setup ssh keys so you don't need to enter passwords

Migrate with the following command as root on the source host:

virsh migrate --live vmname qemu+ssh://

or if you are not on source, you can first connect to the source host

virsh --connect qemu:// migrate --live vmname \

No comments: