Chapter 3. Container-native virtualization installation
3.1. 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.
3.2. 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.4 web console to subscribe to and deploy the container-native virtualization Operators.
3.2.1. Prerequisites
- OpenShift Container Platform 4.4
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/.
3.2.2. Subscribing to the container-native virtualization catalog
Before you install container-native virtualization, subscribe to the container-native virtualization catalog from the OpenShift Container Platform web console. Subscribing gives the openshift-cnv
namespace access to the container-native virtualization Operators.
Procedure
- Open a browser window and log in to the OpenShift Container Platform web console.
-
Navigate to the Operators
OperatorHub page. - Search for OpenShift Virtualization and then select it.
- Read the information about the Operator and click Install.
On the Create Operator Subscription page:
For Installed Namespace, ensure that the Operator recommended namespace option is selected. This installs the Operator in the mandatory
openshift-cnv
namespace, which is automatically created if it does not exist.WarningAttempting to install the container-native virtualization Operator in a namespace other than
openshift-cnv
causes the installation to fail.- Select 2.3 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
openshift-cnv
namespace.On the Installed Operators screen, the Status displays Succeeded when container-native virtualization finishes installation.
3.2.3. Deploying container-native virtualization
Create the CNV Operator Deployment custom resource to deploy container-native virtualization.
Prerequisites
-
An active subscription to the container-native virtualization catalog in the
openshift-cnv
namespace.
Procedure
-
Navigate to the Operators
Installed Operators page. - Click OpenShift Virtualization.
Click the CNV Operator Deployment tab and click Create HyperConverged Cluster.
WarningTo avoid deployment errors, do not rename the custom resource. Before you proceed to the next step, ensure that the custom resource is named the default
kubevirt-hyperconverged
.-
View the YAML to ensure that
BareMetalPlatform: true
. If necessary, change the value fromfalse
totrue
before continuing. - 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.
3.3. 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.
3.3.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.3-for-rhel-8-x86_64-rpms
-
Red Hat Enterprise Linux 7 repository:
rhel-7-server-cnv-2.3-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>
3.3.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.
3.4. Uninstalling container-native virtualization
You can uninstall container-native virtualization by using the OpenShift Container Platform web console.
3.4.1. Prerequisites
- You must have container-native virtualization 2.3 installed.
You must delete all virtual machines, virtual machine instances, and DataVolumes.
ImportantAttempting to uninstall container-native virtualization without deleting these objects results in failure.
3.4.2. Deleting the CNV Operator Deployment custom resource
To uninstall container-native virtualization, you must first delete the CNV Operator Deployment custom resource.
Prerequisites
- An active CNV 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 OpenShift Virtualization.
- Click the CNV Operator Deployment tab.
- Click the Options menu in the row containing the kubevirt-hyperconverged custom resource. In the expanded menu, click Delete HyperConverged Cluster.
- 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 resources by running the following command:
$ oc delete apiservices v1alpha3.subresources.kubevirt.io -n openshift-cnv
3.4.3. Deleting the catalog subscription
To finish uninstalling container-native virtualization, delete your catalog subscription.
Prerequisites
- An active subscription to the container-native virtualization catalog.
Procedure
-
Navigate to the Operators
OperatorHub page. - Search for OpenShift Virtualization and then select it.
- Click Uninstall.
You can now delete the openshift-cnv
namespace.
3.4.4. 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.