Create a Virtual Machine from a Template

Create identical virtual machines from a template. You'll be able to customize hardware, software, and other configurations.

Before you begin

  • The platform provides system parameters for VMs to control default settings globally. Before creating a VM, you can customize VM-related settings in the system parameters to control the default VM features. For more information, see System Parameters.
  • Before creating a virtual machine based on a template, make sure there is already a virtual machine template available in the platform.

Procedure

  1. In the navigation pane, choose Inventory > VM and Host.
  2. Right-click a valid parent resource (cluster or host) of virtual machines and select New Virtual Machine.
  3. In the Select VM Creation Type dialog, choose From Template.
  4. Click Next.
  5. In the Select Virtual Machine Template dialog, select the target template and click OK.
  6. In the Create Virtual Machine from Template dialog, set the following parameters:
    1. Complete the template information configuration.
      • Template: Select a template and create a virtual machine based on this template.
    2. Complete the basic information configurations.
      • Name: The name of the virtual machine
      • Quantity: The number of virtual machines to create this time
        Note: When creating multiple virtual machines from a template, the following configurations will be cleared:
        • Added GPU, USB, and PCIe devices
        • Manually specified IP address
      • Group: The group the virtual machine belongs to; if not set, the default group will be used
      • Location: The host or cluster location of the virtual machine
      • OS: The operating system of the virtual machine, supporting mainstream operating systems including Linux and Windows
      • HA: Automatic restart mechanism for the virtual machine after abnormal shutdown, default is disabled. For more information, see VM HA
      • Power Status: Whether the virtual machine automatically powers on after creation, default is to power on automatically
    3. Complete the hardware information configurations.
      • CPU: Supports adjusting the total number of cores and the number of cores per socket, and setting CPU hot plug.
      • Memory: Supports adjusting the memory size and setting memory resource priority.
      • Disk: Supports modifying the cache mode of the disk and setting AIO acceleration. You can add a new hard disk to the virtual machine by clicking Add Hardware > Disk. The new hard disk allows customization of its capacity and properties.
      • NIC: Supports modifying the NIC model, port group, NIC queue number, MAC address, IP address, and DNS assignment. You can add a new NIC to the virtual machine by clicking Add Hardware > NIC. The new NIC allows customization of its address and properties.
      • CD/DVD Drive: Supports loading ISO image files onto the virtual machine for booting from an ISO optical drive.
      • GPU Device 1: Loads a GPU device onto the virtual machine, supporting physical GPU devices and vGPU devices.

        You can add a GPU device by clicking Add Hardware > GPU Device.

      • USB Device 1: Loads a USB device onto the virtual machine, supporting direct connection and redirection.

        You can add a USB device by clicking Add Hardware > USB Device. A single virtual machine supports adding up to 1 USB device.

      • Other Hardware: Does not support modifying the graphics card and sound card configuration in the template file.
    4. Complete the advanced settings.
      General Options
      • Description: Displays the description recorded in the template. You can modify the VM description.
      • Tag: Displays the tag recorded in the template. You can customize different tags.
      • OS Attribute: Configures the VM operating system attributes.
        • Do Not Customize: Inherits the hostname, administrator password, workgroup or domain configurations from the template.
        • Apply a Specification: Select an existing VM specification to apply the system configuration specified in the specification.
        • Manually Customize: Customize a new VM specification.
  7. Review the configuration and click OK.

What to do next

Some VM configurations require VMTools. After VM creation, it is recommended to install VMTools to enable certain configurations. For more information about VMTools, see Virtual Machine VMTools.

VM Template

A virtual machine template is a collection of the virtual machine's operating system, applications, and configuration features. Through virtual machine templates, you can quickly deploy multiple virtual machines with the same properties, improving efficiency and consistency.

Clone a Virtual Machine to a Template

Clone a virtual machine to a template. The source virtual machine remains available for use after it has been cloned into a template.

Before you begin

  • Make sure the virtual machine is running, paused, shut down, or crashed.
  • Detach all shared disks and RDM disks on the virtual machine.

Procedure

  1. In the navigation pane, choose Inventory > VM and Host.
  2. Select the target VM and click Actions > Clone > Clone to Template.
  3. In the Clone Virtual Machine to Template dialog, set the following parameters:
    • Name: Enter the template name.
      Note: The name must be unique and cannot duplicate the names of existing virtual machines or templates.
    • Data Storage: Location where the template will be stored. By default, this is consistent with the source virtual machine's data storage.
    • Tag: Attach tags to identify different templates. For more information, see Tag Management
    Note: If the VM has GPU, USB, or PCIe devices attached (except for PCIe devices automatically attached by SR-IOV NICs), the cloned template will not include these devices. To keep these devices, you can convert the VM to a template.
  4. Review the configuration and click OK.

What to do next

After cloning a virtual machine as a template, you can use this template to quickly deploy virtual machines with the same attributes.

You can modify the template without affecting the normal use of the source virtual machine.

Convert a Virtual Machine to a Template

Convert a powered-off virtual machine to a template. After conversion, the source VM becomes template-only and will be removed from the virtual machine navigation tree. The template will appear in the Image and Template > Template File navigation tree.

Before you begin

  • Make sure the virtual machine is shut down.
  • Detach all shared disks and RDM disks on the virtual machine.
  • Make sure the virtual machine has not associated with any backup plans.

Procedure

  1. In the left navigation pane, select Inventory > VM and Host.
  2. Select the target VM and click Actions > Template > Convert to Template.
  3. Review the selected target and click OK.

What to do next

After converting a virtual machine to a template, you can use this template to quickly deploy virtual machines with the same attributes.

Convert a Template to a Virtual Machine

Convert a template directly to a virtual machine. Use this when you need to modify template configurations or no longer require the VM to server as a deployment template.

Procedure

  1. In the navigation pane, choose Inventory > Image and Template.
  2. Select the target template in Template File and click Actions > Convert to Virtual Machine.
  3. In the Convert to Virtual Machine dialog, set the following parameters:
    • Name: Enter a name for the virtual machine.
    • Power Status: Choose whether to automatically power on the VM after conversion.
    • Location: Automatically assigned by default. Select a target host or cluster for the VM.
      • For local storage scenario, you cannot specify the VM location. By default, the VM is allocated to the host where local disks reside.
      • For non-local storage scenarios, you can specify the VM location.
  4. Review the configuration and click OK.

What to do next

After converting a template to a virtual machine, you can make adjustments to the virtual machine configuration as needed and then convert the virtual machine back into a template.

Create a Virtual Machine from a Template

Create identical virtual machines from a template. You'll be able to customize hardware, software, and other configurations.

Before you begin

  • The platform provides system parameters for VMs to control default settings globally. Before creating a VM, you can customize VM-related settings in the system parameters to control the default VM features. For more information, see System Parameters.
  • Before creating a virtual machine based on a template, make sure there is already a virtual machine template available in the platform.

Procedure

  1. In the navigation pane, choose Inventory > VM and Host.
  2. Right-click a valid parent resource (cluster or host) of virtual machines and select New Virtual Machine.
  3. In the Select VM Creation Type dialog, choose From Template.
  4. Click Next.
  5. In the Select Virtual Machine Template dialog, select the target template and click OK.
  6. In the Create Virtual Machine from Template dialog, set the following parameters:
    1. Complete the template information configuration.
      • Template: Select a template and create a virtual machine based on this template.
    2. Complete the basic information configurations.
      • Name: The name of the virtual machine
      • Quantity: The number of virtual machines to create this time
        Note: When creating multiple virtual machines from a template, the following configurations will be cleared:
        • Added GPU, USB, and PCIe devices
        • Manually specified IP address
      • Group: The group the virtual machine belongs to; if not set, the default group will be used
      • Location: The host or cluster location of the virtual machine
      • OS: The operating system of the virtual machine, supporting mainstream operating systems including Linux and Windows
      • HA: Automatic restart mechanism for the virtual machine after abnormal shutdown, default is disabled. For more information, see VM HA
      • Power Status: Whether the virtual machine automatically powers on after creation, default is to power on automatically
    3. Complete the hardware information configurations.
      • CPU: Supports adjusting the total number of cores and the number of cores per socket, and setting CPU hot plug.
      • Memory: Supports adjusting the memory size and setting memory resource priority.
      • Disk: Supports modifying the cache mode of the disk and setting AIO acceleration. You can add a new hard disk to the virtual machine by clicking Add Hardware > Disk. The new hard disk allows customization of its capacity and properties.
      • NIC: Supports modifying the NIC model, port group, NIC queue number, MAC address, IP address, and DNS assignment. You can add a new NIC to the virtual machine by clicking Add Hardware > NIC. The new NIC allows customization of its address and properties.
      • CD/DVD Drive: Supports loading ISO image files onto the virtual machine for booting from an ISO optical drive.
      • GPU Device 1: Loads a GPU device onto the virtual machine, supporting physical GPU devices and vGPU devices.

        You can add a GPU device by clicking Add Hardware > GPU Device.

      • USB Device 1: Loads a USB device onto the virtual machine, supporting direct connection and redirection.

        You can add a USB device by clicking Add Hardware > USB Device. A single virtual machine supports adding up to 1 USB device.

      • Other Hardware: Does not support modifying the graphics card and sound card configuration in the template file.
    4. Complete the advanced settings.
      General Options
      • Description: Displays the description recorded in the template. You can modify the VM description.
      • Tag: Displays the tag recorded in the template. You can customize different tags.
      • OS Attribute: Configures the VM operating system attributes.
        • Do Not Customize: Inherits the hostname, administrator password, workgroup or domain configurations from the template.
        • Apply a Specification: Select an existing VM specification to apply the system configuration specified in the specification.
        • Manually Customize: Customize a new VM specification.
  7. Review the configuration and click OK.

What to do next

Some VM configurations require VMTools. After VM creation, it is recommended to install VMTools to enable certain configurations. For more information about VMTools, see Virtual Machine VMTools.

Manage Virtual Machine Templates

You can modify virtual machine templates according to your business needs, including editing names and descriptions, changing configurations, and altering ownership. If you no longer need a template, you can delete the virtual machine template.

Edit Name and Description

If you only need to modify the template's name and description, in the target template page, click on the Action > Edit Name and Description to make the changes.
Note: The new name must be unique and cannot duplicate the names of existing virtual machines or templates.

Modify Configuration

If you need to modify the basic information, total number of CPU cores, number of cores per socket, memory size, or hard disk capacity of the template, in the target template page, click on the Action > Modify Configuration and make the necessary changes to the corresponding settings.

If you need to make extensive adjustments to the template configuration, you can first convert the template to a virtual machine, then adjust the configuration as needed. Once the adjustments are complete, convert the virtual machine back into a template for future use.

Change Ownership

If you need to change the owner of the template, in the target template page, click on the Action > Change Ownership and specify the new owner.

Delete Virtual Machine Template

You can delete a virtual machine template using either of the following methods:
  • To delete a single template: Navigate to the target template page, click on the Action > Delete to perform the deletion operation.
  • To delete multiple templates in bulk: Navigate to the parent resource (data center) corresponding Image and Template sub-page, select the target templates, and then click on the Bulk Action > Delete to perform the deletion operation.
Note: After deleting a template, you will not be able to recover the template files (including network card, hard disk files, and database records). Proceed with caution.