Citrix Systems 5.5.0 Washer User Manual


 
XenServer Virtual Machine Installation Guide Creating VMs 6
a template, but be sure to follow the appropriate preparation procedure for the 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). Templates cannot be used as normal VMs.
XenServer has two mechanisms for cloning VMs: a full copy, or a faster Copy-on-Write (CoW) mode which
only writes modified blocks to disk. The CoW mode is only supported for file-backed VMs. CoW is designed
to save disk space and allow fast clones, but will slightly slow down normal disk performance. A template
can be fast-cloned multiple times without slowdown, but if a template is cloned into a VM and the clone
converted back into a template, disk performance can linearly decrease depending on the number of times
this has happened. In this event, the vm-copy CLI command can be used to perform a full copy of the disks
and restore expected levels of disk performance.
Resource pools introduce some complexities around creating custom templates and cloning them. If you
create a template on a server in a pool, and all virtual disks of the source VM are on shared storage repos-
itories, 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 as-
sociated 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 band-
width 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>