KVM Live Migration
KVM Live Migration -----
Prerequisites -----
> Minimum 2 KVM Virtulization configured servers
> One Sharetd storage ( NFS / ISCASI / SAN )
> Both the servers are on same network
Note :- I have taken NFS Shared storage for live migration.
Steps to configure KVM live Migration -----
> Configured KVM Virtulization on server.
Follow the follwoing URL to configure KVM Virtulization on Linux server.
http://sappyit.blogspot.in/2015/01/kvm-virtulization-installation-and.html
> Configured NFS Server on network.
Follow the follwoing URL to configure NFS share on Linux server.
http://sappyit.blogspot.in/2015/01/nfs-server-installation-and.html
> Make sure Confgured Brige network on both the KVM Servers.
Follow the follwoing URL to configure KVM Virtulization on Linux server.
http://sappyit.blogspot.in/2015/01/kvm-virtulization-installation-and.html
> Confgure DNS entries for both the KVM host serves.
Command :- #vi /etc/hosts ----- Edit the hosts file on both the KVM host servers and put the following entry.
192.168.116.33 kvm1 ------ Host Server IP and Hostname
192.168.116.35 kvm2
:wq ----- Save file and exit.
Note :- I have used 192.168.116.X IP series to my KVM host servers.
> Restart Network
Command :- #service network restart
> Configured NFS share directory on both KVM servers.
Command :- #mkdir -p /var/kvm/images ----- Create images directory on /var/kvm directory on both the servers.
#mount <NFS-Share-Directory>:/storage /var/kvm/images ----- Mount NFS Server /storage directory on /var/kvm/images local server directory of both KVM servers.
> Create and start a virtual machine on a KVM host server.
Command :- #virt-install --name test1 --ram 1024 --disk path=/var/kvm/images/test1.img,size=10 --vcpu 2 --os-type linux --os-variant rhel6 --network bridge-br0 --graphics none --console pty,target_type=serial --location cdrom /var/kvm/images/rhel6.5.iso
Note :- I have created Virtual machine on KVM Host server IP:- 192.168.116.35(Hostname :- kvm2 )
The example of options above means like below
--name ----- Virtual Machine name
--ram ----- Memeory for the Virtual Machine 1024 = 1 GB
--disk ----- Virtual machine disk path and size
--vcpu ----- No of Virtual CPU for Virtual machine
--os-type ----- Type of OS line linux / windows
--os-variant ---- OS version
--network ---- Type of Network
--graphics ---- Type of installation
--console ---- Specify the console type
--location ---- Specify installation media location to install os in Virtual Machine.
After pressing the Enter key, OS installation process will start on Virtual Machine.
> To check the runing Virtual Machine on KVM Host
Command :- #virsh list ----- List the runing machine "test1" is runing machine showing in the following screen.
> Migrate runing Virtual Machine to another KVM Host server now.
Command :-#virsh migrate --live test1 qemu+ssh://192.168.116.33/system
192.168.116.33 ( Hostname :- kvm1 ) ----- This is my Target KVM Host server where I am migrating runing Virtual Machine.
EG :- Source KVM Host server IP is 192.168.116.35 and Target Host server IP is 192.168.116.33
Enter the remote server password to connect.
> Now check the VM list on source server after migarting to destination server.
Command :- #virsh list
Prerequisites -----
> Minimum 2 KVM Virtulization configured servers
> One Sharetd storage ( NFS / ISCASI / SAN )
> Both the servers are on same network
Note :- I have taken NFS Shared storage for live migration.
Steps to configure KVM live Migration -----
> Configured KVM Virtulization on server.
Follow the follwoing URL to configure KVM Virtulization on Linux server.
http://sappyit.blogspot.in/2015/01/kvm-virtulization-installation-and.html
> Configured NFS Server on network.
Follow the follwoing URL to configure NFS share on Linux server.
http://sappyit.blogspot.in/2015/01/nfs-server-installation-and.html
> Make sure Confgured Brige network on both the KVM Servers.
Follow the follwoing URL to configure KVM Virtulization on Linux server.
http://sappyit.blogspot.in/2015/01/kvm-virtulization-installation-and.html
> Confgure DNS entries for both the KVM host serves.
Command :- #vi /etc/hosts ----- Edit the hosts file on both the KVM host servers and put the following entry.
192.168.116.33 kvm1 ------ Host Server IP and Hostname
192.168.116.35 kvm2
:wq ----- Save file and exit.
Note :- I have used 192.168.116.X IP series to my KVM host servers.
> Restart Network
Command :- #service network restart
> Configured NFS share directory on both KVM servers.
Command :- #mkdir -p /var/kvm/images ----- Create images directory on /var/kvm directory on both the servers.
#mount <NFS-Share-Directory>:/storage /var/kvm/images ----- Mount NFS Server /storage directory on /var/kvm/images local server directory of both KVM servers.
> Create and start a virtual machine on a KVM host server.
Command :- #virt-install --name test1 --ram 1024 --disk path=/var/kvm/images/test1.img,size=10 --vcpu 2 --os-type linux --os-variant rhel6 --network bridge-br0 --graphics none --console pty,target_type=serial --location cdrom /var/kvm/images/rhel6.5.iso
Note :- I have created Virtual machine on KVM Host server IP:- 192.168.116.35(Hostname :- kvm2 )
The example of options above means like below
--name ----- Virtual Machine name
--ram ----- Memeory for the Virtual Machine 1024 = 1 GB
--disk ----- Virtual machine disk path and size
--vcpu ----- No of Virtual CPU for Virtual machine
--os-type ----- Type of OS line linux / windows
--os-variant ---- OS version
--network ---- Type of Network
--graphics ---- Type of installation
--console ---- Specify the console type
--location ---- Specify installation media location to install os in Virtual Machine.
After pressing the Enter key, OS installation process will start on Virtual Machine.
> To check the runing Virtual Machine on KVM Host
Command :- #virsh list ----- List the runing machine "test1" is runing machine showing in the following screen.
> Migrate runing Virtual Machine to another KVM Host server now.
Command :-#virsh migrate --live test1 qemu+ssh://192.168.116.33/system
192.168.116.33 ( Hostname :- kvm1 ) ----- This is my Target KVM Host server where I am migrating runing Virtual Machine.
EG :- Source KVM Host server IP is 192.168.116.35 and Target Host server IP is 192.168.116.33
Enter the remote server password to connect.
> Now check the VM list on source server after migarting to destination server.
Command :- #virsh list
Id Name State --------------------------------------
No VM is avalable on source KVM Host and VM is successfuly migrated to second host server.
EOF
Comments
Post a Comment