5
repositories, the operation of cloning that template will be forwarded to any server in the pool that can see
those shared SRs. However, if you create the template from a source VM that has any virtual disks on a
local SR, then the clone operation can only execute on the server that can access that SR.
Importing an exported VM
You can create a VM by importing an existing exported VM. Like cloning, exporting and importing a VM is
way to create additional VMs of a certain configuration. You might, for example, have a special-purpose
server configuration that you use many times. Once you have set up a VM the way you want it, you can
export it, and import it later to create another copy of your specially-configured VM. You can also use export
and import to move a VM to a XenServer host that in another resource pool.
When importing a VM, you can choose to preserve the MAC address on any virtual network interfaces
associated with it. If you choose to generate a new MAC address, be sure to follow the appropriate
preparation procedure for the imported VM. See the section called “Preparing to clone a Windows VM” for
Windows and the section called “Preparing to clone a Linux VM” for Linux.
Importing an exported VM may take some time, depending on the size of the VM and the speed and
bandwidth of the network connection between the XenServer host and XenCenter.
When VMs are imported XenServer re-attaches the VM VIFs to any network that has the same name as the
network on the server that the VM was exported from. If no matching network can be found a new private
network is created and the VM VIFs are attached to that.
Exporting a VM
An existing VM can be exported using XenCenter or the CLI. This section describes using the CLI. For
details on exporting using XenCenter, see the XenCenter online Help.
The following procedure assumes that you have multiple XenServer hosts and that you are administering
them using the CLI on a separate machine (that is, a machine that is not one of the XenServer hosts)
where you can maintain a library of export files. Citrix recommends not exporting a VM to a XenServer
host filesystem.
To export a VM using the CLI
1. Shut down the VM that you want to export.
2. Export the VM:
xe vm-export -h <hostname> -u <root> -pw <password> vm=<vm_name> \
filename=<pathname_of_file>
Note:
Be sure to include the .xva extension when specifying the export filename. If the exported VM does not
have this extension and you attempt to import it using XenCenter, it might fail to recognize the file as a valid
XVA file.
3. The export process might take some time to complete. When finished, the command prompt returns.
Importing a VM
An exported VM file can be imported using XenCenter or the CLI. This section describes using the CLI. For
details on importing using XenCenter, see the XenCenter online Help.