Source is now in github, please help me make it better! If you just want a 32-bit binary (to run on Dom0), download it from here instead.
With the help of Ben Booth’s Xen::API (Perl module) I put together a VM migration script to export a VM directly to another host with no intermediary file. The transfer occurs over XAPI with no temp files or local disk interaction. This script can run directly on the source or destination host, or any server in between. Bear in mind, you will have the best speeds and least network overhead running this directly on the destination host.
As of today, MigrateVM has been tested and works fine on XenServer 5.6 through 6.5.
-sh : source host
-su : source user (usually root)
-sp : source pass
-sv : source VM label or UUID
-dh : destination host
-du : destination user
-dp : destination pass
-ds : destination SR (optional)
If any of the options are omitted, you will be prompted for them.
[root@cl-ash-h1 ~]# ./migratevm Enter source host name/IP (blank = localhost): 22.214.171.124 Enter username for 126.96.36.199 (blank = root): Enter password for 188.8.131.52: ************ Enter source vm name or uuid on 184.108.40.206: my_vm Enter destination host name/IP (blank = localhost): Enter username for localhost (blank = root): Enter password for localhost: ****** Destination SR on localhost (blank for default): Starting transfer ................... 12.0%, 30618.43 (KB/sec) Done.
Download the script like this:
wget http://djlab.com/stuff/migratevm-1.0.2.tar.gz tar zxf migratevm-1.0.2.tar.gz && cd migratevm-1.0.2 ./migratevm
If you get ‘bad ELF’ or something like that on a 64 bit system, try to install 32-bit glibc, for example:
Older XenServers: yum install glibc.i686 XenServer 6.5: yum install glibc.i686 --enablerepo=base --enablerepo=updates --disablerepo=citrix
Binary and source are both included in the tarball.
Version 1.0.2 has an updated binary build which should now run on XenServer 6.5. We needed to static link expat into the binary because it is no longer installed by default on XS 6.5.