Managing Virtual Machines
The operations below are available from the virtual machine list (row ⋮ menu) and the detail page. The following operations are documented as API/CLI references: Clone, Pause and Resume, and Serial Console. Each operation also has an equivalent API call — see Using the API below.
TOC
Reset PasswordProcedureUpdate KeyProcedureUpdate SpecificationsMigrate to Instance TypeLive MigrationUpdate NAT Network ConfigurationProcedureUpdate Tags and AnnotationsAdd ServiceReinstall Operating SystemProcedureConfigure IPProcedureUsing the APIImported Virtual MachinesReset Password
Reset the root user password. This password also serves as the login password for the virtual machine when logging in using a password.
Procedure
-
Access the Container Platform.
-
In the left navigation bar, click Virtualization > Virtual Machines.
-
Locate the virtual machine and select ⋮ > Reset Password.
-
Set the password.
-
Click Reset.
Note: Please keep your password safe. To ensure environment security, the platform encrypts and stores your password, and you will not be able to see the plaintext password again.
Update Key
Update the SSH keys.
Procedure
-
Access the Container Platform.
-
In the left navigation bar, click Virtualization > Virtual Machines.
-
Locate the virtual machine and select ⋮ > Update Key.
-
Select one or more associated keys, or Create Key.
-
Choose whether to restart immediately; updating keys requires a restart of the virtual machine to take effect.
-
Click Update.
Update Specifications
Change the size of a virtual machine, or move it between the two sizing paths: an instance type it references, or a machine model written into the virtual machine.
-
Access the Container Platform.
-
In the left navigation bar, click Virtualization > Virtual Machines.
-
Locate the target virtual machine and click ⋮ > Update Specifications. The dialog opens on the sizing path the virtual machine uses.
-
Choose the size:
-
Choose whether to Restart now.
-
Click Update.
When the change takes effect:
-
Machine model: the new CPU and memory apply after the virtual machine restarts.
-
Instance type on a running virtual machine: the reference changes at once, and the platform tries to apply the new size without a restart. Each hot-plug is carried out by a live migration, so the new size is applied live only when all of the following hold:
- The cluster rolls out virtual machine changes live (the KubeVirt
vmRolloutStrategyisLiveUpdate). - The virtual machine can be live-migrated (its
LiveMigratablecondition isTrue). - The new CPU count and memory stay within the hotplug ceilings the running instance started with. These are the
maxSocketsandmaxGuestof its instance type. When the instance type sets none, the platform computes them as the instance starts — by default four times the initial socket count and memory; the ratio and absolute caps are set cluster-wide inspec.liveUpdateConfiguration(maxHotplugRatio,maxCpuSockets,maxGuest) of theHyperConvergedresource. An instance type whose ceilings equal its size leaves no room to grow. The ceilings of a running instance are on its VMI; see the commands below. - The CPU count only increases; a smaller CPU count always needs a restart.
- For memory: the virtual machine runs on x86_64, the guest operating system supports memory hotplug (virtio-mem), and the guest memory is at least 1Gi.
Whatever cannot be applied live — all of it when one of the first three conditions fails — takes effect at the next restart, and the virtual machine carries the
RestartRequiredcondition until then. See CPU and Memory Hotplug for the guest-side requirements. - The cluster rolls out virtual machine changes live (the KubeVirt
-
Check whether a running virtual machine can be live-migrated, the hotplug ceilings of its running instance, and whether it still needs a restart:
A virtual machine that carries no platform label — typically one imported from another platform as is — is updated through its YAML; see Imported Virtual Machines.
Migrate to Instance Type
Move an existing virtual machine from a machine model to an instance type, so that it is sized like the virtual machines you create with instance types. The Resources column of the virtual machine list shows the sizing path of each virtual machine: Machine Model, Instance Type and its name, or Sizing undetermined.
-
Access the Container Platform.
-
In the left navigation bar, click Virtualization > Virtual Machines.
-
Locate the virtual machine and click ⋮ > Migrate to Instance Type (also available in the Actions menu of the detail page).
-
Check the Current Size — the guest CPU count and memory the virtual machine has now — and choose an Instance Type:
- An instance type of exactly the same size is preselected and marked Same size.
- When none has the same size, the closest ones are listed with their difference, and nothing is chosen until you choose one; choosing one changes the size of the virtual machine.
-
(Optional) Select Also reference a preference and choose a preference. A preference fills the device settings the virtual machine leaves unset, which can change what the guest sees — for example the model of its network interface.
-
Review What changes for the guest, then click Migrate:
- When the virtual machine defines its CPUs as cores or threads and no preference is referenced, the CPU count moves to sockets; software licensed per core may notice.
- The settings the chosen preference fills are listed.
- A running virtual machine keeps its current size until it restarts.
The migration removes only the size fields that conflict with an instance type and keeps every other setting. The size the virtual machine had is recorded on it (in the annotation vm.cpaas.io/previous-size); if you later move it back to a machine model with Update Specifications and keep the preselected size, that size is restored exactly.
A virtual machine cannot be migrated — and the dialog says why — when its template declares no CPU or no memory, when it and the chosen instance type set the same additional setting, or when it carries no platform label (see Imported Virtual Machines).
Migrate several virtual machines at once: select them in the list and click Batch Actions > Batch Migrate to Instance Type. Choose one instance type; each virtual machine is migrated on its own, those that cannot be migrated are skipped, and each gets its own outcome (Migrated, Skipped with the reason, or Failed with the message).
Live Migration
Note: For prerequisites, the cluster-wide migration limits and per-namespace policies, and the API, see Virtual Machine Live Migration.
-
Access the Container Platform.
-
In the left navigation bar, click Virtualization > Virtual Machines.
-
Locate the target virtual machine and click ⋮ > Live Migration.
-
Click Confirm.
Update NAT Network Configuration
When using NAT network mode, the platform by default opens port 22 for SSH services, and you can open other ports as needed.
Procedure
-
Access the Container Platform.
-
In the left navigation bar, click Virtualization > Virtual Machines.
-
Click Virtual Machine Name.
-
In the Basic Information section, click the icon to the right of Open Port.
-
Enter the port number and press the Enter key to confirm.
-
Choose whether to Restart Immediately; the configuration will take effect after restarting.
-
Click Update.
Update Tags and Annotations
-
Access the Container Platform.
-
In the left navigation bar, click Virtualization > Virtual Machines.
-
Click Virtual Machine Name.
-
In the Basic Information section, click the icon to the right of Tags or Annotations.
-
Configure as needed and click Update.
Add Service
-
Access the Container Platform.
-
In the left navigation bar, click Virtualization > Virtual Machines.
-
Click Virtual Machine Name.
-
In the Login Information section, click the icon to the right of Internal Route.
-
Refer to the Create Service page for quick addition of internal routes for the virtual machine.
-
Click Confirm.
Reinstall Operating System
It is strongly recommended to back up data before reinstalling the operating system to prevent data loss.
Note: This operation will clear all data in the virtual machine's system disk, as well as all snapshots, and is irreversible. Please proceed with caution!
Procedure
-
Access the Container Platform.
-
In the left navigation bar, click Virtualization > Virtual Machines.
-
Locate the virtual machine and select ⋮ > Reinstall Operating System. The operation is available when the virtual machine is stopped, unknown or abnormal; stop a running virtual machine first.
-
In the Reinstall Operating System window, configure the following parameters.
-
Provision Method: Image Source (the system disk is imported from the image address) or Image Instance (the system disk is cloned from an image instance). The image instance picker lists the image instances of
kube-publicand of the virtual machine's namespace, the latter marked with the namespace name; the current image is marked Current image. -
Select Image: By default, the current operating system image will be used for reinstallation. If you wish to reinstall a new operating system, first select the operating system of the virtual machine image, then choose the virtual machine image that belongs to that operating system.
-
-
Click Reinstall.
The new system disk is created like the one of a new virtual machine: its sourceRef names the image instance and the namespace it lives in, and its access mode follows the StorageProfile of the storage class (see Creating Virtual Machines).
Configure IP
Assign an IP to the virtual machine using dynamic allocation (DHCP) or bind a fixed IP to the virtual machine; the new IP will take effect after the virtual machine is restarted.
Procedure
-
Access the Container Platform.
-
In the left navigation bar, click Virtualization > Virtual Machines.
-
Locate the target virtual machine and click ⋮ > Configure IP.
-
Configure the IP Address.
-
Fill in an available IP: binding a fixed IP means that even after restarting, the virtual machine will consistently use this IP address.
-
Leave the option blank: this will use dynamic allocation (DHCP) to acquire an IP, assigning the IP when the virtual machine starts and releasing it when the virtual machine stops.
-
-
Choose whether to Restart Immediately; the configuration will take effect after restarting.
-
Click Configure.
Using the API
The console operations map to standard calls on the VirtualMachine resource:
-
Update Specifications, instance type path — point the virtual machine at another instance type:
If the reference pins a revision (
spec.instancetype.revisionName), clear it in the same patch — a new name with the old revision is rejected: -
Update Specifications, machine model path — patch the inline resources (ACP uses a resource-limit model, so set
requestsandlimitsto the same values); restart the virtual machine for the change to take effect: -
Switch from an instance type to a machine model — remove the reference and write the size in one request (a virtual machine may not carry both):
-
Migrate to Instance Type — add the reference and remove every size field the template carries, in one request:
resourcesrequests and limits for CPU and memory,domain.cpusockets / cores / threads, anddomain.memory.guest. Any of them left in place conflicts with the instance type and the update is rejected (for exampleVM field(s) spec.template.spec.domain.cpu.cores conflicts with selected instance type). A merge patch that sets all of them tonullworks whatever shape the template has — a field that is not there is simply skipped:Other settings (for example
domain.cpu.model) are kept; if the instance type sets one of them too, remove it from the template as well. The patch can leave emptyresources,cpuandmemoryobjects in the template — for examplecpu: {}on a virtual machine that had nodomain.cpu. They are harmless: an instance type conflicts only with the individual size fields listed above, not with an empty object. Without a preference, the guest CPU count is placed in sockets. The console additionally records the removed fields in the annotationvm.cpaas.io/previous-sizeso that Update Specifications can restore them; a YAML migration does not. -
Update Tags and Annotations:
-
Live Migration — create a
VirtualMachineInstanceMigration; see Virtual Machine Live Migration.
Imported Virtual Machines
The console treats a virtual machine as imported when its labels — or, if the virtual machine has no labels at all, the labels of its template — include no key that contains the platform label domain (cpaas.io by default). This is typically a virtual machine imported from another platform as is, for example through Forklift. For such a virtual machine, Update Specifications, Reset Password, Update Key, Reinstall Operating System and Configure IP are disabled, Migrate to Instance Type reports that it cannot be migrated (and a batch migration skips it), and it is updated through its YAML. A virtual machine imported with platform labels is managed like any other: its specifications can be updated on its sizing path, and it can be migrated to an instance type.
Viewing is not restricted: when an imported virtual machine references an instance type (spec.instancetype), its detail page shows the requested and the resolved instance type and the size it runs with, like any other virtual machine. To resize it, change the reference in its YAML — see Using the API: