[virt-tools-list] Live migration

Justin Clift jclift at redhat.com
Thu Sep 2 01:25:48 UTC 2010


On 09/02/2010 10:25 AM, Mike Hall wrote:
> So a file based storage pool is one where VMs are stored as image
> files in a partition (our current situation), rather than on separate
> block devices such as partitions or LVs?

"Pretty much". :)

NFS migration is known to work, and is fairly easy to get up and 
running.  It's what I personally use for much of the lab stuff I do, 
because of that ease.

If you're running your systems with SELinux enabled (recommended), by 
default it's set to disallow NFS use as a security precaution.  This can 
lead to some hair pulling error messages along the lines of "permission 
denied" unless you're aware of it. ;)

To instruct SELinux to allow NFS for virtualisation, you just need to 
run a simple command to enable it:

   $ sudo setsebool -P virt_use_nfs on

(that's is you're running "root" commands through sudo)

The "-P" option in the above tells it to make the change persistent, so 
it doesn't need to be manually set each time the system is rebooted.

With the above enabled, "throwing together" a shared NFS storage pool is 
pretty easy.  Lets say you have a box "storage1" sharing out NFS storage 
from its "/export/stuffgoeshere".  Lets say you're using two KVM 
virtualisation host servers (host1 and host2) for running virtual 
machines on.

You could, on both host1 and host2, you mount that NFS storage to 
"/nfs_stuff".  Any virtual machines with their disk files in /nfs_stuff 
on the host servers should easily migrate from host1 to host2 (and back) 
when told to:

   (on host1)
   $ sudo virsh list
    Id Name                 State
   ----------------------------------
    1 vm1                  running

(that shows a guest called "vm1" running on host1)


   $ sudo virsh migrate vm1 qemu+ssh://host2/system --live --p2p --tunnelled

(that migrates the guest from host1 to host2, tunnelling the data
  over ssh you I don't have to think about firewall configuation)


   $ sudo virsh list
    Id Name                 State
   ----------------------------------

(this shows the virtual machine is no longer on host2)

Subsequently checking on host2 shows:

   $ sudo virsh list
    Id Name                 State
   ----------------------------------
     1 vm1                  running

   $

Does that help?

Regards and best wishes,

Justin Clift


> Thanks again




More information about the virt-tools-list mailing list