Deploy VM and Manage the VM Lifecycle
VM lifecycle management covers creating, importing, registering, cloning, and deleting virtual machines. Different deployment methods apply to VM files from different sources and to different operational scenarios.
Create a VM when you want to start from an image, a template, or a custom configuration. Import a VM to bring in an existing VM through an OVF file. Register a VM to bring existing VM configuration and data files under platform management. Clone a VM to quickly copy an existing VM environment.
Create a Virtual Machine
A new virtual machine that you'll be able to customize CPU, memory, storage, and network settings for the workload.
Before you begin
- The platform provides VM-related system parameters that control default platform behavior. Before creating a VM, you can customize VM-related system parameters to control default VM characteristics.
- The platform provides default capacity and feature settings for VMs, such as CPU, Memory, Disk 1, NIC 1, Other Hardware, and Advanced Settings. You can quickly create a VM by using the default platform settings.
- You can create a VM without an OS image. You can add the disk 1 by creating a new disk. A CD/DVD drive is optional.
- You can create a VM without a NIC and configure NICs and their features later.
- To enable VM or disk encryption, make sure that an available default key provider is configured. If you use the Native Key Provider, back it up first. For more information, see Encryption Keys and How Encryption Works.
Procedure
- In the navigation pane, right-click the target cluster, host, or image, and then click New Virtual Machine.
- In the Select VM Creation Type dialog, select New VM, and then click Next.
-
In the New Virtual Machine dialog, configure the basic information as needed:
Option Description Name VM name. Quantity Number of VMs to create. Group VM group. If not specified, the default group is used. Location Host or cluster where the VM runs. OS VM operating system. Mainstream operating systems are supported, including Linux and Windows. HA Automatic restart mechanism after an abnormal VM shutdown. VM Encryption Encrypts runtime data written to disk, such as memory and GPU state, by using a key from the default key provider. Enabling this option automatically enables Disk Encryption for all disks. Enable encryption during VM creation when possible to avoid the additional time required to convert existing data later. For more information, see VM Encryption. Power Status Whether to automatically power on the VM after it is created. By default, the VM is powered on automatically. -
Configure the VM hardware settings as needed:
-
Configure the VM advanced settings as needed:
- Review the configuration and click OK.
What to do next
Some VM settings depend on VMTools. After the VM is created, install VMTools so that these settings can take effect. For more information about VMTools, see Install and Use VMTools.
Import a Virtual Machine
Upload an OVF file to quickly import a VM and support migration from third-party virtualization platforms.
Before you begin
- The platform provides VM-related system parameters that control default platform behavior. Before creating a VM, you can customize VM-related system parameters to control default VM characteristics.
- To enable VM or disk encryption, make sure that an available default key provider is configured. If you use the Native Key Provider, back it up first. For more information, see Encryption Keys and How Encryption Works.
Procedure
- In the navigation pane, right-click the target cluster, host, or image, and then click New Virtual Machine.
- In the Select VM Creation Type dialog, select Import VM, and then click Next.
-
In the Import VM dialog, configure the following options:
Upload Information
Option Description Image Storage Temporary storage for the uploaded template file. Standalone image storage and distributed image storage are supported. The template file is automatically deleted after the VM is generated. Template Type OVF template files are supported. OVF File Upload an OVF file. Only one file can be uploaded. VMDK File Upload VMDK files from the OVF template. The files must be consistent with the file configuration defined in the OVF file, including the number of files and the configuration content. MF File Upload the MF file from the OVF template. Only one file can be uploaded. Basic InformationOption Description Name VM name. Group VM group. If not specified, the default group is used. Location Host or cluster where the VM runs. Storage Location Data storage location of the VM disk. Local storage, NFS storage, SAN storage, and distributed storage are supported. If not specified, automatic allocation is used. HA Automatic restart mechanism after an abnormal VM shutdown. This option is enabled by default. VM Encryption Encrypts runtime data written to disk, such as memory and GPU state, by using a key from the default key provider. Enabling this option automatically enables Disk Encryption. For more information, see VM Encryption. Disk Encryption Encrypts all data stored on the imported VM disks by using a key from the default key provider. You can encrypt the disks even when VM encryption is disabled. Power Status Whether to automatically power on the VM after it is created. By default, the VM is powered on automatically. - Review the configuration and click OK.
What to do next
Some VM settings depend on VMTools. After the VM is created, install VMTools so that these settings can take effect. For more information about VMTools, see Install and Use VMTools.
Register a Virtual Machine
Register VM configuration and data files to create a corresponding virtual machine record on the platform. After registration, the virtual machine can be managed by the platform.
Before you begin
- Make sure an Advanced Edition license is installed on the platform and is valid.
- Only SAN storage, local storage, and NFS storage support VM registration. Before registration, the data storage must be attached to the corresponding cluster, and the cluster must contain hosts.
- The same VM configuration file cannot be registered multiple times on the same host.
- For a VM with TPM, make sure the corresponding key provider is configured on the platform before registration.
Procedure
- In the navigation pane, click .
- Select the target data storage, and then click .
-
In the Register VM dialog, configure the following options:
Option Description Configuration File Select the configuration file of the VM to register. VM Name Set the VM name. Group Select the VM group. Location Specify where the VM runs. - Click OK.
Clone a Virtual Machine
To reuse the configuration of an existing virtual machine, clone the VM. ZStack Cube Virtualization Edition provides full-VM cloning and supports Full Clone and Instant Full Clone.
Before you begin
- The source VM must be running, paused, or shut down.
Note: When cloning a running VM, only data that has been written to disk when the clone task starts is cloned. Real-time cached data is not included. - To ensure data integrity, pause or shut down high-I/O VMs before cloning them.
- Detach shared disks from the source VM. VMs with shared disks cannot be cloned.
- The cluster where the VM resides has sufficient compute, storage, and network resources.
- If the source VM is encrypted or you plan to encrypt the cloned VM, make sure that the default key provider is available.
Procedure
- On the target VM page, click .
-
In the Clone Configuration section of the Clone Virtual Machine dialog, select a clone method.
Option Description Source VM Displays the source VM. This value cannot be changed. Clone Method Select a clone method: - Full Clone: Copies all data from the source VM. The cloned VM is always independent of the source VM. This method takes more time and storage space, but lets you specify the storage location for each disk.
- Instant Full Clone: Quickly creates a cloned VM from the source VM, and then merges snapshots in the background so that the cloned VM becomes independent. This method takes less time and storage space. Disk storage locations are assigned automatically.
Note: During the snapshot merge, other VM or disk operations are performed after the merge is complete.
-
In the Basic Info section, configure the cloned VM.
Option Description Name Specify a name for the cloned VM. Quantity Specify the number of VMs to clone. For a batch clone, the system appends sequential suffixes such as "-1", "-2", and "-3" to the VM names. VM Encryption Controls whether VM encryption is enabled for the cloned VM. If VM encryption is enabled for the source VM, it remains enabled for the cloned VM. Otherwise, enable this option as needed. Enabling VM encryption enables disk encryption for all disks by default. You can still adjust the encryption state of disks that were not encrypted in the source VM. Power Status Select Power on after clone to automatically start the VMs after cloning. -
On the Hardware Info tab, configure the hardware for the cloned VM.
Hardware Description Disk For a Full Clone, you can specify the Storage Location for each disk. For an Instant Full Clone, storage locations are assigned automatically.
Disk encryption is handled as follows:
- A disk encrypted in the source VM remains encrypted.
- A disk not encrypted in the source VM remains unencrypted by default. Enable Disk Encryption as needed.
- When VM Encryption is enabled, Disk Encryption is enabled by default for disks that were not encrypted.
Note:
- If Disk 1 of the source VM uses local storage and the other disks use different data storage, the clone fails when the local storage is unavailable.
- For SAN storage, you can specify a provisioning method for the disk.
- For ZCE distributed storage, you can select a storage pool for the disk.
NIC The NIC configuration of the source VM is used by default. You can add or remove NICs and configure the state, NIC model, port group, number of NIC queues, MAC address, IP address, DNS, security groups, and NIC QoS. For more information about NIC options, see Create a Virtual Machine.
Note: Make sure that the MAC and IP addresses of cloned VMs do not conflict with existing resources. For a batch clone, you cannot apply the same network values that must remain unique to every cloned VM.vTPM Displayed only if a vTPM is attached to the source VM. For TPM Configuration, select one of the following options: - Retain: Retains the TPM information of the source VM for the cloned VM.
- Reset: Uses the default key provider to create a new TPM for the cloned VM.
-
On the Advanced Settings tab, select General Options and configure the following settings.
Option Description Hostname Specify the hostname for the cloned VM. VMTools must be installed on the source VM for this setting to take effect. For a batch clone, the system appends a sequential numeric suffix to each hostname. VM Scheduling Group Add the cloned VM to a VM scheduling group so that a host is assigned according to the scheduling policy associated with the group. A VM can belong to only one VM scheduling group. - Review the configuration and click OK.
What to do next
The clone operation copies the VM configuration, installed applications, credentials, and similar data to the cloned VM. It does not automatically copy all associated settings. Configure additional settings for the cloned VM as needed. For example, you can manually assign the same tags as the source VM.
If the source VM has a console password configured, restart the cloned VM to make the password take effect.
Delete a Virtual Machine
Before you begin
- VMs in the running, paused, crashed, or unknown state cannot be moved to the recycle bin or deleted. Shut down the VM before this operation.
- (Optional) The platform provides deletion protection for VMs and disks. You can control deletion behavior by adjusting deletion policies in system parameters. By default, the VM deletion policy is delayed deletion with a 7-day retention period, and the disk deletion policy is delayed deletion with a 3-day retention period. Deleted resources are first moved to the recycle bin and are permanently deleted after the corresponding retention period.
Procedure
- In the navigation pane, choose .
- Select the target VM.
-
On the VM details page, click .
To delete multiple VMs, go to the Virtual Machine tab of a parent resource, such as a host, cluster, or data center. For example, on the Virtual Machine tab of a host, select the VMs to delete, and then click .The delete button name changes based on VM Deletion Policy. When the deletion policy is Immediate Deletion, the button is named "Delete". When the deletion policy is Delayed Deletion or Never Delete, the button is named "Move to Recycle Bin".
-
In the confirmation dialog, select whether to delete disks attached to the VM at the same time, excluding shared disks.
If selected, disks are handled according to the behavior defined in the disk deletion policy.
- After acknowledging the risk, click OK.
