Deploy VMs by using a VM template

You can create a VM template by converting a VM to a template or cloning a VM to a template for fast creation and configuration of VMs in bulk. VMs deployed using a VM template have the same OS and applications as the template.

Manage VM template pools

VM templates are stored on CVM hosts. As a best practice, set aside a dedicated shared storage as a template pool for storing VM templates. Before adding a shared directory as a template pool, make sure storage volumes and other required settings are configured on the shared storage.

To create a template pool:

  1. On the top navigation bar, click Resources.

  1. From the left navigation pane, select VM Templates.

  1. Click Template Pool.

  1. Click Add Template Pool.

  1. Enter /templet in the Target Path field, select iSCSI Shared Directory from the Type list, and enter 192.168.12.100 in the IP Address field.

  1. Click the search icon in the LUN field to search for the desired LUN by IP address.

  1. Click OK.

 

  1. Verify that the newly added template pool is displayed on the template pool list.

Create a VM template

You can create a VM template by using the following methods:

Before creating a VM template by using a VM, perform the following steps:

Clone a VM as a template

  1. Shut down the VM, and then disconnect the mounted virtual driver and driver files, if any, from the VM.

  1. Navigation to the VM configuration page. Click More, and then select Clone as Template.

  1. In the dialog box that opens, enter a template name, select a template pool for storing the template, and then click OK. The template name must be different from the VM name.

 

  1. Navigate to the Resources > VM Templates page and verify that the newly created VM template is displayed on the VM template list.

Convert a VM to a template

  1. Shut down the VM, and then disconnect the mounted virtual driver and driver files, if any, from the VM.

  1. Navigation to the VM configuration page. Click More, and then select Convert to Template.

  1. In the dialog box that opens, enter a template name and template description, select a template pool for storing the template, and then click OK.

  1. Navigate to the VM templates page and verify that the newly created VM template is displayed on the VM template list.

  1. Verify that the VM is removed from the host.

Export a VM as a template

You can export a VM template from CVM and then import it to another CVM system. Use this method to deploy VMs across management platforms.

  1. On the top navigation bar, click Resources.

  1. From the left navigation pane, select VM Templates.

  1. Click Download icon in the Actions column for a VM template to download the template as a compressed file.

  1. Navigate to the VM templates page in the CVM system where you want to import the template and import the template as an OVF template.

Deploy VMs from a template

You can deploy 1 to 100 VMs by using a VM template at a time. When using a template to deploy multiple VMs in bulk, you cannot configure the system settings for the VMs.

 

  1. On the top navigation bar, click Resources.

  1. From the left navigation pane, select VM Templates.

  1. Click Deploy VM in the Actions column for a VM template.

  1. Configure basic information, cluster information, storage information, network information, and system information for VM deployment and start the deployment.

  1. After the VM deployment is complete, check the deployed VMs on the target host.

  1. Start a deployed VM. Open the VM console and verify that an OS is installed on the VM as configured in the VM template. Enter the login username and password configured in the system settings of the template to log in to the VM or configure other settings as needed.