Friday, 18 July 2014

Xen HVM Migration

Migrate VM[vm139]:

Source Node:
-------------

--- Logical volume ---
  LV Path                /dev/vg_grp/vm139_img
  LV Name                vm139_img
  VG Name                vg_grp
    LV Status              available
  # open                 3
  LV Size                10.00 GiB
  Current LE             320
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:24

Source Node:
-------------

Backup:
--------

lvcreate -n vm139_backup --size 15G /dev/vg_grp


mkfs.ext3 /dev/vg_grp/vm139_backup

mkdir -p /home/vm139_backup

mount /dev/vg_grp/vm139_backup /home/vm139_backup

xm shutdown vm139

dd if=/dev/vg_grp/vm139_img of=/home/vm139_backup/vm139_backup.img


Destination Node:
-----------------

lvcreate -n vm139_backup --size 15G /dev/vg_xenhvm

lvcreate -n vm139_img --size 10G /dev/vg_xenhvm

mkfs.ext3 /dev/vg_xenhvm/vm139_backup

mkdir -p /home/vm139_backup

mount /dev/vg_xenhvm/vm139_backup /home/vm139_backup


Transfer:
----------

scp -C /home/vm139_backup/vm139_backup.img root@x.x.x.x:/home/vm139_backup/

Restore:
---------

dd if=/home/vm139_backup/vm139_backup.img of=/dev/vg_xenhvm/vm139_img

Solusvm server:
-----------------

Need to move the VM from slave1 to slave2,

/scripts/vm-migrate 104 4


Then Reboot the VM via solusvm. It will create config file.

POST Migration:
---------------

Source:
--------

umount /home/vm139_backup

lvremove /dev/vg_grp/vm139_backup

Destination:
------------

umount /home/vm139_backup

lvremove /dev/vg_xenhvm/vm139_backup


Note:
------

For Ip transfer, there is two ip blocks in solusvm.

1. ipblock2 for slave2
2.  ipblock2 for slave1

-granted the permission for slave2 server to access & assign the ips from ipblock1. So the VM's will use the same ip after migration.


Reference:
http://docs.solusvm.com/xen_migrations
http://www.nocser.net/clients/knowledgebase/421/Migrate-Solusvm-VPS-from-1-node-to-another-node-Updated.html

No comments:

Post a Comment