XenServer template is a virtual machine encapsulated into a file, making it possible to rapidly deploy new VMs. Each template contains installation metadata—the setup information needed to create a new VM with a specific guest operating system, and with the optimum storage, CPU, memory and virtual network configuration.

A number of different templates are supplied with XenServer, and these contain all the various configuration settings needed to install a specific guest operating system on a new VM.

You can create new custom templates in different ways in XenCenter:

  • by copying an existing template

      [root@xensrv ~]# xe vm-clone uuid=`xe template-list name-label="Ubuntu Precise Pangolin 12.04 (64-bit)" --minimal` new-name-label="Ubuntu Trusty Tahr 14.04 (64-bit)"
      [root@xensrv ~]# xe template-param-set other-config:default_template=true other-config:debian-release=trusty uuid=`xe template-list name-label="Ubuntu Trusty Tahr 14.04 (64-bit)" --minimal`
  • by converting an existing VM into a new template.

      [root@xensrv ~]# xe vm-param-set uuid=<VM UUID> is-a-template=true 
  • by saving a copy of a VM snapshot as a new template.

      [root@xensrv ~]# xe vm-list is-control-domain=false is-a-snapshot=false
      [root@xensrv ~]# xe vm-snapshot uuid=<VM UUID> new-name-label=snapshotname
      [root@xensrv ~]# xe template-param-set is-a-template=true ha-always-run=false uuid=<VM UUID>
  • by importing a template that has previously been exported from an existing template or VM snapshot as an XVA file.

      [root@xensrv ~]# xe vm-import filename=file.xva