Chapter 3. Getting started 3.1. Getting started with OpenShift Virtualization You can explore the features and functionalities of OpenShift Virtualization by installing and configuring a basic environment. Note Cluster configuration procedures require cluster-admin privileges. 3.1.1. Planning and installing OpenShift Virtualization Plan and install OpenShift Virtualization on an OpenShift Container Platform cluster: Plan your bare metal cluster for OpenShift Virtualization . Prepare your cluster for OpenShift Virtualization . Install the OpenShift Virtualization Operator . Install the virtctl command line interface (CLI) tool . Planning and installation resources About storage volumes for virtual machine disks . Using a CSI-enabled storage provider . Configuring local storage for virtual machines . Installing the Kubernetes NMState Operator . Specifying nodes for virtual machines . Virtctl commands . 3.1.2. Creating and managing virtual machines Create a virtual machine (VM): Create a VM from a Red Hat image . You can create a VM by using a Red Hat template or an instance type . Create a VM from a custom image . You can create a VM by importing a custom image from a container registry or a web page, by uploading an image from your local machine, or by cloning a persistent volume claim (PVC). Connect a VM to a secondary network: Linux bridge network . Open Virtual Network (OVN)-Kubernetes secondary network . Single Root I/O Virtualization (SR-IOV) network . Note VMs are connected to the pod network by default. Connect to a VM: Connect to the serial console or VNC console of a VM. Connect to a VM by using SSH . Connect to the desktop viewer for Windows VMs . Manage a VM: Manage a VM by using the web console . Manage a VM by using the virtctl CLI tool . Export a VM . 3.1.3. steps Review postinstallation configuration options . Configure storage options and automatic boot source updates . Learn about monitoring and health checks . Learn about live migration . Back up and restore VMs by using the OpenShift API for Data Protection (OADP) . Tune and scale your cluster . 3.2. Using the virtctl and libguestfs CLI tools You can manage OpenShift Virtualization resources by using the virtctl command line tool. You can access and modify virtual machine (VM) disk images by using the libguestfs command line tool. You deploy libguestfs by using the virtctl libguestfs command. 3.2.1. Installing virtctl To install virtctl on Red Hat Enterprise Linux (RHEL) 9, Linux, Windows, and MacOS operating systems, you download and install the virtctl binary file. To install virtctl on RHEL 8, you enable the OpenShift Virtualization repository and then install the kubevirt-virtctl package. 3.2.1.1. Installing the virtctl binary on RHEL 9, Linux, Windows, or macOS You can download the virtctl binary for your operating system from the OpenShift Container Platform web console and then install it. Procedure Navigate to the Virtualization Overview page in the web console. Click the Download virtctl link to download the virtctl binary for your operating system. Install virtctl : For RHEL 9 and other Linux operating systems: Decompress the archive file: USD tar -xvf <virtctl-version-distribution.arch>.tar.gz Run the following command to make the virtctl binary executable: USD chmod +x <path/virtctl-file-name> Move the virtctl binary to a directory in your PATH environment variable. You can check your path by running the following command: USD echo USDPATH Set the KUBECONFIG environment variable: USD export KUBECONFIG=/home/<user>/clusters/current/auth/kubeconfig For Windows: Decompress the archive file. Navigate the extracted folder hierarchy and double-click the virtctl executable file to install the client. Move the virtctl binary to a directory in your PATH environment variable. You can check your path by running the following command: C:\> path For macOS: Decompress the archive file. Move the virtctl binary to a directory in your PATH environment variable. You can check your path by running the following command: echo USDPATH 3.2.1.2. Installing the virtctl RPM on RHEL 8 You can install the virtctl RPM package on Red Hat Enterprise Linux (RHEL) 8 by enabling the OpenShift Virtualization repository and installing the kubevirt-virtctl package. Prerequisites Each host in your cluster must be registered with Red Hat Subscription Manager (RHSM) and have an active OpenShift Container Platform subscription. Procedure Enable the OpenShift Virtualization repository by using the subscription-manager CLI tool to run the following command: # subscription-manager repos --enable cnv-4.15-for-rhel-8-x86_64-rpms Install the kubevirt-virtctl package by running the following command: # yum install kubevirt-virtctl 3.2.2. virtctl commands The virtctl client is a command-line utility for managing OpenShift Virtualization resources. Note The virtual machine (VM) commands also apply to virtual machine instances (VMIs) unless otherwise specified. 3.2.2.1. virtctl information commands You use virtctl information commands to view information about the virtctl client. Table 3.1. Information commands Command Description virtctl version View the virtctl client and server versions. virtctl help View a list of virtctl commands. virtctl <command> -h|--help View a list of options for a specific command. virtctl options View a list of global command options for any virtctl command. 3.2.2.2. VM information commands You can use virtctl to view information about virtual machines (VMs) and virtual machine instances (VMIs). Table 3.2. VM information commands Command Description virtctl fslist <vm_name> View the file systems available on a guest machine. virtctl guestosinfo <vm_name> View information about the operating systems on a guest machine. virtctl userlist <vm_name> View the logged-in users on a guest machine. 3.2.2.3. VM manifest creation commands You can use virtctl create commands to create manifests for virtual machines, instance types, and preferences. Table 3.3. VM manifest creation commands Command Description virtctl create vm Create a VirtualMachine (VM) manifest. virtctl create vm --name <vm_name> Create a VM manifest, specifying a name for the VM. virtctl create vm --instancetype <instancetype_name> Create a VM manifest that uses an existing cluster-wide instance type. virtctl create vm --instancetype=virtualmachineinstancetype/<instancetype_name> Create a VM manifest that uses an existing namespaced instance type. virtctl create instancetype --cpu <cpu_value> --memory <memory_value> --name <instancetype_name> Create a manifest for a cluster-wide instance type. virtctl create instancetype --cpu <cpu_value> --memory <memory_value> --name <instancetype_name> --namespace <namespace_value> Create a manifest for a namespaced instance type. virtctl create preference --name <preference_name> Create a manifest for a cluster-wide VM preference, specifying a name for the preference. virtctl create preference --namespace <namespace_value> Create a manifest for a namespaced VM preference. 3.2.2.4. VM management commands You use virtctl virtual machine (VM) management commands to manage and migrate virtual machines (VMs) and virtual machine instances (VMIs). Table 3.4. VM management commands Command Description virtctl start <vm_name> Start a VM. virtctl start --paused <vm_name> Start a VM in a paused state. This option enables you to interrupt the boot process from the VNC console. virtctl stop <vm_name> Stop a VM. virtctl stop <vm_name> --grace-period 0 --force Force stop a VM. This option might cause data inconsistency or data loss. virtctl pause vm <vm_name> Pause a VM. The machine state is kept in memory. virtctl unpause vm <vm_name> Unpause a VM. virtctl migrate <vm_name> Migrate a VM. virtctl migrate-cancel <vm_name> Cancel a VM migration. virtctl restart <vm_name> Restart a VM. 3.2.2.5. VM connection commands You use virtctl connection commands to expose ports and connect to virtual machines (VMs) and virtual machine instances (VMIs). Table 3.5. VM connection commands Command Description virtctl console <vm_name> Connect to the serial console of a VM. virtctl expose vm <vm_name> --name <service_name> --type <ClusterIP|NodePort|LoadBalancer> --port <port> Create a service that forwards a designated port of a VM and expose the service on the specified port of the node. Example: virtctl expose vm rhel9_vm --name rhel9-ssh --type NodePort --port 22 virtctl scp -i <ssh_key> <file_name> <user_name>@<vm_name> Copy a file from your machine to a VM. This command uses the private key of an SSH key pair. The VM must be configured with the public key. virtctl scp -i <ssh_key> <user_name@<vm_name>:<file_name> . Copy a file from a VM to your machine. This command uses the private key of an SSH key pair. The VM must be configured with the public key. virtctl ssh -i <ssh_key> <user_name>@<vm_name> Open an SSH connection with a VM. This command uses the private key of an SSH key pair. The VM must be configured with the public key. virtctl vnc <vm_name> Connect to the VNC console of a VM. You must have virt-viewer installed. virtctl vnc --proxy-only=true <vm_name> Display the port number and connect manually to a VM by using any viewer through the VNC connection. virtctl vnc --port=<port-number> <vm_name> Specify a port number to run the proxy on the specified port, if that port is available. If a port number is not specified, the proxy runs on a random port. 3.2.2.6. VM export commands Use virtctl vmexport commands to create, download, or delete a volume exported from a VM, VM snapshot, or persistent volume claim (PVC). Certain manifests also contain a header secret, which grants access to the endpoint to import a disk image in a format that OpenShift Virtualization can use. Table 3.6. VM export commands Command Description virtctl vmexport create <vmexport_name> --vm|snapshot|pvc=<object_name> Create a VirtualMachineExport custom resource (CR) to export a volume from a VM, VM snapshot, or PVC. --vm : Exports the PVCs of a VM. --snapshot : Exports the PVCs contained in a VirtualMachineSnapshot CR. --pvc : Exports a PVC. Optional: --ttl=1h specifies the time to live. The default duration is 2 hours. virtctl vmexport delete <vmexport_name> Delete a VirtualMachineExport CR manually. virtctl vmexport download <vmexport_name> --output=<output_file> --volume=<volume_name> Download the volume defined in a VirtualMachineExport CR. --output specifies the file format. Example: disk.img.gz . --volume specifies the volume to download. This flag is optional if only one volume is available. Optional: --keep-vme retains the VirtualMachineExport CR after download. The default behavior is to delete the VirtualMachineExport CR after download. --insecure enables an insecure HTTP connection. virtctl vmexport download <vmexport_name> --<vm|snapshot|pvc>=<object_name> --output=<output_file> --volume=<volume_name> Create a VirtualMachineExport CR and then download the volume defined in the CR. virtctl vmexport download export --manifest Retrieve the manifest for an existing export. The manifest does not include the header secret. virtctl vmexport download export --manifest --vm=example Create a VM export for a VM example, and retrieve the manifest. The manifest does not include the header secret. virtctl vmexport download export --manifest --snap=example Create a VM export for a VM snapshot example, and retrieve the manifest. The manifest does not include the header secret. virtctl vmexport download export --manifest --include-secret Retrieve the manifest for an existing export. The manifest includes the header secret. virtctl vmexport download export --manifest --manifest-output-format=json Retrieve the manifest for an existing export in json format. The manifest does not include the header secret. virtctl vmexport download export --manifest --include-secret --output=manifest.yaml Retrieve the manifest for an existing export. The manifest includes the header secret and writes it to the file specified. 3.2.2.7. VM memory dump commands You can use the virtctl memory-dump command to output a VM memory dump on a PVC. You can specify an existing PVC or use the --create-claim flag to create a new PVC. Prerequisites The PVC volume mode must be FileSystem . The PVC must be large enough to contain the memory dump. The formula for calculating the PVC size is (VMMemorySize + 100Mi) * FileSystemOverhead , where 100Mi is the memory dump overhead. You must enable the hot plug feature gate in the HyperConverged custom resource by running the following command: USD oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv \ --type json -p '[{"op": "add", "path": "/spec/featureGates", \ "value": "HotplugVolumes"}]' Downloading the memory dump You must use the virtctl vmexport download command to download the memory dump: USD virtctl vmexport download <vmexport_name> --vm|pvc=<object_name> \ --volume=<volume_name> --output=<output_file> Table 3.7. VM memory dump commands Command Description virtctl memory-dump get <vm_name> --claim-name=<pvc_name> Save the memory dump of a VM on a PVC. The memory dump status is displayed in the status section of the VirtualMachine resource. Optional: --create-claim creates a new PVC with the appropriate size. This flag has the following options: --storage-class=<storage_class> : Specify a storage class for the PVC. --access-mode=<access_mode> : Specify ReadWriteOnce or ReadWriteMany . virtctl memory-dump get <vm_name> Rerun the virtctl memory-dump command with the same PVC. This command overwrites the memory dump. virtctl memory-dump remove <vm_name> Remove a memory dump. You must remove a memory dump manually if you want to change the target PVC. This command removes the association between the VM and the PVC, so that the memory dump is not displayed in the status section of the VirtualMachine resource. The PVC is not affected. 3.2.2.8. Hot plug and hot unplug commands You use virtctl to add or remove resources from running virtual machines (VMs) and virtual machine instances (VMIs). Table 3.8. Hot plug and hot unplug commands Command Description virtctl addvolume <vm_name> --volume-name=<datavolume_or_PVC> [--persist] [--serial=<label>] Hot plug a data volume or persistent volume claim (PVC). Optional: --persist mounts the virtual disk permanently on a VM. This flag does not apply to VMIs. --serial=<label> adds a label to the VM. If you do not specify a label, the default label is the data volume or PVC name. virtctl removevolume <vm_name> --volume-name=<virtual_disk> Hot unplug a virtual disk. virtctl addinterface <vm_name> --network-attachment-definition-name <net_attach_def_name> --name <interface_name> Hot plug a Linux bridge network interface. virtctl removeinterface <vm_name> --name <interface_name> Hot unplug a Linux bridge network interface. 3.2.2.9. Image upload commands You use the virtctl image-upload commands to upload a VM image to a data volume. Table 3.9. Image upload commands Command Description virtctl image-upload dv <datavolume_name> --image-path=</path/to/image> --no-create Upload a VM image to a data volume that already exists. virtctl image-upload dv <datavolume_name> --size=<datavolume_size> --image-path=</path/to/image> Upload a VM image to a new data volume of a specified requested size. 3.2.3. Deploying libguestfs by using virtctl You can use the virtctl guestfs command to deploy an interactive container with libguestfs-tools and a persistent volume claim (PVC) attached to it. Procedure To deploy a container with libguestfs-tools , mount the PVC, and attach a shell to it, run the following command: USD virtctl guestfs -n <namespace> <pvc_name> 1 1 The PVC name is a required argument. If you do not include it, an error message appears. 3.2.3.1. Libguestfs and virtctl guestfs commands Libguestfs tools help you access and modify virtual machine (VM) disk images. You can use libguestfs tools to view and edit files in a guest, clone and build virtual machines, and format and resize disks. You can also use the virtctl guestfs command and its sub-commands to modify, inspect, and debug VM disks on a PVC. To see a complete list of possible sub-commands, enter virt- on the command line and press the Tab key. For example: Command Description virt-edit -a /dev/vda /etc/motd Edit a file interactively in your terminal. virt-customize -a /dev/vda --ssh-inject root:string:<public key example> Inject an ssh key into the guest and create a login. virt-df -a /dev/vda -h See how much disk space is used by a VM. virt-customize -a /dev/vda --run-command 'rpm -qa > /rpm-list' See the full list of all RPMs installed on a guest by creating an output file containing the full list. virt-cat -a /dev/vda /rpm-list Display the output file list of all RPMs created using the virt-customize -a /dev/vda --run-command 'rpm -qa > /rpm-list' command in your terminal. virt-sysprep -a /dev/vda Seal a virtual machine disk image to be used as a template. By default, virtctl guestfs creates a session with everything needed to manage a VM disk. However, the command also supports several flag options if you want to customize the behavior: Flag Option Description --h or --help Provides help for guestfs . -n <namespace> option with a <pvc_name> argument To use a PVC from a specific namespace. If you do not use the -n <namespace> option, your current project is used. To change projects, use oc project <namespace> . If you do not include a <pvc_name> argument, an error message appears. --image string Lists the libguestfs-tools container image. You can configure the container to use a custom image by using the --image option. --kvm Indicates that kvm is used by the libguestfs-tools container. By default, virtctl guestfs sets up kvm for the interactive container, which greatly speeds up the libguest-tools execution because it uses QEMU. If a cluster does not have any kvm supporting nodes, you must disable kvm by setting the option --kvm=false . If not set, the libguestfs-tools pod remains pending because it cannot be scheduled on any node. --pull-policy string Shows the pull policy for the libguestfs image. You can also overwrite the image's pull policy by setting the pull-policy option. The command also checks if a PVC is in use by another pod, in which case an error message appears. However, once the libguestfs-tools process starts, the setup cannot avoid a new pod using the same PVC. You must verify that there are no active virtctl guestfs pods before starting the VM that accesses the same PVC. Note The virtctl guestfs command accepts only a single PVC attached to the interactive pod. 3.3. Web console overview The Virtualization section of the OpenShift Container Platform web console contains the following pages for managing and monitoring your OpenShift Virtualization environment. Table 3.10. Virtualization pages Page Description Overview page Manage and monitor the OpenShift Virtualization environment. Catalog page Create virtual machines from a catalog of templates. VirtualMachines page Create and manage virtual machines. Templates page Create and manage templates. InstanceTypes page Create and manage virtual machine instance types. Preferences page Create and manage virtual machine preferences. Bootable volumes page Create and manage DataSources for bootable volumes. MigrationPolicies page Create and manage migration policies for workloads. Checkups page Run network latency and storage checkups for virtual machines. Table 3.11. Key Icon Description Edit icon Link icon Start VM icon Stop VM icon Restart VM icon Pause VM icon Unpause VM icon 3.3.1. Overview page The Overview page displays resources, metrics, migration progress, and cluster-level settings. Example 3.1. Overview page Element Description Download virtctl Download the virtctl command line tool to manage resources. Overview tab Resources, usage, alerts, and status. Top consumers tab Top consumers of CPU, memory, and storage resources. Migrations tab Status of live migrations. Settings tab The Settings tab contains the Cluster tab, User tab, and Preview features tab. Settings Cluster tab OpenShift Virtualization version, update status, live migration, templates project, load balancer service, guest management, resource management, and SCSI persistent reservation settings. Settings User tab Public SSH keys, user permissions, and welcome information settings. Settings Preview features Enable select preview features in the web console. Features in this tab change frequently. Preview features are disabled by default and must not be enabled in production environments. 3.3.1.1. Overview tab The Overview tab displays resources, usage, alerts, and status. Example 3.2. Overview tab Element Description Getting started resources card Quick Starts tile: Learn how to create, import, and run virtual machines with step-by-step instructions and tasks. Feature highlights tile: Read the latest information about key virtualization features. Related operators tile: Install Operators such as the Kubernetes NMState Operator or the OpenShift Data Foundation Operator. Memory tile Memory usage, with a chart showing the last 1 day's trend. Storage tile Storage usage, with a chart showing the last 1 day's trend. vCPU usage tile vCPU usage, with a chart showing the last 1 day's trend. VirtualMachines tile Number of virtual machines, with a chart showing the last 1 day's trend. Alerts tile OpenShift Virtualization alerts, grouped by severity. VirtualMachine statuses tile Number of virtual machines, grouped by status. VirtualMachines per resource chart Number of virtual machines created from templates and instance types. 3.3.1.2. Top consumers tab The Top consumers tab displays the top consumers of CPU, memory, and storage. Example 3.3. Top consumers tab Element Description View virtualization dashboard Link to Observe Dashboards , which displays the top consumers for OpenShift Virtualization. Time period list Select a time period to filter the results. Top consumers list Select the number of top consumers to filter the results. CPU chart Virtual machines with the highest CPU usage. Memory chart Virtual machines with the highest memory usage. Memory swap traffic chart Virtual machines with the highest memory swap traffic. vCPU wait chart Virtual machines with the highest vCPU wait periods. Storage throughput chart Virtual machines with the highest storage throughput usage. Storage IOPS chart Virtual machines with the highest storage input/output operations per second usage. 3.3.1.3. Migrations tab The Migrations tab displays the status of virtual machine migrations. Example 3.4. Migrations tab Element Description Time period list Select a time period to filter virtual machine migrations. VirtualMachineInstanceMigrations information table List of virtual machine migrations. 3.3.1.4. Settings tab The Settings tab displays cluster-wide settings. Example 3.5. Tabs on the Settings tab Tab Description Cluster tab OpenShift Virtualization version, update status, live migration, templates project, load balancer service, guest management, resource management, and SCSI persistent reservation settings. User tab Public SSH key management, user permissions, and welcome information settings. Preview features tab Enable select preview features in the web console. These features change frequently. 3.3.1.4.1. Cluster tab The Cluster tab displays the OpenShift Virtualization version and update status. You configure live migration and other settings on the Cluster tab. Example 3.6. Cluster tab Element Description Installed version OpenShift Virtualization version. Update status OpenShift Virtualization update status. Channel OpenShift Virtualization update channel. General Settings section Expand this section to configure the Live migration settings, the SSH configuration settings, and the Template project settings. General Settings Live Migration section Expand this section to configure live migration settings. General Settings Live Migration Max. migrations per cluster field Select the maximum number of live migrations per cluster. General Settings Live Migration Max. migrations per node field Select the maximum number of live migrations per node. General Settings Live Migration Live migration network list Select a dedicated secondary network for live migration. General Settings SSH Configuration SSH over LoadBalancer service switch Enable the creation of LoadBalancer services for SSH connections to VMs. You must configure a load balancer. General Settings SSH Configuration SSH over NodePort service switch Allow the creation of node port services for SSH connections to virtual machines. General Settings Template project section Expand this section to select a project for Red Hat templates. The default project is openshift . To store Red Hat templates in multiple projects, clone the template and then select a project for the cloned template. Guest Management Expand this section to configure the Automatic subscription of new RHEL VirtualMachines settings and the Enable guest system log access switch. Guest Management Automatic subscription of new RHEL VirtualMachines Expand this section to enable automatic subscription for Red Hat Enterprise Linux (RHEL) virtual machines and guest system log access. To enable this feature, you need cluster administrator permissions, an organization ID, and an activation key. Guest Management Automatic subscription of new RHEL VirtualMachines Activation Key field Enter the activation key. Guest Management Automatic subscription of new RHEL VirtualMachines Organization ID field Enter the organization ID. Guest Management Automatic subscription of new RHEL VirtualMachines Enable auto updates for RHEL VirtualMachines switch Enable the automatic pulling of updates from the RHEL repository. To enable this feature, you need an activation key and organization ID. Guest Management Enable guest system log access switch Enable access to the virtual machine's guest system log. Resource Management Expand this section to configure the Auto-compute CPU limits settings and the Kernel Samepage Merging (KSM) switch. Resource Management Auto-compute CPU limits Enable automatic computing CPU limits on projects containing labels. Resource Management Kernel Samepage Merging (KSM) Enable KSM for all nodes in the cluster. SCSI Persistent Reservation Expand this section to configure the Enable persistent reservation switch. SCSI Persistent Reservation Enable persistent reservation Enable SCSI reservation for disks. This option must be used only for cluster-aware applications. 3.3.1.4.2. User tab You view user permissions and manage public SSH keys and welcome information on the User tab. Example 3.7. User tab Element Description Manage SSH keys section Expand this section to add public SSH keys to a project. The keys are added automatically to all virtual machines that you subsequently create in the selected project. Permissions section Expand this section to view cluster-wide user permissions. Welcome information section Expand this section to show or hide the Welcome information dialog. 3.3.1.4.3. Preview features tab Enable select preview features in the web console. Features in this tab change frequently. 3.3.2. Catalog page You create a virtual machine from a template or instance type on the Catalog page. Example 3.8. Catalog page Element Description InstanceTypes tab Displays bootable volumes and instance types for creating a virtual machine. Template catalog tab Displays a catalog of templates for creating a virtual machine. 3.3.2.1. InstanceTypes tab You create a virtual machine from an instance type on the InstanceTypes tab. Element Description Add volume button Click to upload a volume or to use an existing persistent volume claim, volume snapshot, or data source. Volumes project field Project in which bootable volumes are stored. The default is openshift-virtualization-os-images . Filter field Filter boot sources by operating system or resource. Search field Search boot sources by name. Manage columns icon Select up to 9 columns to display in the table. Volume table Select a bootable volume for your virtual machine. Red Hat provided tab Select an instance type provided by Red Hat. User provided tab Select an instance type that you created on the InstanceType page. VirtualMachine details pane Displays the virtual machine settings. Name field Optional: Enter the virtual machine name. Storage class field Select a storage class. Public SSH key Click the edit icon to add a new or existing public SSH key. Dynamic SSH key injection switch Enable dynamic SSH key injection. Only RHEL supports dynamic SSH key injection. Start this VirtualMachine after creation checkbox Clear this checkbox to prevent the virtual machine from starting automatically. Create VirtualMachine button Creates a virtual machine. View YAML & CLI button Displays the YAML configuration file and the virtctl create command to create the virtual machine from the command line. 3.3.2.2. Template catalog tab You select a template on the Template catalog tab to create a virtual machine. Example 3.9. Template catalog tab Element Description Template project list Select the project in which Red Hat templates are located. By default, Red Hat templates are stored in the openshift project. You can edit the template project on the Overview page Settings tab Cluster tab . All items | Default templates | User templates Click All items to display all available templates, Default templates to display the default templates, and User templates to display the user created templates. Boot source available checkbox Select the checkbox to display templates with an available boot source. Operating system checkboxes Select checkboxes to display templates with selected operating systems. Workload checkboxes Select checkboxes to display templates with selected workloads. Search field Search templates by keyword. Template tiles Click a template tile to view template details and to create a virtual machine. 3.3.3. VirtualMachines page You create and manage virtual machines on the VirtualMachines page. Example 3.10. VirtualMachines page Element Description Create button Create a virtual machine from a template, volume, or YAML configuration file. Filter field Filter virtual machines by status, template, operating system, or node. Search field Search for virtual machines by name, label, or IP address. Manage columns icon Select up to 9 columns to display in the table. The Namespace column is displayed only when All Projects is selected from the Projects list. Virtual machines table List of virtual machines. Click the actions menu beside a virtual machine to select Stop , Restart , Pause , Clone , Migrate , Copy SSH command , Edit labels , Edit annotations , or Delete . If you select Stop , Force stop replaces Stop in the action menu. Use Force stop to initiate an immediate shutdown if the operating system becomes unresponsive. Click a virtual machine to navigate to the VirtualMachine details page. 3.3.3.1. VirtualMachine details page You configure a virtual machine on the Configuration tab of the VirtualMachine details page. Example 3.11. VirtualMachine details page Element Description Actions menu Click the Actions menu to select Stop , Restart , Pause , Clone , Migrate , Copy SSH command , Edit labels , Edit annotations , or Delete . If you select Stop , Force stop replaces Stop in the action menu. Use Force stop to initiate an immediate shutdown if the operating system becomes unresponsive. Overview tab Resource usage, alerts, disks, and devices. Metrics tab Memory, CPU, storage, network, and migration metrics. YAML tab Virtual machine YAML configuration file. Configuration tab Contains the Details , Storage , Network , Scheduling , SSH , Initial run , and Metadata tabs. Configuration Details tab Configure the VirtualMachine details of the VM. Configuration Storage tab Configure the storage of the VM. Configuration Network tab Configure the network of the VM. Configuration Scheduling tab Configure the schedule of a VM to run on specific nodes. Configuration SSH tab Configure the SSH settings of the VM. Configuration Initial run tab Configure the cloud-init settings for the VM, or the Sysprep settings if the VM is Windows. Configuration Metadata tab Configure label and annotation metadata of the VM. Events tab View list of virtual machine events. Console tab Open a console session to the virtual machine. Snapshots tab Create snapshots and restore virtual machines from snapshots. Diagnostics tab View status conditions and volume snapshot statuses. 3.3.3.1.1. Overview tab The Overview tab displays resource usage, alerts, and configuration information. Example 3.12. Overview tab Element Description Details tile General virtual machine information. Utilization tile CPU , Memory , Storage , and Network transfer charts. By default, Network transfer displays the sum of all networks. To view the breakdown for a specific network, click Breakdown by network . Hardware devices tile GPU and host devices. File systems tile File system information. This information is provided by the guest agent. Services tile List of services. Active users tile List of active users. Alerts tile OpenShift Virtualization alerts, grouped by severity. General tile Namespace , Node , VirtualMachineInstance , Pod , and Owner information. Snapshots tile Take snapshot and snapshots table. Network interfaces tile Network interfaces table. Disks tile Disks table. 3.3.3.1.2. Metrics tab The Metrics tab displays memory, CPU, network, storage, and migration usage charts, as well as live migration progress. Example 3.13. Metrics tab Element Description Time range list Select a time range to filter the results. Virtualization dashboard Link to the Workloads tab of the current project. Utilization Memory and CPU charts. Storage Storage total read/write and Storage IOPS total read/write charts. Network Network in , Network out , Network bandwidth , and Network interface charts. Select All networks or a specific network from the Network interface list. Migration Migration and KV data transfer rate charts. LiveMigration progress LiveMigration completion status. 3.3.3.1.3. YAML tab You configure the virtual machine by editing the YAML file on the YAML tab. Example 3.14. YAML tab Element Description Save button Save changes to the YAML file. Reload button Discard your changes and reload the YAML file. Cancel button Exit the YAML tab. Download button Download the YAML file to your local machine. 3.3.3.1.4. Configuration tab You configure scheduling, network interfaces, disks, and other options on the Configuration tab. Example 3.15. Tabs on the Configuration tab Element Description Search field Search configurations by keyword. Details tab Virtual machine details. Storage tab Configure the storage of the VM. Network tab Configure the network of the VM. Scheduling tab Configure the schedule of a VM to run on specific nodes. SSH tab Configure the SSH settings of the VM. Initial run tab Configure the cloud-init settings for the VM, or the Sysprep settings if the VM is Windows. Metadata tab Configure label and annotation metadata of the VM. 3.3.3.1.4.1. Details tab You manage the VM details on the Details tab. Example 3.16. Details tab Setting Description Description Click the edit icon to enter a description. Workload profile Click the edit icon to edit the workload profile. CPU | Memory Click the edit icon to edit the CPU | Memory request. Restart the virtual machine to apply the change. Hostname Hostname of the virtual machine. Restart the virtual machine to apply the change. Headless mode Enable headless mode. Restart the virtual machine to apply the change. Guest system log access Enable guest system log access. Hardware devices Manage GPU and host devices. Boot management Change the boot mode and order, and enable Start in pause mode . 3.3.3.1.4.2. Storage tab You manage the disks and environment of the VM on the Storage tab. Example 3.17. Storage tab Setting Description Add disk button Add a disk to the virtual machine. Filter field Filter by disk type. Search field Search for a disk by name. Mount Windows drivers disk checkbox Select to mount a virtio-win container disk as a CD-ROM to install VirtIO drivers. Disks table List of virtual machine disks. Click the actions menu beside a disk to select Edit or Detach . Add Config Map, Secret or Service Account Click the link and select a config map, secret, or service account from the resource list. 3.3.3.1.4.3. Network tab You manage network interfaces on the Network tab. Example 3.18. Network interfaces table Setting Description Add network interface button Add a network interface to the virtual machine. Filter field Filter by interface type. Search field Search for a network interface by name or by label. Network interface table List of network interfaces. Click the actions menu beside a network interface to select Edit or Delete . 3.3.3.1.4.4. Scheduling tab You configure virtual machines to run on specific nodes on the Scheduling tab. Restart the virtual machine to apply changes. Example 3.19. Scheduling tab Setting Description Node selector Click the edit icon to add a label to specify qualifying nodes. Tolerations Click the edit icon to add a toleration to specify qualifying nodes. Affinity rules Click the edit icon to add an affinity rule. Descheduler switch Enable or disable the descheduler. The descheduler evicts a running pod so that the pod can be rescheduled onto a more suitable node. This field is disabled if the virtual machine cannot be live migrated. Dedicated resources Click the edit icon to select Schedule this workload with dedicated resources (guaranteed policy) . Eviction strategy Click the edit icon to select LiveMigrate as the virtual machine eviction strategy. 3.3.3.1.4.5. SSH tab You configure the SSH details on the SSH tab. Example 3.20. SSH tab Setting Description SSH access section Expand this section to configure SSH using virtctl and SSH service type . Public SSH key section Expand this section to configure public SSH keys and dynamic SSH public key injection. 3.3.3.1.4.6. Initial run You manage cloud-init settings or configure Sysprep for Windows virtual machines on the Initial run tab. Restart the virtual machine to apply changes. Example 3.21. Initial run tab Element Description Cloud-init Click the edit icon to edit the cloud-init settings. Sysprep Click the edit icon to upload an Autounattend.xml or Unattend.xml answer file to automate Windows virtual machine setup. 3.3.3.1.4.7. Metadata tab You configure the labels and annotations on the Metadata tab. Example 3.22. Metadata tab Element Description Labels Click the edit icon to manage your labels. Annotations Click the edit icon to manage annotations. 3.3.3.1.5. Events tab The Events tab displays a list of virtual machine events. 3.3.3.1.6. Console tab You can open a console session to the virtual machine on the Console tab. Example 3.23. Console tab Element Description Guest login credentials section Expand Guest login credentials to view the credentials created with cloud-init . Click the copy icon to copy the credentials to the clipboard. Console list Select VNC console or Serial console . The Desktop viewer option is displayed for Windows virtual machines. You must install an RDP client on a machine on the same network. Send key list Select a key-stroke combination to send to the console. Paste button Paste a string from your clipboard to the VNC console. Disconnect button Disconnect the console connection. You must manually disconnect the console connection if you open a new console session. Otherwise, the first console session continues to run in the background. 3.3.3.1.7. Snapshots tab You can create a snapshot, create a copy of a virtual machine from a snapshot, restore a snapshot, edit labels or annotations, and edit or delete volume snapshots on the Snapshots tab. Example 3.24. Snapshots tab Element Description Take snapshot button Create a snapshot. Filter field Filter snapshots by status. Search field Search for snapshots by name or by label. Snapshot table List of snapshots Click the snapshot name to edit the labels or annotations. Click the actions menu beside a snapshot to select Create VirtualMachine , Restore , or Delete . 3.3.3.1.8. Diagnostics tab You view the status conditions and volume snapshot status on the Diagnostics tab. Example 3.25. Diagnostics tab Element Description Status conditions table Display a list of conditions that are reported for the virtual machine. Filter field Filter status conditions by category and condition. Search field Search status conditions by reason. Manage columns icon Select up to 9 columns to display in the table. Volume snapshot status table List of volumes, their snapshot enablement status, and reason. DataVolume status table List of data volumes and their Phase and Progress values. 3.3.4. Templates page You create, edit, and clone virtual machine templates on the VirtualMachine Templates page. Note You cannot edit a Red Hat template. However, you can clone a Red Hat template and edit it to create a custom template. Example 3.26. VirtualMachine Templates page Element Description Create Template button Create a template by editing a YAML configuration file. Filter field Filter templates by type, boot source, template provider, or operating system. Search field Search for templates by name or by label. Manage columns icon Select up to 9 columns to display in the table. The Namespace column is only displayed when All Projects is selected from the Projects list. Virtual machine templates table List of virtual machine templates. Click the actions menu beside a template to select Edit , Clone , Edit boot source , Edit boot source reference , Edit labels , Edit annotations , or Delete . You cannot edit a Red Hat provided template. You can clone the Red Hat template and then edit the custom template. 3.3.4.1. Template details page You view template settings and edit custom templates on the Template details page. Example 3.27. Template details page Element Description YAML switch Set to ON to view your live changes in the YAML configuration file. Actions menu Click the Actions menu to select Edit , Clone , Edit boot source , Edit boot source reference , Edit labels , Edit annotations , or Delete . Details tab Template settings and configurations. YAML tab YAML configuration file. Scheduling tab Scheduling configurations. Network interfaces tab Network interface management. Disks tab Disk management. Scripts tab Cloud-init, SSH key, and Sysprep management. Parameters tab Name and cloud user password management. 3.3.4.1.1. Details tab You configure a custom template on the Details tab. Example 3.28. Details tab Element Description Name Template name. Namespace Template namespace. Labels Click the edit icon to edit the labels. Annotations Click the edit icon to edit the annotations. Display name Click the edit icon to edit the display name. Description Click the edit icon to enter a description. Operating system Operating system name. CPU|Memory Click the edit icon to edit the CPU|Memory request. The number of CPUs is calculated by using the following formula: sockets * threads * cores . Machine type Template machine type. Boot mode Click the edit icon to edit the boot mode. Base template Name of the base template used to create this template. Created at Template creation date. Owner Template owner. Boot order Template boot order. Boot source Boot source availability. Provider Template provider. Support Template support level. GPU devices Click the edit icon to add a GPU device. Host devices Click the edit icon to add a host device. Headless mode Click the edit icon to set headless mode to ON and to disable VNC console. 3.3.4.1.2. YAML tab You configure a custom template by editing the YAML file on the YAML tab. Example 3.29. YAML tab Element Description Save button Save changes to the YAML file. Reload button Discard your changes and reload the YAML file. Cancel button Exit the YAML tab. Download button Download the YAML file to your local machine. 3.3.4.1.3. Scheduling tab You configure scheduling on the Scheduling tab. Example 3.30. Scheduling tab Setting Description Node selector Click the edit icon to add a label to specify qualifying nodes. Tolerations Click the edit icon to add a toleration to specify qualifying nodes. Affinity rules Click the edit icon to add an affinity rule. Descheduler switch Enable or disable the descheduler. The descheduler evicts a running pod so that the pod can be rescheduled onto a more suitable node. Dedicated resources Click the edit icon to select Schedule this workload with dedicated resources (guaranteed policy) . Eviction strategy Click the edit icon to select LiveMigrate as the virtual machine eviction strategy. 3.3.4.1.4. Network interfaces tab You manage network interfaces on the Network interfaces tab. Example 3.31. Network interfaces tab Setting Description Add network interface button Add a network interface to the template. Filter field Filter by interface type. Search field Search for a network interface by name or by label. Network interface table List of network interfaces. Click the actions menu beside a network interface to select Edit or Delete . 3.3.4.1.5. Disks tab You manage disks on the Disks tab. Example 3.32. Disks tab Setting Description Add disk button Add a disk to the template. Filter field Filter by disk type. Search field Search for a disk by name. Disks table List of template disks. Click the actions menu beside a disk to select Edit or Detach . 3.3.4.1.6. Scripts tab You manage the cloud-init settings, SSH keys, and Sysprep answer files on the Scripts tab. Example 3.33. Scripts tab Element Description Cloud-init Click the edit icon to edit the cloud-init settings. Public SSH key Click the edit icon to create a new secret or to attach an existing secret to a Linux virtual machine. Sysprep Click the edit icon to upload an Autounattend.xml or Unattend.xml answer file to automate Windows virtual machine setup. 3.3.4.1.7. Parameters tab You edit selected template settings on the Parameters tab. Example 3.34. Parameters tab Element Description NAME Set the name parameters for a virtual machine created from this template. CLOUD_USER_PASSWORD Set the cloud user password parameters for a virtual machine created from this template. 3.3.5. InstanceTypes page You view and manage virtual machine instance types on the InstanceTypes page. Example 3.35. VirtualMachineClusterInstancetypes page Element Description Create button Create an instance type by editing a YAML configuration file. Search field Search for an instance type by name or by label. Manage columns icon Select up to 9 columns to display in the table. The Namespace column is only displayed when All Projects is selected from the Projects list. Instance types table List of instance. Click the actions menu beside an instance type to select Clone or Delete . Click an instance type to view the VirtualMachineClusterInstancetypes details page. 3.3.5.1. VirtualMachineClusterInstancetypes details page You configure an instance type on the VirtualMachineClusterInstancetypes details page. Example 3.36. VirtualMachineClusterInstancetypes details page Element Description Details tab Configure an instance type by editing a form. YAML tab Configure an instance type by editing a YAML configuration file. Actions menu Select Edit labels , Edit annotations , Edit VirtualMachineClusterInstancetype , or Delete VirtualMachineClusterInstancetype . 3.3.5.1.1. Details tab You configure an instance type by editing a form on the Details tab. Example 3.37. Details tab Element Description Name VirtualMachineClusterInstancetype name. Labels Click the edit icon to edit the labels. Annotations Click the edit icon to edit the annotations. Created at Instance type creation date. Owner Instance type owner. 3.3.5.1.2. YAML tab You configure an instance type by editing the YAML file on the YAML tab. Example 3.38. YAML tab Element Description Save button Save changes to the YAML file. Reload button Discard your changes and reload the YAML file. Cancel button Exit the YAML tab. Download button Download the YAML file to your local machine. 3.3.6. Preferences page You view and manage virtual machine preferences on the Preferences page. Example 3.39. VirtualMachineClusterPreferences page Element Description Create button Create a preference by editing a YAML configuration file. Search field Search for a preference by name or by label. Manage columns icon Select up to 9 columns to display in the table. The Namespace column is only displayed when All Projects is selected from the Projects list. Preferences table List of preferences. Click the actions menu beside a preference to select Clone or Delete . Click a preference to view the VirtualMachineClusterPreference details page. 3.3.6.1. VirtualMachineClusterPreference details page You configure a preference on the VirtualMachineClusterPreference details page. Example 3.40. VirtualMachineClusterPreference details page Element Description Details tab Configure a preference by editing a form. YAML tab Configure a preference by editing a YAML configuration file. Actions menu Select Edit labels , Edit annotations , Edit VirtualMachineClusterPreference , or Delete VirtualMachineClusterPreference . 3.3.6.1.1. Details tab You configure a preference by editing a form on the Details tab. Example 3.41. Details tab Element Description Name VirtualMachineClusterPreference name. Labels Click the edit icon to edit the labels. Annotations Click the edit icon to edit the annotations. Created at Preference creation date. Owner Preference owner. 3.3.6.1.2. YAML tab You configure a preference type by editing the YAML file on the YAML tab. Example 3.42. YAML tab Element Description Save button Save changes to the YAML file. Reload button Discard your changes and reload the YAML file. Cancel button Exit the YAML tab. Download button Download the YAML file to your local machine. 3.3.7. Bootable volumes page You view and manage available bootable volumes on the Bootable volumes page. Example 3.43. Bootable volumes page Element Description Add volume button Add a bootable volume by completing a form or by editing a YAML configuration file. Filter field Filter bootable volumes by operating system and resource type. Search field Search for bootable volumes by name or by label. Manage columns icon Select up to 9 columns to display in the table. The Namespace column is only displayed when All Projects is selected from the Projects list. Bootable volumes table List of bootable volumes. Click the actions menu beside a bootable volume to select Edit , Remove from list , or Delete . Click a bootable volume to view the DataSource details page. 3.3.7.1. DataSource details page You configure the persistent volume claim (PVC) of a bootable volume on the DataSource details page. Example 3.44. DataSource details page Element Description Details tab Configure the PVC by editing a form. YAML tab Configure the PVC by editing a YAML configuration file. 3.3.7.1.1. Details tab You configure the persistent volume claim (PVC) of the bootable volume by editing a form on the Details tab. Example 3.45. Details tab Element Description Name Data source name. Namespace Data source namespace. Labels Click the edit icon to edit the labels. Annotations Click the edit icon to edit the annotations. Created at Data source creation date. Owner Data source owner. DataImportCron The DataImportCron object for the data source. Default Instance Type Default instance type for this data source. Preference The preferred VirtualMachine attribute values required to run a given workload. Conditions table Displays the type, status, last update, reason, and message for the data source. 3.3.7.1.2. YAML tab You configure the persistent volume claim of the bootable volume by editing the YAML file on the YAML tab. Example 3.46. YAML tab Element Description Save button Save changes to the YAML file. Reload button Discard your changes and reload the YAML file. Cancel button Exit the YAML tab. Download button Download the YAML file to your local machine. 3.3.8. MigrationPolicies page You manage migration policies for workloads on the MigrationPolicies page. Example 3.47. MigrationPolicies page Element Description Create MigrationPolicy Create a migration policy by entering configurations and labels in a form or by editing a YAML file. Search field Search for a migration policy by name or by label. Manage columns icon Select up to 9 columns to display in the table. The Namespace column is only displayed when All Projects is selected from the Projects list. MigrationPolicies table List of migration policies. Click the actions menu beside a migration policy to select Edit or Delete . Click a migration policy to view the MigrationPolicy details page. 3.3.8.1. MigrationPolicy details page You configure a migration policy on the MigrationPolicy details page. Example 3.48. MigrationPolicy details page Element Description Details tab Configure a migration policy by editing a form. YAML tab Configure a migration policy by editing a YAML configuration file. Actions menu Select Edit or Delete . 3.3.8.1.1. Details tab You configure a custom template on the Details tab. Example 3.49. Details tab Element Description Name Migration policy name. Description Migration policy description. Configurations Click the edit icon to update the migration policy configurations. Bandwidth per migration Bandwidth request per migration. For unlimited bandwidth, set the value to 0 . Auto converge When auto converge is enabled, the performance and availability of the virtual machines might be reduced to ensure that migration is successful. Post-copy Post-copy policy. Completion timeout Completion timeout value in seconds. Project labels Click Edit to edit the project labels. VirtualMachine labels Click Edit to edit the virtual machine labels. 3.3.8.1.2. YAML tab You configure the migration policy by editing the YAML file on the YAML tab. Example 3.50. YAML tab Element Description Save button Save changes to the YAML file. Reload button Discard your changes and reload the YAML file. Cancel button Exit the YAML tab. Download button Download the YAML file to your local machine. 3.3.9. Checkups page You run network latency and storage checkups for virtual machines on the Checkups page. Example 3.51. Checkups page Element Description Network latency tab Run network latency checkup. Storage tab Run storage checkup.

Commands:
tar -xvf <virtctl-version-distribution.arch>.tar.gz
chmod +x <path/virtctl-file-name>
echo USDPATH
export KUBECONFIG=/home/<user>/clusters/current/auth/kubeconfig
C:\> path
echo USDPATH
subscription-manager repos --enable cnv-4.15-for-rhel-8-x86_64-rpms
yum install kubevirt-virtctl
oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv --type json -p '[{"op": "add", "path": "/spec/featureGates", "value": "HotplugVolumes"}]'
virtctl vmexport download <vmexport_name> --vm|pvc=<object_name> --volume=<volume_name> --output=<output_file>
virtctl guestfs -n <namespace> <pvc_name> 1