This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.3.3. Installing OpenShift Virtualization using the CLI
Install OpenShift Virtualization to add virtualization functionality to your OpenShift Container Platform cluster. You can subscribe to and deploy the OpenShift Virtualization Operators by using the command line to apply manifests to your cluster.
3.3.1. Prerequisites 复制链接链接已复制到粘贴板!
- Install OpenShift Container Platform 4.5 on your cluster.
-
Install the OpenShift CLI (
oc
). -
Log in as a user with
cluster-admin
privileges.
Before you install OpenShift Virtualization, you must subscribe to the OpenShift Virtualization catalog. Subscribing gives the openshift-cnv
namespace access to the OpenShift Virtualization Operators.
To subscribe, configure Namespace
, OperatorGroup
, and Subscription
objects by applying a single manifest to your cluster.
Procedure
Create a YAML file that contains the following manifest:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the required
Namespace
,OperatorGroup
, andSubscription
objects for OpenShift Virtualization by running the following command:oc apply -f <file name>.yaml
$ oc apply -f <file name>.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You can deploy the OpenShift Virtualization Operator by using the oc
CLI.
Prerequisites
-
An active subscription to the OpenShift Virtualization catalog in the
openshift-cnv
namespace.
Procedure
Create a YAML file that contains the following manifest:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Deploy the OpenShift Virtualization Operator by running the following command:
oc apply -f <file name>.yaml
$ oc apply -f <file name>.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Ensure that OpenShift Virtualization deployed successfully by watching the
PHASE
of the ClusterServiceVersion (CSV) in theopenshift-cnv
namespace. Run the following command:watch oc get csv -n openshift-cnv
$ watch oc get csv -n openshift-cnv
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The following output displays if deployment was successful:
Example output
NAME DISPLAY VERSION REPLACES PHASE kubevirt-hyperconverged-operator.v2.4.9 OpenShift Virtualization 2.4.9 Succeeded
NAME DISPLAY VERSION REPLACES PHASE kubevirt-hyperconverged-operator.v2.4.9 OpenShift Virtualization 2.4.9 Succeeded
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3.4. Next steps 复制链接链接已复制到粘贴板!
You might want to additionally configure the following components:
- The KubeMacPool component provides a MAC address pool service for virtual machine NICs in designated namespaces. Enable a MAC address pool in a namespace by applying the KubeMacPool label to that namespace.
- The hostpath provisioner is a local storage provisioner designed for OpenShift Virtualization. If you want to configure local storage for virtual machines, you must enable the hostpath provisioner first.