Get Virtualizor

Live Migration

Requirements

Live migration on KVM Virtualizor is available since 3.0.6 (release candidate version) and the feature is in beta.

  • It is recommended to migrate between same hardware structure and OS to avoid issues.
  • For this feature to work, having a shared storage is not mandatory.
  • IP pool on panel (assuming its routed to work on source and destination servers) should be shared amongst servers.
  • ISO, if attached to the VM, should also be shared on destination server before migration.
  • VPS should not be powered off for starting live migration.
  • Live migration will not sparse the VPS disk if its using Thin-LVM on source server.
  • Destination server's hostname should NOT be set to 'localhost'.
  • Handling the progress of live migration task on tasks page is pending and will be available soon.
  • Live migration from Intel CPU to AMD is currently not working if CPU mode is set to "host-model" for vps.
  • Live migration uses ports from 49152 to 49261, If they are blocked then migration will be affected.

Troubleshooting

 live migration at 99% progress

If the transfer logs in live migration task shows its stuck in 99% then it's most likely due to the current downtime set for the VPS.

image

You can check the expected downtime for VPS on Source server :

virsh domjobinfo VID

You can find VID on list VPS page
Log Output Example for CentOS 7 host:

[root@centos7 ~]# virsh domjobinfo v1001

Job type: Unbounded 

Time elapsed: 1156 ms 

Data processed: 104.983 MiB 

Data remaining: 2.568 GiB 

Data total: 3.923 GiB 

Memory processed: 104.983 MiB 

Memory remaining: 2.568 GiB 

Memory total: 3.923 GiB 

Memory bandwidth: 191.744 MiB/s 

Dirty rate: 0 pages/s 

Iteration: 0 

Constant pages: 328857 

Normal pages: 26269 

Normal data: 102.613 MiB 

Expected downtime: 3000 ms 

Setup time: 32 ms

You can then set a higher downtime value on the slave server for the VPS.
View existing downtime : 

virsh migrate-getmaxdowntime VID

You can set new downtime based on the domjobinfo command output where it shows expected downtime.
Set new downtime value
(As per your suitable value) : 

virsh migrate-setmaxdowntime VID <milliseconds>

Increasing downtime should make the migration finish faster.

Connection refused

While checking in live migration task, if you see something similar to following image as seen for transfer logs : 

1. Then mostly this error is due to firewall active on your source and destination server.
Live migration uses ports from 49152 to 49261, If there is any firewall restricting this, you will need to allow these ports.

For iptables

iptables -I INPUT -p tcp -m tcp --dport  49152:49261 -j ACCEPT

For Firewalld

firewall-cmd --zone=public --permanent --add-port=49152-49261/tcp

firewall-cmd --reload

2. Also make sure root login is enabled on your servers.

 3. Check if the source server can connect to the destination server using virsh.
On attempting migration from panel, Virtualizor will generate the ssh key file : /var/virtualizor/ssh-keys/id_rsa

virsh -c qemu+ssh://root@Destination-server-ip:ssh-port/system?keyfile=/var/virtualizor/ssh-keys/id_rsa

Replace Destination-server with the server's IP and ssh-port with its SSH port.

4. Check if hosts file (/etc/hosts) is having correct entry of your server.
On attempting migration from panel, Virtualizor will add entry for destination server in /etc/hosts file on the Source server.

    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list