Copying VMs and Templates

You can create new VMs and templates by copying (cloning) an existing VM or a template. XenCenter enables you to copy VMs and templates within and across pools.

XenServer has two mechanisms for copying VMs and templates, full copy or fast clone:

  • Full copy makes a complete copy of the VM’s disks.
  • Fast clone (Copy-on-Write) writes only modified blocks to disk, using hardware-level cloning features for copying the disks from the existing VM to the new VM. This mode is only supported for file-backed VMs. Copy-on-Write is designed to save disk space and allow fast clones, but can slightly slow down normal disk performance.

Copying a VM

Important:

  • Before copying a Windows VM, you should use the Windows utility sysprep to ensure the uniqueness of the Security IDs (SIDs). Copying a VM without first taking the recommended system preparation steps can lead to duplicate SIDs and other problems. See the XenServer Virtual Machine User’s Guide instructions on cloning VMs and running sysprep .
  • If the VM you want to copy is a Windows VM, run the sysprep utility as described in the XenServer Virtual Machine User’s Guide.
  • If the VM is running, you must shut it down before you can copy it.

To copy a VM within the pool

  1. Select the VM in the Resources pane, and on the VM menu, click Copy VM.
  2. On the Destination page, select Within Pool.
  3. On the Name and Storage page, enter the name of the new VM and (optionally) a meaningful description.
  4. Select the Copy Mode: Fast clone or Full copy.
  5. If you choose Full copy as the copy mode, select the storage repository (SR) where you want to copy the VM’s virtual disks. If you are moving a VM from local to shared storage, make sure that you select a shared SR here.
  6. Click Finish.

To copy a VM to a different pool

  1. Select the VM in the Resources pane, and on the VM menu, click Copy VM.
  2. On the Destination page, select Cross-pool. and click Next
  3. Select a standalone server or a pool from the Destination drop-down list.
  4. Select a server from the Home Server list to assign a home server for the VM and click Next
  5. On the Storage page, specify a storage repository where you would like to place the virtual disks of the copied VM and click Next.
    • The Place all migrated virtual disks on the same SR option is selected by default and displays the default shared SR on the destination pool.
    • Click Place migrated virtual disks onto specified SRs to specify an SR from the Storage Repository drop-down list. This option allows you to select different SR for each virtual disk on the migrated VM.
  6. On the Networking page, map the virtual network interfaces in the selected VM to networks in the destination pool or standalone server. Specify your options using the Target Network drop-down list and click Next.
  7. Select a storage network on the destination pool that will be used for the live migration of the VM’s virtual disks and then click Next.

    Note: Due to performance reasons, it is recommended that you do not use management network for copying VMs.

  8. Review the configuration settings and click Finish to start copying the VM.

Copying a Template

To copy a template within the pool

  1. Select the template in the Resources pane, and on the Templates menu, click Copy Template.
  2. On the Destination page, select Within Pool.
  3. Name and Storage page, enter the name of the new template and (optionally) a meaningful description.
  4. Select the Copy Mode: Fast clone or Full copy.
  5. If you choose Full copy as the copy mode, select the SR where the copied virtual disks will be placed.
  6. Click Finish.

To copy a template to a different pool

  1. Select the template in the Resources pane, and on the Templates menu, click Copy.
  2. On the Destination page, select Cross-pool and click Next.
  3. Select a standalone server or a pool from the Destination drop-down list.
  4. Select a server from the Home Server list to assign a home server for the VM and click Next
  5. On the Storage page, specify a storage repository where you would like to place the virtual disks of the copied template and click Next.
    • The Place all migrated virtual disks on the same SR option is selected by default and displays the default shared SR on the destination pool.
    • Click Place migrated virtual disks onto specified SRs to specify an SR from the Storage Repository drop-down list. This option allows you to select different SR for each virtual disk on the migrated VM.
  6. On the Networking page, map the virtual network interfaces in the selected template to networks in the destination pool or standalone server. Specify your options using the Target Network drop-down list and click Next.
  7. Select a storage network on the destination pool or standalone server that will be used to copy the template’s virtual disks and then click Next.

    Note: Due to performance reasons, it is recommended that you do not use management network for copying VMs.

  8. Review the configuration settings and click Finish to start copying the template.

Copying VMs and Templates