6
The following procedure assumes that you are administering the XenServer host using the CLI on a separate
machine (that is, a machine that is not one of your XenServer hosts) where you maintain a library of export
files.
To import a VM using the CLI
1. To import the VM to the default SR on the target XenServer host:
xe vm-import -h <hostname> -u <root> -pw <password> \
filename=<pathname_of_export_file>
You can import the VM to another SR on the target XenServer host by adding the optional sr-uuid
parameter:
xe vm-import -h <hostname> -u <root> -pw <password> \
filename=<pathname_of_export_file> sr-uuid=<uuid_of_target_sr>
You can also preserve the MAC address of the original VM by adding the optional preserve parameter
set to true:
xe vm-import -h <hostname> -u <root> -pw <password> \
filename=<pathname_of_export_file> preserve=true
2. The import process might take some time to complete. When finished, the command prompt returns
the UUID of the newly-imported VM.
VM Block Devices
In the para-virtualized (PV) Linux case, block devices are passed through as PV devices. XenServer does
not attempt to emulate SCSI or IDE, but instead provides a more suitable interface in the virtual environment
in the form of xvd* devices. It is also sometimes possible (depending on the OS) to get an sd* device using
the same mechanism, where the PV driver inside the VM takes over the SCSI device namespace. This is not
desirable so it is best to use xvd* where possible for PV guests (this is the default for Debian and RHEL).
For Windows or other fully virtualized guests, XenServer emulates an IDE bus in the form of an hd* device.
When using Windows, installing the Citrix Tools for Virtual Machines installs a special PV driver that works
in a similar way to Linux, except in a fully virtualized environment.