Skip to main content

VM templates

A VM template contains an OS image, application software, and a configuration file. With a VM template, you

can create multiple VMs with the same hardware and software specifications in bulk for large-scale VM deployment or VM request through a self-service portal.

Features

• Manage VM templates

• Operate OVF templates

• Manage template pools

Manage VM templates​

You can manage a VM template by performing the following tasks:

• Import a VM template—Import a VM template package in .tar.gz format to the system.

• Synchronize the VM template distribution state—Synchronize VM template distribution configuration to the database in the system.

• Distribute a VM template—Distribute the VM template to the storage pool of the destination host. As a best practice to improve VM deployment efficiency, distribute a VM template before deploying VMs by using the template.

• Download a VM template—The file must be in .tar.gz format.

• Check the integrity and track the source of a VM template—Perform CRC for a VM template file to prevent tampering of the VM template during copy or transmission, and trace the source and author of VM templates for easy management.

• Edit a VM template—Edit VM template information such as CPUs, CPU cores, memory size, storage path, and storage capacity. If VMs have been deployed using the template, the name and storage capacity of the template cannot be edited.

• Update the image of a VM template:

○ Enable image update—Create a temporary VM based on a VM template for you to update the template image. After you enable image update, the VM template enters the maintenance mode.

○ Enter VM console—After you enter the console of the temporary VM created upon enabling image update, you can update the image, for example, by installing or deleting applications.

○ Disable image update—After completing VM template image update, you can disable image update to delete the created temporary VM and restore the normal VM template state.

• Convert to public/private template—Convert the public template to a private template or the private template to a public template.

• Delete a VM template—If VMs have been deployed using the template, the template file will not be deleted.

Import a VM template

Restrictions and guidelines

• For a successful upload of a VM template, do not close the browser or the window for importing the VM template during the upload process.

• To avoid template import failure because of login timeout, do not stay at the port profile configuration page for a long time.

Procedure

  1. On the top navigation bar, click Compute.

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

  3. Click Import VM Template.

  4. Select a host, and then click Next.

  5. Click in the dashed box to select a VM template file, or drag a VM template file to the dashed box.

  6. Click Start to start uploading.

  7. After the upload, click the icon to select a port profile for the VM template.

  8. Select an owner for the VM.

  9. Click OK.

Filter VM templates

  1. On the top navigation bar, click Compute.

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

  3. From the Used By box, select All, Public, or Private to filter VM templates by owner.

Synchronize the VM template distribution state

  1. On the top navigation bar, click Compute.

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

  3. Click Sync Distribution State.

Distribute a VM template

Procedure

  1. On the top navigation bar, click Compute.

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

  3. Click More in the Actions column for a VM template, and then select Distribute VM Template.

  4. Configure the parameters.

  5. Click OK.

Parameters

Overwrite Existing: Select whether to overwrite the storage volumes with the same name on the target host.

Download a VM template

  1. On the top navigation bar, click Compute.

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

  3. Click More in the Actions column for a VM template, and then select Download VM Template.

Check the integrity and track the source of a VM template

  1. On the top navigation bar, click Compute.

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

  3. Click More in the Actions column for a VM template, and then select Integrity Check and Source Track.

Update the image of a VM template

  1. On the top navigation bar, click Compute.

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

  3. Enable image update: a. Click More in the Actions column for a VM template. b. Select Enable Image Update. In the dialog box that opens, select the vSwitch or port group to which the vNIC will be attached. When you configure the network, you select a CVM service vSwitch. If scanning fails, first configure a CVM service vSwitch. Then click OK. The system will create a temporary VM based on the VM template for you to update the template image.

  4. Update the image: a. Click Console in the Actions column for the VM template. b. Delete or install application programs on the temporary VM.

  5. Disable image update: a. Click More in the Actions column for the VM template. b. Select Disable Image Update to delete the created temporary VM and quit maintenance mode.

Edit a VM template

Procedure

  1. On the top navigation bar, click Compute.

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

  3. Click More in the Actions column for a VM template, and then select Edit.

  4. Configure the parameters.

  5. Click OK.

Parameters

• Name: Enter the name of the VM template. If VMs have been deployed using this template, the name cannot be edited.

• CPUs: Specify the number of CPU cores, which is the number of CPUs multiplied by the number of cores of each CPU.

• Memory: Enter the memory of the VMs.

• Save Path: Enter the path of the template pool that stores the VM template.

• Storage Volume Name: Name of the storage volume on the VMs. It is the same as the VM template name and cannot be edited.

• Storage Size: Enter the capacity of the disks on the VMs. If VMs have been deployed using this template, the storage capacity cannot be edited.

Convert to public/private template

  1. On the top navigation bar, click Compute.

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

  3. Click More in the Actions column for a VM template, and then select Convert to Public/Private Template.

Delete a VM template

  1. On the top navigation bar, click Compute.

Operate OVF templates​

You import an OVF template, deploy a VM by using an OVF template, and delete an OVF template. To export

a VM as an OVF template, see "Export a VM as an OVF template."

Import an OVF template

Perform this task to import a VM OVF template into the system. You can only import VM OVF template packages downloaded from the system.

  1. On the top navigation bar, click Compute.

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

  3. Click the OVF Template tab.

  4. Click Import OVF Template to import an OVF template as required.

Deploy a VM by using an uploaded OVF template

  1. On the top navigation bar, click Compute.

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

  3. Click OVF Template. Click Deploy for an OVF template.

  4. Configure the parameters.

Manage template pools​

A VM template pool enables you to save VM templates to be deployed to a specified storage pool. This

feature not only simplifies the search and deployment process of VM templates but also facilitates sharing of VM templates across different environments.

Restrictions and guidelines

Before you configure an NVMe-oF template pool, configure lossless network settings. For how to configure lossless network settings, contact Technical Support.

Add a template pool

You can create a dedicated storage pool path for VM templates. The system supports using an iSCSI shared directory, FC shared directory, NFS, NVMe-oF shared directory, or shared file system as a template pool. As a best practice to save management network bandwidth in a stateful failover system, use a shared directory that both the primary and back management platforms can access as a template pool, an iSCSI shared directory, FC shared directory, or NFS directory for example. If no shared storage is available, create a local synchronization partition as a template pool. The primary management platform will automatically synchronize the data in the partition to the backup management platform.

Procedure

  1. On the top navigation bar, click Compute.

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

  3. Click Template Pool.

  4. Click Add Template Pool.

  5. Configure the parameters as described in "Parameters."

  6. Click OK.

Parameters

• Type: Select a storage type. Options are iSCSI Shared Directory, FC Shared Directory, Network File System, NVMe-oF Shared Directory, and Shared File System Directory. Stretched clusters and hosts that run the Tencent operating system do not support NVMe-oF shared directories. You can select the Local File Directory option only in a non stateful failover system. You can select the Local Synchronization Partition option only when the following requirements are met:

○ A stateful failover system has been set up.

○ The management nodes are not added to management platforms as CVK hosts.

○ No local synchronization partition has been created.

If you select the Local File Directory option, set the mount point of the local directory on the management node and the mount point must start with /vms/.

If you select the Local Synchronization Partition option, set the following parameters (not supported on ARM hosts):

○ Target Path: Enter the mount point of the template pool on the management node. It must start with /vms/.

○ Local Sync Partition: Only logical disks or partitions with the same name and capacity in both primary and backup management nodes can be used. Creating a local sync partition will format the disk or partition. You can create a maximum of one local sync partition. NVMe disks cannot be used as local sync partitions. As a best practice, set the size of a local synchronization partition to be not larger than 4T.

If you select the iSCSI Shared Directory option, set the following parameters:

○ Target Path: Enter the mount point of the template pool on the management node. It cannot start with /vms/ or /dev/ and cannot be /dev/.

○ IP Address: Enter the IP address of the iSCSI storage server. A single IP address indicates a single path and multiple IP addresses indicate multiple paths. To enter multiple IP addresses, use semicolons to separate them, for example, 192.168.0.27;192.168.10.27;2001🔤ef::90. If a stateful failover environment, both the primary and backup nodes must be reachable to the shared storage.

○ LUN: Select the LUN of the iSCSI shared directory. Make sure the selected LUN is not used by any shared file system, iSCSI network storage, template pool, or any other management platform. In a stateful failover system, make sure the LUN is accessible to the primary and backup management platforms.

If you select the FC Shared Directory option, set the following parameters:

○ Target Path: Enter the mount point of the template pool on the management node. It cannot start with /vms/ or /dev/ and cannot be /dev/.

○ NAA: Select the NAA of the FC shared directory. Make sure the selected LUN is not used by any shared file system, FC network storage, template pool, or any other management platform. In a stateful failover system, make sure the LUN is accessible to the primary and backup management platforms.

If you select the NVMe-oF Shared Directory option, set the following parameters:

○ Target Path: Enter the mount point of the template pool on the management node. It cannot start with /vms/ or /dev/ and cannot be /dev/.

○ IP Address: Enter the IP address of the NVMe-oF storage device. A single IP address indicates a single path and multiple IP addresses indicate multiple paths. To enter multiple IP addresses, use semicolons to separate them, for example, 192.168.0.27;192.168.10.27;2001🔤ef::90. If a stateful failover environment, both the primary and backup nodes must be reachable to the shared storage.

○ UUID: Unique identifier used to uniquely identify and locate specific storage devices in a virtualization system to ensure that the virtualization system can correctly identify and access the required storage resources.

If you select the Network File System option, set the following parameters:

○ Target Path: Enter the mount point of the template pool on the management node. It cannot start with /vms/ or /dev/ and cannot be /dev/.

○ Source Host IP: Enter the IP address of the network file system. In a stateful failover system, make sure the primary and backup management platforms can reach the network file system.

○ Source Path: Enter the path of the network file system.

If you select the Shared File System Directory option, set the following parameters:

○ Target Path: Enter the mount point of the template pool on the management node. It must start with /vms/.

○ Shared Storage Pools: Select a shared file system. In a stateful failover system, the primary and backup management nodes must have been added to a cluster as service nodes and have the same shared file system mounted. In a single-node environment, a shared file system must have been added to the management platform.

○ Storage Name: Enter the name of the template pool folder.

Expand a template pool

Only FC, iSCSI, and NVMe-oF template pools can be expanded.

When a template pool does not have sufficient storage space, you can expand the template pool to ensure that VM templates can be uploaded successfully.

  1. On the top navigation bar, click Compute.

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

  3. Click Template Pool.

  4. Click Expand in the Actions column for a template pool.

  5. Click OK.

Enable a template pool

Enable an inactive template pool for the system to identify it. An active template pool can be used to store new VM templates or deploy VMs.

  1. On the top navigation bar, click Compute.

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

  3. Click Template Pool.

  4. Click Start in the Actions column for a template pool.

  5. In the dialog box that opens, click OK.

Suspend a template pool

Perform this task to suspend an active template pool for future use or for system maintenance.

  1. On the top navigation bar, click Compute.

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

  3. Click Template Pool.

  4. Click Suspend in the Actions column for a template pool.

  5. In the dialog box that opens, click OK.

Delete a template pool

If a template pool is a local directory and contains VM templates, the template pool cannot be deleted.

  1. On the top navigation bar, click Compute.

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

  3. Click Template Pool.

  4. Click Delete in the Actions column for a template pool.

  5. In the dialog box that opens, click OK.

Scan for VM templates

Perform this task to scan for the VM templates that are in a template pool but are not displayed in the management platform. You can import these VM templates to the management platform so they can be downloaded, distributed among template pools, or used to deploy VMs.

  1. On the top navigation bar, click Compute.

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

  3. Click Template Pools.

  4. Click Search in the Actions column for a template pool.

  5. Select VM templates and then click Import.

Display information about a template pool

  1. On the top navigation bar, click Compute.

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

  3. Click Template Pools.

  4. Click View in the Actions column for a template pool.

Manage storage adapters on the management platform

In a stateful failover network, if a management node is not added to the system as a CVK host, you can view information about the storage adapters used by the node, set the IQN, and perform a device scan through this feature. ARM hosts do not support this function.

  1. On the top navigation bar, click Compute.

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

  3. Click Template Pools.

  4. Click Storage Adapter.

  5. To edit the IQN of an open-iSCSI or NVMe-oF storage adapter, click Edit in the Actions column for the adapter.

  6. To perform a device scan, click Scan in the Actions column for a storage adapter.

Manage management node networks

In a stateful failover network, if a management node is not added to the system as a CVK host, you can manage vSwitches for the VM through this feature. ARM hosts do not support this feature.

  1. On the top navigation bar, click Compute.

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

  3. Click Template Pool.

  4. Click management platform Network.

  5. To add a virtual switch for the host, click Add.

  6. To edit a virtual switch, click Edit in the Actions column for the virtual switch.