Chapter 1. Container-native virtualization installation
1.1. About container-native virtualization
Learn about container-native virtualization’s capabilities and support scope.
1.1.1. 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.
1.1.2. 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/.
1.2. Configuring your cluster for container-native virtualization
To obtain an evaluation version of OpenShift Container Platform, download a trial from the OpenShift Container Platform home page.
Container-native virtualization works with OpenShift Container Platform by default, however the following installation configurations are recommended:
- The OpenShift Container Platform cluster is installed on bare metal. Manage your Compute nodes in accordance with the number and size of the virtual machines to host in the cluster.
- Monitoring is configured in the cluster.
1.3. Installing container-native virtualization
Install container-native virtualization to add virtualization functionality to your OpenShift Container Platform cluster.
You can use the OpenShift Container Platform 4.2 web console to subscribe to and deploy the container-native virtualization Operators.
Prerequisites
- OpenShift Container Platform 4.2
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/.
1.3.1. Preparing to install container-native virtualization
Before installing container-native virtualization, create a namespace that is named openshift-cnv
.
Prerequisites
-
User with
cluster-admin
privileges
Procedure
-
From the OpenShift Container Platform web console, navigate to the Administration
Namespaces page. - Click Create Namespace.
-
In the Name field, type
openshift-cnv
. - Click Create.
1.3.1.1. Subscribing to the KubeVirt HyperConverged Cluster Operator catalog
Before you install container-native virtualization, subscribe to the KubeVirt HyperConverged Cluster Operator catalog from the OpenShift Container Platform web console. Subscribing gives the openshift-cnv
namespace access to the container-native virtualization Operators.
Prerequisites
-
Create a namespace that is named
openshift-cnv
.
Procedure
- Open a browser window and log in to the OpenShift Container Platform web console.
-
Navigate to the Operators
OperatorHub page. - Locate the KubeVirt HyperConverged Cluster Operator and then select it.
- Read the information about the Operator and click Install.
On the Create Operator Subscription page:
Select A specific namespace on the cluster from the Installation Mode list and choose the
openshift-cnv
namespace.Warning-
All namespaces on the cluster (default) installs the Operator in the default
openshift-operators
namespace to watch and be made available to all namespaces in the cluster. This option is not supported for use with container-native virtualization. You must only install the Operator in theopenshift-cnv
namespace.
-
All namespaces on the cluster (default) installs the Operator in the default
- Select 2.1 from the list of available Update Channel options.
- For Approval Strategy, ensure that Automatic, which is the default value, is selected. Container-native virtualization automatically updates when a new z-stream release is available.
- Click Subscribe to make the Operator available to the selected namespaces on this OpenShift Container Platform cluster.
1.3.2. Deploying container-native virtualization
After subscribing to the KubeVirt HyperConverged Cluster Operator catalog, create the KubeVirt HyperConverged Cluster Operator Deployment custom resource to deploy container-native virtualization.
Prerequisites
-
An active subscription to the KubeVirt HyperConverged Cluster Operator catalog in the
openshift-cnv
namespace
Procedure
-
Navigate to the Operators
Installed Operators page. - Click KubeVirt HyperConverged Cluster Operator.
Click the KubeVirt HyperConverged Cluster Operator Deployment tab and click Create HyperConverged.
After you click Create HyperConverged, a YAML file is displayed. Remove the single quotation marks around the word
'false'
. This is a workaround for the issue reported in BZ#1767167.When it is initially displayed, the YAML file resembles the following example:
apiVersion: hco.kubevirt.io/v1alpha1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: BareMetalPlatform: 'false' 1
- 1
- Ensure that this line reads
BareMetalPlatform: false
before proceeding to the next step.
- Click Create to launch container-native virtualization.
-
Navigate to the Workloads
Pods page and monitor the container-native virtualization Pods until they are all Running. After all the Pods display the Running state, you can access container-native virtualization.
1.4. Installing the virtctl
client
The virtctl
client is a command-line utility for managing container-native virtualization resources.
Install the client to your system by enabling the container-native virtualization repository and installing the kubevirt-virtctl
package.
1.4.1. Enabling container-native virtualization repositories
Red Hat offers container-native virtualization repositories for both Red Hat Enterprise Linux 8 and Red Hat Enterprise Linux 7:
-
Red Hat Enterprise Linux 8 repository:
cnv-2.1-for-rhel-8-x86_64-rpms
-
Red Hat Enterprise Linux 7 repository:
rhel-7-server-cnv-2.1-rpms
The process for enabling the repository in subscription-manager
is the same in both platforms.
Procedure
Use
subscription manager
to enable the appropriate container-native virtualization repository for your system:# subscription-manager repos --enable <repository>
1.4.2. Installing the virtctl
client
Install the virtctl
client from the kubevirt-virtctl
package.
Procedure
Install the
kubevirt-virtctl
package:# yum install kubevirt-virtctl
See also: Using the CLI tools for container-native virtualization.
1.5. Upgrading container-native virtualization
You enable automatic updates during container-native virtualization installation. Learn what to expect and how you can check the status of an update in progress.
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/.
1.5.1. About upgrading container-native virtualization
If you enabled automatic updates when you installed container-native virtualization, you receive updates as they become available.
Additional information
-
In container-native virtualization version 2.1, only z-stream updates are available. For example, container-native virtualization 2.1.0
container-native virtualization 2.1.1 - Updates are delivered via the Marketplace Operator, which is deployed during OpenShift Container Platform installation. The Marketplace Operator makes external Operators available to your cluster.
Upgrading does not interrupt virtual machine workloads.
Virtual machine Pods are not restarted or migrated during an upgrade. If you need to update the
virt-launcher
Pod, you must restart or live migrate the virtual machine.NoteEach virtual machine has a
virt-launcher
Pod that runs the virtual machine instance. Thevirt-launcher
Pod runs an instance oflibvirt
, which is used to manage the virtual machine process.
- Upgrading does not interrupt network connections.
- DataVolumes and their associated PersistentVolumeClaims are preserved during upgrade.
- The amount of time an update takes to complete depends on your network connection. Most automatic updates complete within fifteen minutes.
1.5.2. Monitoring upgrade status
The best way to monitor container-native virtualization upgrade status is to watch the ClusterServiceVersion (CSV) PHASE
. You can also monitor the CSV conditions in the web console or by running the command provided here.
The PHASE
and conditions values are approximations that are based on available information.
Prerequisites
-
Access to the cluster as a user with the
cluster-admin
role. -
Install the OpenShift Command-line Interface (CLI), commonly known as
oc
.
Procedure
Run the following command:
$ oc get csv
Review the output, checking the
PHASE
field. For example:VERSION REPLACES PHASE 2.1.1 kubevirt-hyperconverged-operator.v2.1.0 Installing 2.1.0 Replacing
Optional: Monitor the aggregated status of all container-native virtualization component conditions by running the following command:
$ oc get hco -n openshift-cnv hyperconverged-cluster \ -o=jsonpath='{range .status.conditions[*]}{.type}{"\t"}{.status}{"\t"}{.message}{"\n"}{end}'
A successful upgrade results in the following output:
ReconcileComplete True Reconcile completed successfully Available True Reconcile completed successfully Progressing False Reconcile completed successfully Degraded False Reconcile completed successfully Upgradeable True Reconcile completed successfully
Additional information
1.6. Uninstalling container-native virtualization
You can uninstall container-native virtualization by using the OpenShift Container Platform web console.
Prerequisites
- Container-native virtualization 2.1
1.6.1. Deleting the KubeVirt HyperConverged custom resource
To uninstall container-native virtualization, you must first delete the KubeVirt HyperConverged Cluster Operator Deployment custom resource.
Prerequisites
- An active KubeVirt HyperConverged Cluster Operator Deployment custom resource
Procedure
-
From the OpenShift Container Platform web console, select
openshift-cnv
from the Projects list. -
Navigate to the Operators
Installed Operators page. - Click KubeVirt HyperConverged Cluster Operator.
- Click the KubeVirt HyperConverged Cluster Operator Deployment tab.
- Click the Options menu in the row containing the hyperconverged-cluster custom resource. In the expanded menu, click Delete HyperConverged.
- Click Delete in the confirmation window.
-
Navigate to the Workloads
Pods page to verify that only the Operator Pods are running. Open a terminal window and clean up the remaining KubeVirt resources by running the following command:
$ oc delete apiservices v1alpha3.subresources.kubevirt.io -n openshift-cnv
NoteBecause some KubeVirt resources are currently improperly retained, you must manually remove them. These resources will be removed automatically after (BZ1712429) is resolved.
1.6.2. Deleting the KubeVirt HyperConverged Cluster Operator catalog subscription
To finish uninstalling container-native virtualization, uninstall the KubeVirt HyperConverged Cluster Operator subscription.
Prerequisites
- An active KubeVirt HyperConverged Cluster Operator catalog subscription
Procedure
-
Navigate to the Catalog
OperatorHub page. - Locate the KubeVirt HyperConverged Cluster Operator and then select it.
- Click Uninstall.
You can now delete the openshift-cnv
namespace.
1.6.3. Deleting a namespace using the web console
You can delete a namespace by using the OpenShift Container Platform web console.
If you do not have permissions to delete the namespace, the Delete Namespace option is not available.
Procedure
-
Navigate to Administration
Namespaces. - Locate the namespace that you want to delete in the list of namespaces.
- On the far right side of the namespace listing, select Delete Namespace from the Options menu .
- When the Delete Namespace pane opens, enter the name of the namespace that you want to delete in the field.
- Click Delete.