Migrating Xen Hardware based Virtual Machines (Hvm)
Home > CentOS > CentOS 6.x > Virtualization tools > Xen > Migrating Xen Hardware based Virtual Machines (Hvm)
We can perform live migration of VM from one physical host to another using Xen provided:
- Both hosts have exact same absolute path for files used as hard-disk, CD drive image for virtual hosts. This can be done via mounting remote filesystem at same location using NFS or fuse-sshfs etc.
- Even the name of bridge like xenbr0, xenbr1 etc. should match on source and destination
- Both source/destination hosts should be on same L2 subnet. This makes sense as anyway VM would continue to have same old IP / MAC address after migration.
- Both hosts should run same version of OS
- Both hosts should have sufficient RAM for migration
- Firewall should be configured on both hosts to allow migration
- Xend must be configured on both hosts to allow relocation
Enabling host migration for xend
Edit file '/etc/xen/xend-config.sxp' and do following changes:
- Enable xend-relocation server by setting '(xend-relocation-server yes)'
- Comment following parameters so that they take their default values
- xend-relocation-hosts-allow
- xend-relocation-port
- xend-relocation-address
Enabling host migration in firewall
Xen uses port TCP/8002 for live migration. So allowing incoming / outgoing connections to port 8002 on both hots should be fine. In extreme case firewall can be completely disabled between two base hosts during migration.
Performaing migration
After all things are set / checked we can use:
xm migrate {<domain_name>|<domain_id>} <target_hot> -l
for performing live migration. If downtime of 50 to 300 ms is fine then we can omit '-l' so that normal migration is performed in which domain is paused for a while instead of live migration.
Home > CentOS > CentOS 6.x > Virtualization tools > Xen > Migrating Xen Hardware based Virtual Machines (Hvm)