About container-native virtualization

What you can do with container-native virtualization

Container-native virtualization is an add-on to OpenShift Container Platform that allows you to run and manage virtual machine workloads alongside container workloads.

Container-native virtualization adds new objects into your OpenShift Container Platform cluster via Kubernetes custom resources to enable virtualization tasks. These tasks include:

  • Creating and managing Linux and Windows virtual machines

  • Connecting to virtual machines through a variety of consoles and CLI tools

  • Importing and cloning existing virtual machines

  • Managing network interface controllers and storage disks attached to virtual machines

  • Live migrating virtual machines between nodes

An enhanced web console provides a graphical portal to manage these virtualized resources alongside the OpenShift Container Platform cluster containers and infrastructure.

Container-native virtualization support

container-native virtualization is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see https://access.redhat.com/support/offerings/techpreview/.

New and changed features

Web console improvements

  • The OpenShift Container Platform dashboard captures high-level information about clusters. From the OpenShift Container Platform web console, access the dashboard by clicking Home → Dashboards → Overview. Note that virtual machines are no longer listed in the web console project overview. Virtual machines are now listed within the Cluster Inventory dashboard card.

Other improvements

  • After you install container-native virtualization, MAC pool manager automatically starts. If you define a secondary NIC without specifying the MAC address, the MAC pool manager allocates a unique MAC address to the NIC.

    If you define a secondary NIC with a specific MAC address, it is possible that the MAC address might conflict with another NIC in the cluster.

Resolved issues

  • Previously, if you used the web console to create a virtual machine template that had the same name as an existing virtual machine, the operation failed. This resulted in the message Name is already used by another virtual machine. This issue is fixed in container-native virtualization 2.1. (BZ#1717802)

  • Previously, if you created a virtual machine with the Pod network connected in bridge mode and used a cloud-init disk, the virtual machine lost its network connectivity after being restarted. This issue is fixed in container-native virtualization 2.1. (BZ#1708680)

Known issues

  • When creating the KubeVirt HyperConverged Cluster Operator Deployment custom resource during container-native virtualization installation, a YAML file is displayed with an incorrect value. The file resembles the following example:

    apiVersion: hco.kubevirt.io/v1alpha1
    kind: HyperConverged
    metadata:
      name: kubevirt-hyperconverged
      namespace: openshift-cnv
    spec:
      BareMetalPlatform: 'false' (1)
    1 The single quotation marks around the word 'false' are incorrect. You must edit the file so that the line reads BareMetalPlatform: false before you click Create. If the quotation marks are not removed, deployment is not successful. (BZ#1767167)
  • When adding a disk to a virtual machine via the Disks tab in the web console, the added disk always has a Filesystem volumeMode, regardless of the volumeMode set in the kubevirt-storage-class-default ConfigMap. (BZ#1753688)

  • After migration, a virtual machine is assigned a new IP address. However, the commands oc get vmi and oc describe vmi still generate output containing the obsolete IP address. (BZ#1686208)

    • As a workaround, view the correct IP address by running the following command:

      $ oc get pod -o wide
  • The virtual machines wizard does not load for users without administrator privileges. This issue is caused by missing permissions that allow users to load network attachment definitions. (BZ#1743985)

    • As a workaround, provide the user with permissions to load the network attachment definitions.

      1. Define ClusterRole and ClusterRoleBinding objects to the YAML configuration file, using the following examples:

        apiVersion: rbac.authorization.k8s.io/v1
        kind: ClusterRole
        metadata:
         name: cni-resources
        rules:
        - apiGroups: ["k8s.cni.cncf.io"]
         resources: ["*"]
         verbs: ["*"]
        apiVersion: rbac.authorization.k8s.io/v1
        kind: ClusterRoleBinding
        metadata:
          name: <role-binding-name>
        roleRef:
          apiGroup: rbac.authorization.k8s.io
          kind: ClusterRole
          name: cni-resources
        subjects:
        - kind: User
          name: <user to grant the role to>
          namespace: <namespace of the user>
      2. As a cluster-admin user, run the following command to create the ClusterRole and ClusterRoleBinding objects you defined:

        $ oc create -f <filename>.yaml
  • When navigating to the Virtual Machines Console tab, sometimes no content is displayed. As a workaround, use the serial console. (BZ#1753606)

  • When you attempt to list all instances of the container-native virtualization operator from a browser, you receive a 404 (page not found) error. (BZ#1757526)

    • As a workaround, run the following command:

      $ oc get pods -n openshift-cnv | grep operator
  • Some resources are improperly retained when removing container-native virtualization. You must manually remove these resources in order to reinstall container-native virtualization. (BZ#1712429), (BZ#1757705)

  • If a virtual machine uses guaranteed CPUs, it will not be scheduled, because the label cpumanager=true is not automatically set on nodes. As a workaround, remove the CPUManager entry from the kubevirt-config ConfigMap. Then, manually label the nodes with cpumanager=true before running virtual machines with guaranteed CPUs on your cluster. (BZ#1718944)

  • Live migration fails when nodes have different CPU models. Even in cases where nodes have the same physical CPU model, differences introduced by microcode updates have the same effect. This is because the default settings trigger host CPU passthrough behavior, which is incompatible with live migration. (BZ#1760028)

    • As a workaround, set the default CPU model in the kubevirt-config ConfigMap, as shown in the following example:

      You must make this change before starting the virtual machines that support live migration.

      1. Open the kubevirt-config ConfigMap for editing by running the following command:

        $ oc edit configmap kubevirt-config -n openshift-cnv
      2. Edit the ConfigMap:

        kind: ConfigMap
        metadata:
          name: kubevirt-config
        data:
          default-cpu-model: "<cpu-model>" (1)
        1 Replace <cpu-model> with the actual CPU model value. You can determine this value by running oc describe node <node> for all nodes and looking at the cpu-model-<name> labels. Select the CPU model that is present on all of your nodes.
  • The container-native virtualization upgrade process occasionally fails due to an interruption from the Operator Lifecycle Manager (OLM). This issue is caused by the limitations associated with using a declarative API to track the state of container-native virtualization Operators. Enabling automatic updates during installation decreases the risk of encountering this issue. (BZ#1759612)

  • Container-native virtualization cannot reliably identify node drains that are triggered by running either oc adm drain or kubectl drain. Do not run these commands on the nodes of any clusters where container-native virtualization is deployed. The nodes might not drain if there are virtual machines running on top of them. The current solution is to put nodes into maintenance. (BZ#1707427)