CentOS 7
Ads

Live Migration
2014/08/12
 
This is the example to use Live Migration function for virtual machines.
This requires 2 KVM host server and a storage server like follows.
Please set DNS or hosts to resolve names or IP addresses normally, first.
                      +----------------------+
                      |   [  NFS Servver  ]  |
                      |     nfs.srv.world    |
                      |                      |
                      +-----------+----------+
                                  |10.0.0.30
                                  |
+----------------------+          |          +----------------------+
|  [   KVM Host #1  ]  |10.0.0.21 | 10.0.0.22|  [  KVM Host #2   ]  |
|                      +----------+----------+                      |
|   kvm01.srv.world    |                     |   kvm02.srv.world    |
+----------------------+                     +----------------------+

[1]
Configure Storage server which has virtual machine images. For Storage server, it's OK to use NFS, iSCSI, GlusterFS and so on. This example uses NFS Storage server.
[2]
Configure 2 KVM host server and mount a directory provided from Storage server on the same mount point on both KVM server. This example mounts on [/var/kvm/images].
[3]
Create and start a virtual machine on a KVM host server.
[4] It's OK all, execute Live Migration like follows on server which virtual machine is running. After finishing it, virtual machine is migrated on another KVM host like follows.
[root@kvm01 ~]#
virsh list

 Id    Name             State
--------------------------------------
 3     centos7          running

[root@kvm01 ~]#
virsh migrate --live centos7 qemu+ssh://10.0.0.22/system

root@10.0.0.22's password:
# root password
[root@kvm01 ~]#
virsh list

 Id    Name             State
--------------------------------------
 
# just migrated
### on another KVM Host ###

[root@kvm02 ~]#
virsh list

 Id    Name              State
---------------------------------------
 1     centos7           running

# back to the KVM Host again like follows

[root@kvm02 ~]#
virsh migrate --live centos7 qemu+ssh://10.0.0.21/system

root@10.0.0.21's password:
[root@kvm02 ~]#
virsh list

 Id    Name             State
--------------------------------------

 
Tweet