Migrate Solusvm VPS from 1 node to another node (Updated) Print

  • 0

References: combination of current KB Article:-
http://www.nocser.net/clients/knowledgebase/401/Migrate-Solusvm-VPS-from-1-node-to-another-node.html (Marked as [KB] below)
and SolusVM docs:-
http://docs.solusvm.com/xen_migrations?s[]=migrate (Marked as [DOC] below)

(Objective: to achieve shortest migrate time (i.e. tar vs dd + parallel tasks) while maintaining closely to documented procedures (solusvm docs))

1. First, you need to identify which node and what VM ID corresponds to the VM you are migrating. To do this:-
- Log in to SolusVM, click "List Virtual Servers", locate the VM and click on "Manage Virtual Machine" on the VM to be migrated.
- At the management dashboard, focus on the "Information" section, and note down these values for your easy reference during the migration:-
(i) ID (This is the VM ID at Xen level, not SolusVM level - you need to make sure you use the right ID). In this example, the VM ID is 'vm203'.
(ii) Host node (the node where the VM resides in. You need to SSH to this node).

2. SSH into the host node of the VM, locate and Shutdown the VM to be moved:- [DOC]
# xm list 
(Make sure your VM ID as stated in ID of the information section above is listed)
# xm shutdown vm203
(Wait until your VM shows 'offline' in SolusVM dashboard)

3. lvdisplay to see which volume to backup:- [DOC]
# lvdisplay
(The relevant volumes should have the VM ID prefixed to it).

4. Mount the volume to a tmp mount dir and tar the contents:- [KB]
# cd /home/xen/vm203
(You can view the VM config file: more vm203.cfg - to double check the volumes used)
# mount /dev/VolGroup00/vm203_img /home/xen/vm203/mnt
# df -h 
(Make sure the volume is mounted with the correct expected size as described in SolusVM dashboard)
# cd /home/xen/vm203/mnt
# tar cpf ../vm203.tar *

5. While tar process #2 is progressing, prepare the destination node by SSH to it and creating identical volumes (both img and swap):- [DOC]
(NOTE: Make sure double check with Information section of the source VM and ensure the volume names and sizes match - below are example only)
# lvcreate -n vm203_img --size 30G /dev/VolGroup00
# lvcreate -n vm203_swap --size 2G /dev/VolGroup00
# mkswap /dev/VolGroup00/vm203_swap
# mkfs.ext3 /dev/VolGroup00/vm203_img
# mkdir -p /home/xen/vm203.backup
# mount /dev/VolGroup00/vm203_img /home/xen/vm203.backup
# df -h
(Make sure the new volume is mounted with the expected size, ready to be restored into).

6. When tar process #2 is done, copy over the tarball from source to destination node and untar it to the newly created volume:- [KB]
# scp -vrpP 22222 srcnode:/home/xen/vm203/vm203.tar /home/xen/
# cd /home/xen/vm203.backup
# tar xvpf ../vm203.tar
# umount /home/xen/vm203.backup

7. Now, SSH to mas (SolusVM Master Server), and migrate the VM via SolusVM:- [DOC]
Using /scripts/vm-migrate (Refer to SolusVM dashboard, and this time use the SolusVM vserverID of the source VM (not the Xen VM ID) as the first parameter, followed by newnodeid: ID of node). Example:-
# /scripts/vm-migrate 208 6
Virtual server information updated!
(migrating vmserverID 208 to node ID 6).

8. Open SolusVM admin dashboard, find and open the VM entry, make sure it has moved to new node. If the VM is moved to a different subnet, make sure it is assigned with the new IP, as follows:-
- In SolusVM admin dashboard, find and open the newly moved VM entry, and click on "IPs". Assign a new additional IP from the new block.
- Back at the dashboard, click on "Main IP". Switch to the newly assigned IP in the new block. Take note of this new IP for further admin tasks eg DNS later.
- Back at the dashboard, click again on "IPs". Delete the old IP from the list.

9. Back at the dashboard, click "Reboot" (Make sure Reboot, not just Boot) to write new config to new node and boot the VM in the new node. [DOC]

10. Verify boot successful via SolusVM VM console and confirm with customer that all is OK.

10. Check VM is no longer running / exist in source node:-
[root@server05 ~]# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 1929 8 r----- 1018329.9
[root@server05 ~]#

11. Check VM is now running in destination node:-
[root@server12 ~]# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 4472 8 r----- 3522925.2
vm166 60 1000 1 -b---- 561858.7
vm178 31 500 1 -b---- 30837.5
vm203 84 1024 1 -b---- 85.1
vm248 83 500 1 -b---- 102810.1
[root@server12 ~]#


and also:-

X. The cleanup steps afterwards (leave for a few days before cleanup):- [DOC]
# umount /home/xen/vm203/mnt
# lvremove /dev/VolGroup00/vm203_img
# lvremove /dev/VolGroup00/vm203_swap

Was this answer helpful?

« Back