O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To migrate an instance without shared storage, use the following steps:

  1. Ensure that the KVM guest is running:
root@kvm1:~# virsh list --all Id   Name              State---------------------------------------------------- 33   kvm_no_sharedfs   runningroot@kvm1:~#
  1. Find the location of the image file:
root@kvm1:~# virsh dumpxml kvm_no_sharedfs | grep "source file" <source file='/tmp/kvm_no_sharedfs.img'/>root@kvm1:~#
  1. Transfer the image file to the destination host:
root@kvm1:~# scp /tmp/kvm_no_sharedfs.img kvm2:/tmp/kvm_no_sharedfs.img 100% 5120MB 243.8MB/s 00:21root@kvm1:~#
  1. Migrate the instance and ensure that it's running on the destination host:
root@kvm1:~# virsh migrate --live --persistent --verbose --copy-storage-all kvm_no_sharedfs ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required