Access, Group, and Power Management

After VMs are created, you can organize them with VM groups, access them through the console or SSH, and perform power operations such as power on, shut down, reboot, and pause based on their power status.

The console proxy supports VM console access through a proxy address. Administrators can view, reconnect, or modify the console proxy address to ensure that users can access VM consoles through the proxy address.

VM Group Management

A VM group is a logical collection used to organize VMs based on business requirements. ZSphere provides a default group. When you create a VM without creating or selecting a group, the VM is added to the default group. This section describes how to create and use VM groups.

Create VM Groups and Subgroups

  1. In the navigation pane, choose Inventory > VM and Host.
  2. Select the target data center.
  3. Right-click the target data center and click New VM Group.
  4. In the New VM Group dialog, configure the following options:
    Option Description
    Name Enter a name for the VM group.
    Group Type Select a group type. Options include New Group and Subgroup.
    Upper-Level Group Specify an upper-level group when you select Subgroup.
  5. Click OK.

Manage Existing VM Groups

You can manage existing VM groups from the following entries:

  • In the navigation pane, choose Inventory > VM and Host, switch to Group View, and select the target VM group.
  • On the target VM page, click Actions > System Configuration > Change Group.
  • Go to the Virtual Machine tab of a data center resource and perform batch operations.
Operation Description
Add VMs to a Group You can add VMs to a group in the following ways:
  • In the navigation pane, right-click the target VM group and click New Virtual Machine. The newly created VM belongs to this group by default.
  • In the navigation pane, select the target VM group. Then, on the right side of the page, click New Virtual Machine. The newly created VM belongs to this group by default.
  • On the target VM page, click Actions > System Configuration > Change Group to change the current VM to the target group.
Modify a VM Group Name On the target VM group page, click Actions > Edit Name, and modify the group name.
Delete a VM Group On the target VM group page, click Actions > Delete to delete the group. You can also delete groups in batches on the Virtual Machine tab of a data center resource. After a group is deleted, VMs in the group are moved to the default group.

Access a VM

After a VM is created, you can use the console to access the VM and install or configure the operating system. You can also use SSH to access a Linux VM with remote login enabled.

Console access is suitable for installing the operating system, viewing the boot process, and troubleshooting network connectivity. SSH access is suitable for routine command-line operations after the VM network is reachable.

Configure Boot Options

Before you begin

To configure boot options, make sure the VM is stopped.

Procedure

  1. On the target VM page, click Advanced Settings.
  2. On the Advanced Settings tab, select Boot Options.
  3. Click Edit and configure the boot order, BIOS mode, and BIOS post delay as needed.

    Boot options include the following settings:

    Option Description
    Boot Order Defines the priority sequence for loading the operating system during VM startup.
    For example, if you set the boot order to (1) Disk 1, (2) CD/DVD Drive, and (3) Network, the VM boots as follows:
    1. The VM first attempts to boot from Disk 1. If the boot succeeds, the VM does not try the CD/DVD drive.
    2. If booting from Disk 1 fails, the VM attempts to boot from the CD/DVD drive. If the boot succeeds, the VM does not try the network.
    3. If booting from the 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 cannot start.
    BIOS Mode Select the BIOS boot mode based on the selected image format:
    • Legacy: Supports x86 architecture and all operating systems.
    • UEFI: Required for aarch64 architecture. Windows and CentOS are supported. Windows 7/2008 must use the compatibility support module (CSM).

    A mismatched BIOS mode might cause the VM to malfunction:

    • For qcow2 or raw images, select the same BIOS mode used when the image was created.
    • For iso images, select a BIOS mode as needed. The system boots and installs based on the selected mode.
    BIOS Post Delay Specifies how long the BIOS screen stays open automatically. The valid range is 1 to 60 seconds. If no operation is performed within the specified time, the system automatically proceeds from the BIOS screen to system boot.

Configure Remote Access

Before you begin

To configure remote access, make sure the VM is stopped.

Procedure

  1. On the target VM page, click Advanced Settings.
  2. On the Advanced Settings tab, select Remote Access.
  3. Click Edit and configure the console mode and console password as needed.

    Remote access includes the following settings:

    Option Description
    Console Mode Select the protocol type used to connect to the VM console:
    • VNC: Supports both Linux and Windows. It is mainly used for Linux server management, with typical network traffic of about 100 KB.
    • SPICE: Supports Linux and provides better color, audio, video, and USB capabilities. It is mainly used for virtual desktop applications, with typical network traffic of about 10 MB to 20 MB. In this mode, you can configure the number of connected displays and the video streaming mode, including off, all, and filter.
    • VNC+SPICE: Supports both VNC and SPICE protocols. In this mode, you can configure the number of connected displays and the video streaming mode, including off, all, and filter.
    Console Password Sets the console password.
    • Character requirements: Only letters, numbers, and the following special characters are supported: -`=[];',./~!@#$%^&*()_+|{}:"<>?
    • Length requirements: 6 to 8 characters.

    The VNC console supports password strength settings.

Configure Login Authentication

Before you begin

  • Before setting an SSH public key, install VMTools (cloud-init). Recommended versions are 0.7.9, 17.1, 19.4, or later.
  • Before changing a VM password, make sure the VM is running and VMTools (QGA) is installed.

Procedure

  1. On the target VM page, click Advanced Settings.
  2. On the Advanced Settings tab, select Login Authentication.
  3. Click Set SSH Key or Change VM Password.

    Login authentication includes the following settings:

    Option Description
    Set SSH Key
    1. After cloud-init is installed, SSH password authentication is disabled by default. Set ssh_pwauth to 1 in /etc/cloud/cloud.cfg to enable SSH password authentication.
    2. Run the ssh-keygen command to generate an SSH key. 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 an SSH key is injected during VM creation, it takes effect after the first boot.
    • When an SSH key is injected into an existing VM for the first time, restart the VM for the key to take effect.
    • To reinject an SSH key into an existing VM that already has an injected SSH key, run rm -rf /var/lib/cloud/instances to clear previous configuration, inject the new SSH key, and restart the VM for the key to take effect.
    • Deleting an SSH key only deletes the SSH key record from the system. It does not delete SSH key information already injected into the VM configuration. To completely delete the SSH key information, manually clean up /root/.ssh/authorized_keys.
    Change VM Password
    1. Modify the login name option, including system default and custom login name.

      The default login name is root for Linux and Administrator for Windows.

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

        VM password strength settings are supported.

Access a VM by Using the Console

Use the console to quickly access a VM and perform operations such as installing the operating system, configuring the operating system, running commands, and starting applications.

Before you begin

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

Procedure

  1. In the navigation pane, choose Inventory > VM and Host.
  2. Select the target VM 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. Quick-access buttons are available in the left sidebar of the console window.
    • Local Command Paster: Click this button to open the paste command dialog. Paste the command to run into the dialog, and then click OK to run it in the console.
    • Tools: Provides hotkeys, including Ctrl, Alt, Win, Tab, Esc, and Ctrl+Alt+Del.
    • Power Management: Allows you to manage VM power status directly in the console. Actions include Shut Down, Reboot, Resume, Pause, and Power Off.
    • Settings: Allows you to enable or disable read-only mode. When read-only mode is enabled, you cannot run commands or perform other operations in the console window.

Access a VM by Using SSH

Use SSH to access a VM.

Before you begin

  • Your local computer, as the login client, has network connectivity and root access to the target VM.
  • (Optional) Configure SSH key-based password-free login and the VM password as needed. For more information, see Configure Login Authentication.

Procedure

  1. On your local computer, use remote login software to log in to the VM directly.
    # 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 to the VM by using an SSH private key, first add the SSH public key to the target VM, and then run the following command from the login client:
    # ssh -i ${private_key.pem} ${UserName}@${IpAddress}
    Here, ${private_key.pem} is the private key file path, ${UserName} is the login user name, and ${IpAddress} is the IP address of the target VM.

Console Proxy Management

The console proxy is used to access VM consoles through a proxy address. By default, the proxy address is the management node IP address. When the management node is deployed in a NAT, public network access, or domain-name access scenario, modify the console proxy address and port according to the actual access path.

If a VM console fails to open, reconnect the console proxy first. After the status changes back to Connected, open the VM console again.

Common Entry

In the navigation pane, choose System Management > Console Proxy to go to the Console Proxy page.

Common Operations

Operation Description
View Proxy Address View the console proxy address. The default proxy address is the IP address of the management node.
Reconnect Console Proxy If a VM console fails to open, click Reconnect on the Console Proxy page. After the status changes to Connected, you can open the console normally.
Modify Proxy Address Click Modify Proxy Address to modify the address and port as needed. You can enter the public IP address of the management node, a NAT address, or a domain name as the console proxy address. The change takes effect immediately and does not require a management node restart.

VM Power Management

A VM can be in the following power statuses: Running, Powering off, Shut Down, Pausing, Paused, Powering on, Rebooting, Resuming, Unknown, and Crashed.
  • Running, Shut Down, Paused, Unknown, and Crashed are final power statuses.
  • Pausing, Powering off, Powering on, Rebooting, and Resuming are transitional power statuses.
Final power statuses:
  • Running, Shut Down, and Paused: These statuses change based on power management operations, including Power On, Shut Down, Reboot, Resume, Pause, and Power Off.
    • If the original status is Running, Shut Down, Reboot, Pause, and Power Off are supported. If the operation succeeds, the final status changes to Shut Down, Running, Paused, and Shut Down, respectively.
    • If the original status is Shut Down, only Power On is supported. If the operation succeeds, the final status changes to Running.
    • If the original status is Paused, Shut Down, Resume, and Power Off are supported. If the operation succeeds, the final status changes to Shut Down, Running, and Shut Down, respectively.
  • Unknown: When the management node cannot obtain the VM status from the host, for example when the host management network is disconnected, the VM status becomes Unknown regardless of its previous status. In the Unknown status, only Force Shut Down is supported.
  • Crashed: When a running Windows VM has a blue screen or a Linux VM hangs, the VM status changes to Crashed. Based on the failure policy, the VM status changes as follows:
    • If the failure policy is No Action, the VM remains Crashed.
    • If the failure policy is Shut Down, the final VM status changes to Shut Down if shutdown succeeds. If shutdown fails, the VM remains Crashed.
    • If the failure policy is Reboot, the final VM status changes to Running if reboot succeeds. If reboot fails, the VM remains Crashed.

Transitional power statuses: Pausing, Powering off, Rebooting, and Resuming are intermediate statuses when Pause, Shut Down/Power Off/Force Shut Down, Reboot, and Resume operations change a VM from its original status to a final status. Power operations are not supported while a VM is in a transitional status.

VM Operations and Power Statuses

VM operations depend on the current power status. The following table lists the power status required before each VM operation:
Operation VM Status
Create a VM /
Edit a VM Running/Shut Down/Paused
Change Group Running/Shut Down/Paused
Power On a VM Shut Down
Shut Down a VM Running
Reboot a VM Running
Resume a VM Paused
Pause a VM Running
Force Shut Down a VM Unknown
Power Off Running
Launch Console Running
Clone a VM Running/Shut Down/Paused
Modify Hostname Running/Shut Down/Paused
Bind Tag Running/Shut Down/Paused
Unbind Tag Running/Shut Down/Paused
Change Host Running/Shut Down
Change Data Storage Running/Shut Down. Supported states depend on the migration scope and data storage type. For more information, see Change Data Storage.
Change Host and Data Storage Running/Shut Down
Modify CPU Hot Plug and Memory Hot Plug Running/Shut Down
Configure GPU Device Shut Down
Expand System Disk Running/Shut Down
Change Owner Running/Shut Down
Change System Shut Down
Reset System Shut Down
Configure Boot Order Running/Shut Down
Configure HA Running/Shut Down
Configure BIOS Clock Synchronization Running/Shut Down/Paused
Configure Time Synchronization Running/Shut Down/Paused
Configure Failure Policy Running
Set SSH Key Running/Shut Down
Change VM Password Running
Set Console Password Running/Shut Down
Switch Console Mode Running/Shut Down/Paused
Configure CPU and Memory Resource Priority Running/Shut Down/Paused
Cross-Cluster HA Policy Running/Shut Down/Paused
USB Redirection Running/Shut Down/Paused
Create Snapshot Running/Shut Down/Paused
Attach Disk Running/Shut Down
Detach Disk Running/Shut Down
Create Image Running/Shut Down
Attach ISO Running/Shut Down
Detach ISO Running/Shut Down
Join VM Scheduling Group Running/Shut Down
Remove from VM Scheduling Group Running/Shut Down
Export VM Shut Down
Delete VM (Move to Recycle Bin) Shut Down
Permanently Delete/Restore VM Deleted
Copy URL Running/Shut Down/Paused
Download Exported VM Running/Shut Down/Paused
Delete Export Record Running/Shut Down/Paused