3.2. Using the 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 or later, Linux, Windows, and MacOS operating systems, you can download and install the virtctl binary file.
To install virtctl on RHEL 8, you can enable the OpenShift Virtualization repository and then install the kubevirt-virtctl RPM package.
3.2.1.1. Installing the virtctl binary on RHEL 9 or later, Linux, Windows, or macOS 링크 복사링크가 클립보드에 복사되었습니다!
You can download the virtctl binary by using the OpenShift Container Platform web console and then install it on Red Hat Enterprise Linux (RHEL) 9 or later, Linux, Windows, or macOS.
Procedure
-
Navigate to the Virtualization
Overview page in the web console. -
Click the Download virtctl link to download the
virtctlbinary for your operating system. Install
virtctl:For RHEL and other Linux operating systems:
Decompress the archive file:
$ tar -xvf <virtctl-version-distribution.arch>.tar.gzRun the following command to make the
virtctlbinary executable:$ chmod +x <path/virtctl-file-name>Move the
virtctlbinary to a directory in yourPATHenvironment variable.You can check your path by running the following command:
$ echo $PATHSet the
KUBECONFIGenvironment variable:$ export KUBECONFIG=/home/<user>/clusters/current/auth/kubeconfig
For Windows:
- Decompress the archive file.
-
Navigate the extracted folder hierarchy and double-click the
virtctlexecutable file to install the client. Move the
virtctlbinary to a directory in yourPATHenvironment variable.You can check your path by running the following command:
C:\> path
For macOS:
- Decompress the archive file.
Move the
virtctlbinary to a directory in yourPATHenvironment variable.You can check your path by running the following command:
echo $PATH
3.2.1.2. Installing the virtctl RPM package on RHEL 8 링크 복사링크가 클립보드에 복사되었습니다!
You can install the virtctl RPM package on Red Hat Enterprise Linux (RHEL) 8 by enabling the OpenShift Virtualization repository and then installing the kubevirt-virtctl RPM 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-managerCLI tool to run the following command:# subscription-manager repos --enable cnv-4.19-for-rhel-8-x86_64-rpmsInstall the
kubevirt-virtctlRPM package by running the following command:# yum install kubevirt-virtctl