The following should be performed to manually migrate Xen VPS (PV or HVM) from one node to another:
- Stop the required VPS in SolusVM > Virtual Servers > VPS > Shutdown. Note VMID of VPS, for example, it is vm101.
Connect to the source slave node over SSH.
Find a logical volume of the VPS:
# lvdisplay | grep "LV Path" | grep "vm101" LV Path /dev/solusvm/vm101_img
Create a copy of the logical volume:
# dd if=/dev/yourvg/vm101_img | gzip | dd of=/home/vm101_backup.gz bs=4096
Note: to see the progress of the copying
Transfer the copy to the target slave node, for example using the following command on the source node:
# scp -C /home/vm101_backup.gz root@targetserverip:/home/
- Connect to the target server over SSH.
Create a logical volume with the same size and name:
# lvcreate -n vm101_img --size 10G /dev/yourvg
Additional step for Xen PV - create a logical volume for swap with the same size as it is set in SolusVM > Virtual Servers > VPS:
# lvcreate -n vm101_swap --size 1G /dev/yourvg
Restore the copy to the created logical volume:
# dd if=/home/vm101_backup.gz | gzip -d | dd of=/dev/yourvg/vm101_img bs=4096
Connect to your Master node over SSH.
Update Master node database with the new location of VPS
# /scripts/vm-migrate ID NEWNODEID
where ID - ID of the migrated VPS, can be seen in column ID in SolusVM > Virtual Servers; NEWNODEID - ID of the target node, can be seen in SolusVM > Nodes.
For example:# /scripts/vm-migrate 20 5
- Reboot VPS via SolusVM > Virtual Server > migrated VPS > Reboot for changes to take effect and verify that it is working.
After verifying correct work of VPS - remove logical volume on the source server:
# lvremove /dev/yourvg/vm101_img
For Xen PV also remove logical volume for swap:
# lvremove /dev/yourvg/vm101_swap