Virtual Machine Basic Operations

Create a New Virtual Machine

A new virtual machine that you'll be able to customize CPU, memory, storage, and network.

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.
  • The platform provides default capacity and feature configurations for VMs, such as CPU, Memory, Disk 1, NIC 1, Other Hardware, and Advanced Settings. You can quickly create a virtual machine based on the default platform configurations.
  • You can create VMs without an OS image. You can add the disk 1 by creating a new disk. A CD/DVD drive is optional.
  • You can create VMs without NICs and configure NICs and their feature later.

Procedure

  1. In the left navigation pane, right-click the target cluster, host, or image, and then click New Virtual Machine.
  2. In the Select VM Creation Type dialog, select New VM, and then click Next.
  3. In the New Virtual Machine dialog, set the following parameters to complete the VM basic information:
    • Name: Virtual machine name.
    • Quantity: Number of virtual machines to create.
    • Group: VM group. Uses default group if not specified.
    • Location: Host or cluster where the VM resides.
    • OS: VM operating system. Supports mainstream OS including Linux and Windows.
    • HA: Automatic restart mechanism after abnormal shutdown. For more information, see VM HA.
    • Power Status: Whether to power on the VM after creation. Default: enabled.
  4. Set the following parameters to complete the VM hardware configurations:
    1. CPU: Customize the VM CPU cores and features.
      • Cores: Number of CPU cores in the VM.
      • Cores per Socket: Number of CPU cores allocated per socket in the VM.
      • CPU Mode: Whether to match VM CPU model with host CPU model to inherit host CPU features. Default: None. For more information, see VM CPU
      • CPU Resource Priority: For critical VMs, set to High to gain higher CPU contention capability when host is overloaded. For more information, see VM Resource Contention.
      • CPU Clock Speed Limit: Set the upper limit of host CPU resources that a VM can occupy. Valid range: 1% to 100%. 100% or blank means no limit.
      • CPU NUMA Binding: Bind the virtual machine's CPU (vCPU) to the host's CPU (pCPU) to improve its performance. For more information, see VM Resource Contention.
      • CPU Hot Plug: Whether to support online CPU modification. Default: enabled. CPU hot-plugging and memory hot-plugging must be enabled or disabled together.
        Note: Only some operating systems support hot-plugging. You can click View to check supported OS list.
      • CPU Hypervisor Tag: Whether to enable the virtualization (hypervisor) flag. If disabled, skips the VM virtualization environment detection by applications. Default: enabled.
    2. Memory: Customize the VM memory capacity and features.
      • Memory: VM memory capacity.
      • Memory Resource Priority: For critical VMs, set to High to gain higher memory contention capability when host is overloaded. For more information, see VM Resource Contention.
      • Memory Hot Plug: Whether to support online memory modification. Default: enabled. CPU hot-plugging and memory hot-plugging must be enabled or disabled together.
        Note: Only some operating systems support hot-plugging. You can click View to check supported OS list.
    3. Disk 1: Customize the storage location, capacity, and features of the virtual machine's system disk. You can create a new disk or choose an existing system image.
      • Storage Location: Data storage location for VM disk. Uses automatic allocation if not specified.
      • Capacity: System disk capacity when creating a new disk.
      • System Image: Select a system image when using system image. Supported format: raw and qcow2.
      • Bus Type: Specify the bus type for a virtual machine's disk. Options include Virtio, IDE, Virtio SCSI, and SCSI. By default, Disk 1 uses Virtio bus type on Linux systems, and IDE bus type on Windows and Other systems.
      • Provision Method: Choose how to allocate disk storage space when using SAN storage. Default: thin provisioning.
        • Thin Provisioning: Allocates storage space based on actual usage, achieving higher storage utilization.
        • Thick Provisioning: Pre-allocates the required storage space when creating the disk, providing sufficient storage capacity and ensuring storage performance.
      • Caching Mode: Whether to use host page cache for write operation and if used, whether the data is written to the storage device before returning success. Default: none.
      • AIO Acceleration: Whether to enable asynchronous I/O (AIO) acceleration in the VM kernel. Default: disabled.
        Note: To enable AIO acceleration, make sure the cache mode is set to none.
      • QoS: Whether to set read/write bandwidth and IOPS limits. Default: no limit. For more information, see VM QoS.
      Disks other than Disk 1 are data disks, such as Disk 2. Add data disks by clicking Add Hardware > Disk. A single virtual machine can support up to 24 disks (including Disk 1).
      • Data disk addition methods: new disk, disk image, existing disk, and RDM disk.
      • By default, data disks use Virtio bus type on Linux and Windows systems, while only IDE is supported for Other systems.
      • When the storage location is ZHPS distributed storage, the data disk's bus type only supports Virtio.
      • You can share a disk when the storage location is ZCE distributed storage and the bus type is Virtio SCSI.
      • You can share a disk when the storage location is SAN storage, the bus type is Virtio SCSI, and the provision method is thick provision.
      • You cannot modify the bus type or QoS of a shared disk.
    4. NIC 1: Customize the VM NIC IP address and features.
      • NIC Model: Set the NIC model. Supported models: e1000, rtl8139, virtio, and SR-IOV.
      • Port Group: The port group of the distributed switch for the VM NIC.
      • State: Whether to automatically enable NIC when VM powers on.
      • NIC Queue Number: Use multiple queues to send and receive network packets to improve network PPS and bandwidth performance.
      • MAC Address: Specify a MAC address. Default: Auto Generated.
      • Specify IP Address: Specify an IP address. Default: automatically assigned.

        If the selected distributed port group has DHCP service disabled, you can use VMTools to specify an IP address for the virtual machine For more information, see Virtual Machine VMTools.

      • Assign DNS: Specify a DNS address. Default: Auto Allocated.
      • Security Group: Associate security groups with the VM NIC to control east-west traffic. The smaller the number on the left side of the associated security group, the higher the priority for taking effect. For more information, see Security Group
        Note: Configure carefully to avoid rule conflicts between security groups.
      • QoS: Whether to set bandwidth limits on packet transmission for the VM NIC. Default: no limit. For more information, see VM QoS.

      Add multiple NICs by clicking Add Hardware > NIC.

    5. CD/DVD Drive 1: Mount an ISO system image file to boot VM from a CD/DVD drive.
      Add multiple CD/DVD drives by clicking Add Hardware > CD/DVD Drive. You can add a maximum of three CD/DVD drives to a virtual machine.
    6. GPU Device 1: Attach a GPU device to the VM.
      Supports physical GPUs and vGPUs. Add multiple GPU devices by clicking Add Hardware > GPU Device.
    7. USB Device 1: Attach a USB device to the VM.
      Supports direct connection and redirection. Add multiple USB devices by clicking Add Hardware > USB Device. You can add a maximum of one USB device to a virtual machine.
    8. PCIe Device 1: Attach a PCIe device for the virtual machine.
      You can load a PCIe device that has been switched to pass-through mode on the host. To add a PCIe device, click Add Hardware > PCIe Device.
    9. TPM: Attach a virtual Trusted Platform Module (vTPM) for the virtual machine to provide enhanced security for the virtual machine operating system.
      You must first add an available key provider and set the virtual machine boot mode to UEFI. To add a TPM device, click Add Hardware > TPM. A single virtual machine supports a maximum of one TPM device.
    10. Other Hardware: Configure graphics and audio devices for the VM.
      • Graphics Card Type: Specify the default graphics card type when powering on a virtual machine. Supports vga, virtio, qxl, and cirrus, providing basic/high-definition/high-performance video functionality experiences. Default: vga for x86 VMs and virtio only for ARM VMs.
      • Total Graphics Memory: Fixed at 16 MB for vga or cirrus. Configurable for qxl.
      • Audio Card Type: Specify the default audio card type when powering on a virtual machine. Supports HDA (ICH6), HDA (ICH9), and AC97. Default: HDA (ICH6).
      • Motherboard Type: Specify the default motherboard type when powering on a virtual machine. Supports i440fx and q35. Default: i440fx.
  5. Set the following parameters to complete the VM advanced settings:
    1. Configure general options.
      • Tag: Attach tags to identify VMs. For more information, see Tag Management.
      • Hostname: VM hostname.
      • VM Scheduling Group: Join a VM scheduling group for host allocation based on scheduling policies associated with the scheduling group. For more information, see VM Scheduling Policy.
      • Sync with Host BIOS: Whether to synchronize the Windows VM BIOS clock with the host's BIOS clock. Default: disabled. For more information, see VM Time Synchronization.
      • User Data: User-defined data. Upload custom parameters or scripts to perform custom configurations or specific tasks on the virtual machine. For more information, see VM User Data.
    2. Configure remote access settings.
      • Console Mode: VM console mode. Options include VNC (default), SPICE, VNC+SPICE.
      • Console Password: VM console password. Supports manual input or random generation. Allowed characters: letters, numbers, and the following special characters: -`=[];',./~!@#$%^&*()_+|{}:"<>?

        You can specify whether to enforce setting a console password and password strength through VNC Console Password in the security settings. If enabled, you need to set the console password according to the specified strength requirements when creating a virtual machine.

      • USB Redirection: Redirects USB devices from the VDI client to the VM. Default: disabled.
    3. Configure login authentication settings.
      • None: Do not set login password or SSH key.
      • Password: System login password for Linux VM (root) or Windows VM (administrator). Supports manual input or random generation. Allowed characters: letters, numbers, and the following special characters: -`=[];',./~!@#$%^&*()_+|{}:"<>?
        Note: Before setting the password, ensure that the virtual machine image has cloud-init installed.
      • SSH Key: Inject SSH Key for password-free login to Linux VM.
        Note: Before injecting the SSH Key, ensure that the virtual machine image has cloud-init installed.
    4. Configure VMTools.
      • Failure Response Policy: Set an automatic response action for VM failures (Windows BSOD or Linux guest hang). Options include No Action, Reboot, and Shut Down.
      • Time Synchronization: Whether to automatically synchronize VM time with host system time. Default: enabled.
    5. Configure boot options.
      • Boot Order: OS boot priority sequence. Options include hard disk, CD-ROM, and network. By default, the BIOS boots from the hard disk, and if no boot device is found, it cannot load the system.
      • BIOS Mode: The BIOS boot mode supports Legacy and UEFI. Legacy is the default in x86 clusters, while UEFI is the default in ARM clusters.
      • Secure Boot: You can enable this option only when the BIOS mode is set to UEFI. When enabled, the system validates the digital signature of all boot components (such as boot loaders, OS Kernels) during VM startup. Only trusted software with valid signatures can be loaded.
      • BIOS Post Delay: BIOS screen timeout duration. Default: 10 seconds.
    6. Configure other options.
      • Hide KVM Virtualization Flag: Controls CPU virtualization flag. When enabled, inserts <hidden state="on"> into the <kvm> element in the newly started VM XML. Default: disabled.
      • VMware I/O Port Simulation: Whether to allow a KVM virtual machine to emulate the I/O ports in a VMware virtualization environment, making the KVM virtual machine compatible with VMware I/O port standards. Default: disabled.
        The main purposes of this option:
        • Migration and Compatibility: Allows migrating virtual machines from a VMware environment to a KVM environment, or running both VMware and KVM virtual machines in a mixed environment without significant configuration changes.
        • Testing and Development: Developers and testers can use KVM virtual machines to simulate a VMware environment to test applications or configurations in a VMware-like environment without requiring actual VMware licenses.
      • Anti-Spoofing Mode: Whether to enable anti-IP/MAC spoofing and ARP deception features. When enabled, the virtual machine can only communicate with the outside world using the IP/MAC address allocated by the platform. Default: disabled.
      • Cross-Cluster HA Policy: Whether VM HA migration supports cross-cluster.
        Note: This policy only affects automatic VM migrations in shared storage scenarios (distributed storage, NFS storage, SAN storage), such as VM migration in host maintenance or host replacement. This policy does not affect other actions such as manual hot migration of virtual machines (changing the host), specifying a host to start a VM, or dynamic resource scheduling (DRS) strategies that change the host.
      • Hyper-V: Whether to enable Hyper-V emulation for the VM for nested virtualization scenarios in Windows systems. Default: disabled.
      • EmulatorPin: Whether to assign all other threads than vCPU threads and IO threads of a VM to host physical CPUs (pCPUs). You can assign by NUMA nodes. Default: unassigned, which is virtual machine-related threads run on corresponding pCPUs according to system scheduling.
      • Auto-Converge: Whether to enable auto-convergence mode for KVM virtual machine hot migrations. Default: disabled.

        If the virtual machine remains under high business load for a long time and the application is moderately sensitive to performance, it is recommended to enable auto-convergence mode to improve migration success rates.

      • PCI Hot Plug: Whether to allow hot plugging of PCI devices in the virtual machine. Default: enabled.
        Note: If hardware compatibility errors occur during hot plugging or if the hardware device is not supported, you can disable this switch.
      • CPU Vendor ID: If the virtual machine is running on a host with Hygon CPUs, it is recommended to set the VM's CPU vendor ID to AuthenticAMD to ensure compatibility with various operating systems and maintain normal VM operation. If set to None, certain operating systems may experience compatibility issues.
        Note: This parameter is hidden when the location of the virtual machine is set to either cluster or auto-allocated.
  6. 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.

Import a Virtual Machine

Upload an OVF file to quickly import virtual machines, facilitating VM migration across different platforms.

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.

Procedure

  1. In the navigation pane, right-click the target cluster, host, or image, and then click New Virtual Machine.
  2. In the Select VM Creation Type dialog, select Import VM, and then click Next.
  3. In the Import Virtual Machine dialog, set the following parameters:
    Upload Information
    • Image Storage: Temporary storage for the uploaded template file. Supports single-node image repositories and distributed image repositories. The template file will be automatically deleted after the virtual machine is created.
    • Template Type: Supports uploading OVF type template files.
    • OVF File: Upload an OVF format file. Only a single file can be uploaded.
    • VMDK File: Upload VMDK format files from the OVF template. Must be consistent with the file configuration defined in the OVF format file, including the number of files and configuration details.
    • MF File: Upload an MF format file from the OVF template. Only a single file can be uploaded.
    Basic Information
    • Name: The name of the virtual machine.
    • Group: The group where the virtual machine resides. If not set, the default group will be used.
    • Location: The host or cluster location where the virtual machine is running.
    • Storage Location: The data storage location for the virtual machine's hard disk. Supports local storage, NFS storage, SAN storage, as well as distributed storage. If not set, automatic allocation will be used.
    • HA: The auto-restart mechanism for the virtual machine in case of an abnormal shutdown. It is disabled by default. For more information, see VM HA.
    • Power Status: Whether the virtual machine should automatically power on after creation. By default, it starts automatically.
  4. 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.

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.

Register a Virtual Machine

You can register a virtual machine configuration file and data file to create a corresponding virtual machine record on the platform. After registration, the virtual machine is managed uniformly by the platform.

Before you begin

  • Make sure the platform is installed with a valid Advanced Edition license.
  • Only SAN storage, local storage, and NFS storage support virtual machine registration. Before registration, the data storage must be attached to the cluster, and the cluster must contain a host.
  • The same VM configuration file cannot be registered multiple times on the same host.
  • For VMs with TPM, ensure the corresponding key provider is configured on the platform before registration

Procedure

  1. In the navigation pane, click Inventory > Data Storage.
  2. Select the target data storage, and then click Actions > Register VM.
  3. In the Register VM dialog, set the following parameters:
    • Configuration File: Select the configuration file for the virtual machine you want to register.
    • VM Name: Set a name for the virtual machine.
    • Group: Select the group for the virtual machine.
    • Location: Specify where the virtual machine runs.
  4. Click OK.

Clone a Virtual Machine

If you want to reuse the configuration of a virtual machine, you can clone the virtual machine. ZStack ZSphere provides full VM cloning with two methods: full cloning and instant full cloning

Before you begin

  • The source virtual machine must be in a running, paused, or shut down state.
    Note: Cloning running VMs only clones the data that has already been written to disk at the start of cloning and does not include real-time cache data.
  • To ensure data integrity, it is recommended to pause or power off high I/O virtual machines before the cloning.
  • Detach all shared disks from the source virtual machine. Cloning of virtual machines with shared disks is currently unsupported.
  • To avoid login errors, do not set a static IP address on the source virtual machine.
  • The cluster where the virtual machine resides has sufficient compute, storage, and network resources.

Procedure

  1. On the target VM page, click Actions > Clone > Clone Virtual Machine.
  2. In the Clone Virtual Machine dialog, set the following parameters:
    • Name: Set the name for the cloned virtual machine.
    • Quantity: Set the number of virtual machines to be cloned.

      When cloning multiple VMs, the system automatically appends suffixes "-1/-2/-3" to distinguish between cloned resources.

    • Clone Method: Choose a type of cloning method.
      • Full Clone: The cloned VM is independent of the source VM, and the performance is completely unaffected after cloning, but the VM starts slow.
      • Instant Full Clone: The cloned VM starts quickly, the VM is eventually independent of the source VM, and the performance is completely unaffected after cloning.
        Note: When you use Instant Full Clone to clone a VM, the system automatically performs Flatten to eventually achieve data independence. During flattening, operations on VMs/disks will be conducted after the flattening is completed.
    • Data Storage: By default, the system automatically assigns data storage for cloned virtual machines, but you can manually specify a data storage.
      • Auto Allocated: The cloned VM and its disks will use the same data storage as the source VM and its disks.
      • Manual Allocation: The cloned VM and its disks will use the data storage you specify.
      Note:
      1. You can only specify data storage when using full clone.
      2. If Disk 1 of the source VM uses local storage while the other disks use different types of data storage, the clone operation will fail if local storage is unavailable.
      3. When specifying SAN storage as the data storage, you can set separate provisioning methods for Disk 1 and other disks.
    • VM Scheduling Group: Add cloned VMs to a virtual machine scheduling group. The virtual machine will be scheduled based on the scheduling policy associated with group. A virtual machine can join only one VM scheduling group. For more information, see VM Scheduling Policy.
    • Power Status: Select whether to automatically power on virtual machines after the cloning.

What to do next

The cloning operation duplicates the source virtual machine's configuration, installed applications, and credentials to the new cloned VM. However, the cloning operation does not automatically replicate all associated settings. You must manually configure additional parameters for the cloned VM as needed. For example, to maintain consistency with the source VM, you may need to manually assign identical tags to the cloned VM.

If the source virtual machine has a console password configured, you can restart the cloned virtual machine to activate the password setting.

Access a Virtual Machine

You can access a virtual machine by launching the VM console with one click. In the VM console, you can perform various actions, such as installing the operating system, configuring the system, executing commands, and running applications. ZStack ZSphere provides these access options:
  • Access a VM by using the console
  • Access a VM by using SSH

(Optional) Manage VM Access and Boot Options

Before accessing a virtual machine, you may configure the following settings according to your business needs: boot options, remote access, and login authentication.

Manage Boot Options

The boot options include the following settings:
  • Boot Order: Define the sequence for loading the operating system during VM startup.
    For example, if you set the boot order as (1) Disk 1, (2) CD/DVD Drive, and (3) Network, the VM boots in this sequence:
    1. First the VM attempts to boot from disk 1. If successful, the VM will not try CD/DVD drive.
    2. If booting from disk 1 fails, the VM attempts to boot from CD/DVD drive. If successful, the VM will not try the network.
    3. If booting from CD/DVD drive fails, the VM attempts to boot from the network. If the system loads successfully from the network, boot succeeds. Otherwise, boot fails and the system will not start.
  • BIOS Mode: Select the BIOS mode based on the image format:
    • Legacy: Supports x86 architecture and all operating systems.
    • UEFI: Required for aarch64 architecture. Supports Windows and CentOS. Windows 7/2008 requires compatibility support module (CSM).
    Mismatched BIOS mode may cause virtual machines to malfunction:
    • For qcow2 or raw images, select the BIOS mode that is consistent with the template.
    • For iso images, you can select a BIOS mode as needed. Then, the system will be booted accordingly.
  • BIOS Post Delay: Set the automatic delay time for BIOS interface. Valid value: 1 to 60 seconds. If you do not perform any operation during this period, the system automatically proceeds to boot.

Prerequisites

To configure boot options, make sure the virtual machine is shut down.

Procedure
  1. On the target virtual machine page, click Advanced Settings.
  2. On the Advanced Settings tab, choose Boot Options.
  3. Click Edit, then configure boot order, BIOS mode, BIOS post delay as needed.

Manage Remote Access Settings

The remote access includes the following settings:
  • Console Mode: Select the protocol type for connecting to the VM console:
    • VNC: Support both Linux and Windows systems. Primarily used for Linux server management with typical network traffic around 100 KB.
    • SPICE: Support Linux systems with superior color/audio/video/USB capabilities. Ideal for virtual desktop applications with typical network traffic around 10 to 20 MB. In this mode, you can configure the number of connected displays and video streaming mode (off, all, or filter).
    • VNC+SPICE: Support both VNC and SPICE protocols. You can configure the number of connected displays and video streaming mode (off, all, or filter).
  • Condole Password: Set the console access password.
    • Character requirements: Support letters, numbers, and these special characters: -`=[];',./~!@#$%^&*()_+|{}:"<>?
    • Length requirements: 6 to 8 characters.
    You can customize the VNC console password strength. For more information, see Security Settings.

Prerequisites

To configure remote access, make sure the virtual machine is shut down.

Procedure
  1. On the target virtual machine page, click Advanced Settings.
  2. On the Advanced Settings tab, choose Remote Access.
  3. Click Edit, then configure console mode and console password as needed.

Manage Login Authentication Settings

The login authentication includes the following settings:
  • Set SSH Key:
    1. After installing cloud-init, the SSH authentication is disabled by default. To enabled it, set the ssh_pwauth parameter to 1 in /etc/cloud/cloud.cfg.
    2. Generate an SSH key pair using the ssh-keygen command. The public key is stored in /root/.ssh/id_rsa.pub by default.
    3. Copy and paste the file content into the SSH Key input field.
    Note:
    • When injecting SSH KEY during new VM creation, it takes effect after the first boot.
    • For existing VMs receiving SSH KEY for the first time, you must reboot the VM.
    • To re-inject SSH KEY for VMs with existing configurations, first run rm -rf /var/lib/cloud/instances to clear previous settings before injecting the new SSH KEY and rebooting.
    • Deleting SSH KEY only removes the record from the system, not from VM configurations. To completely remove SSH KEY, manually delete it from /root/.ssh/authorized_keys in the VM.
  • Change VM Password:
    1. Modify the login name as needed. Options include system default and custom login name.

      Default login name: root for Linux and Administrator for Windows.

    2. Set a new password.
      • Character requirements: Support letters, numbers, and these special characters: -`=[];',./~!@#$%^&*()_+|{}:"<>?

        You can customize the VM password strength. For more information, see Security Settings.

Prerequisites
  • Before configuring SSH public key, you must install VMTools (cloud-init). Recommended versions: 0.7.9, 17.1, 19.4, or later.
  • Before changing VM password, ensure the VM is running and has VMTools (QGA) installed.
Procedure
  1. On the target virtual machine page, click Advanced Settings.
  2. On the Advanced Settings tab, choose Login Authentication.
  3. Click Set SSH Key or Change VM Password.

Access a VM by using Console

You can quickly access a virtual machine through the console to perform various actions, such as install the operating system, configuring system, executing commands, and running applications.

Before you begin

  • The virtual machine must be in the running state.
  • (Optional) Configure console mode and console password as needed. For more information, see Manage Remote Access Settings.
  • (Optional) Set up a proxy address to access the VM console. For more information, see Console Proxy Management.

Procedure

  1. In the navigation pane, choose Inventory > VM and Host.
  2. Choose a target virtual machine and click Launch Console.
    The console opens in a new browser tab.
  3. Click anywhere inside the console window to start using your mouse, keyboard, and other input devices in the console.
  4. The console provides quick-access buttons in the left sidebar inside the console window.
    • Local Command Paster: Click this button and the paste command dialog appears. You can paste commands here and click OK to run the commands.
    • Tools: Provide a collection of hotkeys, including Ctrl, Alt, Win, Tab, Esc, and Ctrl+Alt+Del.
    • Power Management: Allow you to manage the VM power status. Actions include shut down, reboot, pause, resume, and power off.
    • Setting: Choose whether to enable a read-only mode in the console. When enabled, you cannot enter commands or perform other actions in the console.

Access a VM by using SSH

You can access a virtual machine by using the SSH connection protocol.

Before you begin

  • You have network connection and root access privileges to the target VM.
  • (Optional) Set SSH Key for password-free login and change VM password as needed. For more information, see Manage Login Authentication Settings.

Procedure

  1. Log in to the virtual machine directly using a remote login software on your local computer.
    # ssh root@192.0.2.1
    root@192.0.2.1's password:
    Last login: Mon Sep 24 12:05:36 2021
    root~#
  2. To log in using an SSH private key, first add the SSH public key to the target virtual machine, then run the following command:
    # ssh -i ${private_key.pem} ${UserName}@${IpAddress}
    ${private_key.pem} is the path to your private key file, ${UserName} is your login username, and ${IpAddress} is the target VM IP address.

Modify a Virtual Machine

If you have already created one or more virtual machines, you can modify the virtual machine configurations according to your business scenarios as needed.

Before Modifying Virtual Machine Configurations

Before modifying the following configurations, you need to install VMTools on the virtual machine:
  • Modify failure response policy
  • Change the virtual machine password
  • Modify the hostname for Windows virtual machines
  • Modify time synchronization
To modify the following configurations, you need to shut down the virtual machine:
Module Modification Item
Operating System System Image
CPU and Memory Number of Cores per Socket
CPU Hot Plugging & Memory Hot Plugging
CPU Mode
CPU Affinity
Network Adapter Network Adapter Multi-Queue Count
Graphics Card Graphics Card Type
Total Graphics Memory
General Options Hostname
Login Options Password
Remote Access Console Mode
Console Password
USB Redirection
SSH Key
Boot Options BIOS Mode
Boot Order

Modify Virtual Machine Configuration

Single Operation:
  • If you only need to modify the virtual machine name and description, you can click on the Actions > Edit Name and Description in the target virtual machine page to make the changes.
  • If you need to modify the Basic Information Settings and Hardware Information Settings, you can click on the Modify Configuration operation or the VM Hardware settings on the Overview page to make the changes.
  • If you need to modify the Advanced Settings, you can click on the Actions > Advanced Settings in the target virtual machine page and modify the corresponding settings as needed.
  • If you need to modify the virtual machine system settings, such as resetting the virtual machine, changing the group the virtual machine is located in, issuing network configurations, or changing the owner of the virtual machine, you can click on the Actions > System Settings in the target virtual machine page and modify the corresponding settings as needed.
  • If you need to modify the tags bound to the virtual machine, you can click on the Actions > Tag Management in the target virtual machine page to make the changes.
Bulk Operations:
  • If you need to modify the system settings of multiple virtual machines, such as resetting the virtual machines, changing the groups they are located in, or changing the owners of the virtual machines, you can do so on the child virtual machine page corresponding to the parent/grandparent resource (host, cluster, data center) of the target virtual machine. Select the target virtual machines and click on the Bulk Actions > System Settings and modify the corresponding settings as needed.
  • If you need to modify the tags bound to multiple virtual machines, you can do so on the child virtual machine page corresponding to the parent/grandparent resource (host, cluster, data center) of the target virtual machine. Select the target virtual machines and click on the Bulk Actions > Tag Management to make the changes.

Delete a Virtual Machine

Before you begin

  • You cannot move virtual machines to recycle bin or delete virtual machines that are in the running, paused, crashed, or unknown state. Shut down the VM first before perform the action.
  • (Optional) The platform provides deletion protection for virtual machines and disks. You can define how resources are deleted by customizing the deletion policy in system parameters. By default, the platform adopts a delayed deletion for VM deletion policy (retained for 7 days) and disk deletion policy (retained for 3 days). Deleted resources are first moved to the recycle bin and permanently deleted after the retention period. For more information, see System Parameters.

Procedure

  1. In the navigation pane, choose Inventory > VM and Host.
  2. Select a target virtual machine.
  3. On the VM details page, click Actions > Move to Recycle Bin.
    To delete multiple virtual machines, go to the virtual machine tab of the parent resources (host, cluster, data center). For example, on the host's Virtual Machine tab, select the VMs you want to delete, then click Bulk Action > Move to Recycle Bin.
    The delete button label changes based on the VM Deletion Policy. When the deletion policy is set to immediate deletion, the button appears as "Delete". When the deletion policy is set to delayed deletion or never delete, the button appears as "Move to Recycle Bin".
  4. In the confirmation dialog, select whether to simultaneously delete disks attached to the virtual machine (excluding shared disks).
    When selected, disks will be deleted or moved to recycle bin according to the defined disk deletion policy.
  5. After acknowledging the risk, click OK.

Results

The deletion releases the associated CPU, memory, and IP address resources.

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.