No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Migrate XenServer VM's Between Servers

NOTE: If you need a 32-bit binary of the script (and want to avoid compiling yourself), please see my blog post:

With the help of Ben Booth's Xen::API (Perl module I hacked up), 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.

Hint: You're best off compiling a static binary (check build.txt). It would be nearly impossible to meet the dependencies on a live XenServer otherwise.


-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)
-ssl : flag to use SSL for the data transfer of VM

If any of the options are omitted, you will be prompted for them. Using SSL for data transfer appears to reduce the throughput significantly. I would recommend not using SSL transfer if you have a secure network connection between the hosts. SSL will always be used in the XAPI calls regardless of this setting.

###Example output:

[root@cl-ash-h1 ~]# ./
Enter source host name/IP (blank = localhost):
Enter username for (blank = root):
Enter password for ************
Enter source vm name or uuid on 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)