Skip to content

Commit d2112a5

Browse files
committed
Update virtctl commands
Signed-off-by: Avital Pinnick <[email protected]>
1 parent 168dcac commit d2112a5

12 files changed

+86
-110
lines changed

_topic_maps/_topic_map.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ Topics:
542542
File: bare-metal-configuration
543543
- Name: Configuring multi-architecture compute machines on an OpenShift cluster
544544
Distros: openshift-enterprise
545-
File: multi-architecture-configuration
545+
File: multi-architecture-configuration
546546
- Name: Enabling encryption on a vSphere cluster
547547
File: vsphere-post-installation-encryption
548548
- Name: Machine configuration tasks
@@ -2290,7 +2290,7 @@ Topics:
22902290
File: nodes-cma-autoscaling-custom-trigger
22912291
- Name: Understanding the custom metrics autoscaler trigger authentications
22922292
File: nodes-cma-autoscaling-custom-trigger-auth
2293-
- Name: Pausing the custom metrics autoscaler
2293+
- Name: Pausing the custom metrics autoscaler
22942294
File: nodes-cma-autoscaling-custom-pausing
22952295
- Name: Gathering audit logs
22962296
File: nodes-cma-autoscaling-custom-audit-log
@@ -3632,8 +3632,6 @@ Topics:
36323632
- Name: Installing OKD Virtualization using the CLI
36333633
File: installing-virt-cli
36343634
Distros: openshift-origin
3635-
- Name: Installing the virtctl client
3636-
File: virt-installing-virtctl
36373635
- Name: Uninstalling OpenShift Virtualization
36383636
File: uninstalling-virt
36393637
Distros: openshift-enterprise
@@ -3648,7 +3646,7 @@ Topics:
36483646
Distros: openshift-origin
36493647
- Name: Security policies
36503648
File: virt-security-policies
3651-
- Name: Using the CLI tools
3649+
- Name: Using the virtctl and libguestfs CLI tools
36523650
File: virt-using-the-cli-tools
36533651
- Name: Virtual machines
36543652
Dir: virtual_machines

modules/virt-about-libguestfs-tools-virtctl-guestfs.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
//
33
// * virt/virt-using-the-cli-tools.adoc
44

5+
:_content-type: REFERENCE
56
[id="virt-about-libguestfs-tools-virtctl-guestfs_{context}"]
6-
= Libguestfs tools and virtctl guestfs
7+
= Libguestfs and virtctl guestfs commands
78

89
`Libguestfs` tools help you access and modify virtual machine (VM) disk images. You can use `libguestfs` tools to view and edit files in a guest, clone and build virtual machines, and format and resize disks.
910

modules/virt-creating-pvc-with-virtctl-guestfs.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
:_content-type: PROCEDURE
66
[id="virt-creating-pvc-with-virtctl-guestfs_{context}"]
7-
= Creating a container using virtctl guestfs
7+
= Deploying a libguestfs-tools container by using virtctl
88

99
You can use the `virtctl guestfs` command to deploy an interactive container with `libguestfs-tools` and a persistent volume claim (PVC) attached to it.
1010

modules/virt-installing-virtctl-client-yum.adoc

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,32 @@
44

55
:_content-type: PROCEDURE
66
[id="virt-installing-virtctl-client-yum_{context}"]
7-
= Installing the virtctl client using the yum utility
7+
= Installing virtctl on {op-system-base}
88

9-
Install the `virtctl` client from the `kubevirt-virtctl` package.
9+
You install the `virtctl` RPM on {op-system-base-full} by enabling the {VirtProductName} repository and installing the `kubevirt-virtctl` package.
1010

1111
.Prerequisites
1212

13-
* You enabled an {VirtProductName} repository on your {op-system-base-full} system.
13+
* Each host in your cluster must be registered with Red Hat Subscription Manager (RHSM) and have an active {product-title} subscription.
1414
1515
.Procedure
1616

17+
* Enable the appropriate {VirtProductName} repository for your operating system by using the `subscription-manager` CLI tool:
18+
19+
** {op-system-base} 9:
20+
+
21+
[source,terminal]
22+
----
23+
# subscription-manager repos --enable cnv-4.13-for-rhel-9-x86_64-rpms
24+
----
25+
26+
** {op-system-base} 8:
27+
+
28+
[source,terminal]
29+
----
30+
# subscription-manager repos --enable cnv-4.13-for-rhel-8-x86_64-rpms
31+
----
32+
1733
* Install the `kubevirt-virtctl` package:
1834
+
1935
[source,terminal]

modules/virt-installing-virtctl-client.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
:_content-type: PROCEDURE
66
[id="virt-installing-virtctl-client_{context}"]
7-
= Installing the virtctl client on Linux, Windows, and macOS
7+
= Installing virtctl on Linux, Windows, and macOS
88

9-
Download and install the `virtctl` client for your operating system.
9+
Download and install the `virtctl` binary for your operating system.
1010

1111
.Procedure
1212

13-
. Navigate to *Virtualization > Overview* in the {product-title} web console.
13+
. Navigate to *Virtualization -> Overview* page in the {product-title} web console.
1414

15-
. Click the *Download virtctl* link on the upper right corner of the page and download the `virtctl` client for your operating system.
15+
. Click the *Download virtctl* link to download the `virtctl` binary for your operating system.
1616

1717
. Install `virtctl`:
1818

modules/virt-openshift-client-commands.adoc

Lines changed: 0 additions & 38 deletions
This file was deleted.

modules/virt-virtctl-commands.adoc

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
The `virtctl` client is a command-line utility for managing {VirtProductName} resources.
1010

11-
Although the examples refer to virtual machines (VMs), you can use these commands with virtual machine instances (VMIs).
11+
[NOTE]
12+
====
13+
The virtual machine (VM) commands also apply to virtual machine instances unless otherwise specified.
14+
====
1215

1316
// apinnick: I recommend not breaking these sections into separate modules because of maintenance issues.
1417
// These sections will never be used independently.
@@ -38,7 +41,7 @@ You use `virtctl` information commands to view information about the `virtctl` c
3841
[id='vm-information-commands_{context}']
3942
== VM information commands
4043

41-
You can use `virtctl` to view information about VMs.
44+
You can use `virtctl` to view information about VMs and VMIs.
4245

4346
.VM information commands
4447
[width="100%",cols="1a,2a",options="header"]
@@ -57,7 +60,7 @@ You can use `virtctl` to view information about VMs.
5760
[id='vm-management-commands_{context}']
5861
== VM management commands
5962

60-
You use `virtctl` virtual machine (VM) management commands to manage VMs.
63+
You use `virtctl` virtual machine (VM) management commands to manage and migrate VMs and VMIs.
6164

6265
.VM management commands
6366
[width="100%",cols="1a,2a",options="header"]
@@ -78,7 +81,7 @@ You use `virtctl` virtual machine (VM) management commands to manage VMs.
7881
|`virtctl pause vm <vm_name>`
7982
|Pause a VM. The machine state is kept in memory.
8083

81-
|`virtctl unpause vm\|vmi <vm_name>`
84+
|`virtctl unpause vm <vm_name>`
8285
|Unpause a VM.
8386

8487
|`virtctl migrate <vm_name>`
@@ -88,10 +91,10 @@ You use `virtctl` virtual machine (VM) management commands to manage VMs.
8891
|Restart a VM.
8992
|===
9093

91-
[id='vm-and-vmi-connection-commands_{context}']
94+
[id='vm-connection-commands_{context}']
9295
== VM connection commands
9396

94-
You use `virtctl` connection commands to expose ports and connect to virtual machines (VMs).
97+
You use `virtctl` connection commands to expose ports and connect to VMs and VMIs.
9598

9699
.VM connection commands
97100
[width="100%",cols="1a,2a",options="header"]
@@ -103,22 +106,22 @@ You use `virtctl` connection commands to expose ports and connect to virtual mac
103106
|`virtctl expose <vm_name>`
104107
|Create a service that forwards a designated port of a VM and expose the service on the specified port of the node.
105108

106-
|`virtctl scp -i <ssh_key> <filename> <vm_username>@<vm_name>`
107-
|Copy a file from your machine to a VM. The command uses the private key of an SSH key pair. The VM must be configured with its public key.
109+
|`virtctl scp -i <ssh_key> <file_name> <user_name>@<vm_name>`
110+
|Copy a file from your machine to a VM. This command uses the private key of an SSH key pair. The VM must be configured with the public key.
108111

109-
|`virtctl scp -i <ssh_key> <vm_username@<vm_name>:<filename> .`
110-
|Copy a file from a VM to your machine. The command uses the private key of an SSH key pair. The VM must be configured with its public key.
112+
|`virtctl scp -i <ssh_key> <user_name@<vm_name>:<file_name> .`
113+
|Copy a file from a VM to your machine. This command uses the private key of an SSH key pair. The VM must be configured with the public key.
111114

112115
|`virtctl ssh -i <ssh_key> <user_name>@<vm_name>`
113-
|Open an SSH connection with a VM. The command uses the private key of an SSH key pair. The VM must be configured with its public key.
116+
|Open an SSH connection with a VM. This command uses the private key of an SSH key pair. The VM must be configured with the public key.
114117

115118
|`virtctl vnc --kubeconfig=$KUBECONFIG <vm_name>`
116119
|Connect to the VNC console of a VM.
117120

118121
Accessing the graphical console of a VM through VNC requires a remote viewer on your local machine.
119122

120123
|`virtctl vnc --kubeconfig=$KUBECONFIG --proxy-only=true <vm_name>`
121-
|Display the port number and connect manually to a VMI by using any viewer through the VNC connection.
124+
|Display the port number and connect manually to a VM by using any viewer through the VNC connection.
122125

123126
|`virtctl vnc --kubeconfig=$KUBECONFIG --port=<port-number> <vm_name>`
124127
|Specify a port number to run the proxy on the specified port, if that port is available.
@@ -129,7 +132,7 @@ If a port number is not specified, the proxy runs on a random port.
129132
[id='vm-volume-export-commands_{context}']
130133
== VM export commands
131134

132-
You can use `virtctl vmexport` commands to create, download, or delete a volume exported from a VM, VM snapshot, or persistent volume claim (PVC).
135+
You use `virtctl vmexport` commands to create, download, or delete a volume exported from a VM, VM snapshot, or persistent volume claim (PVC).
133136

134137
.VM export commands
135138
[width="100%",cols="1a,2a",options="header"]
@@ -164,7 +167,7 @@ Optional:
164167
[id='vm-memory-dump-commands_{context}']
165168
== VM memory dump commands
166169

167-
You can use the `virtctl memory-dump` command to output a virtual machine (VM) memory dump on a PVC. You can specify an existing PVC or use the `--create-claim` flag to create a new PVC.
170+
You can use the `virtctl memory-dump` command to output a VM memory dump on a PVC. You can specify an existing PVC or use the `--create-claim` flag to create a new PVC.
168171

169172
.Prerequisites
170173

@@ -219,10 +222,32 @@ You must remove a memory dump manually if you want to change the target PVC.
219222
This command removes the association between the VM and the PVC, so that the memory dump is not displayed in the `status` section of the `VirtualMachine` resource. The PVC is not affected.
220223
|===
221224

225+
// hot-plug/unplug NICs will be added in 4.14
226+
[id="hot-plug-and-hot-unplug-commands_{context}"]
227+
== Hot plug and hot unplug commands
228+
229+
You use `virtctl` to add or remove resources from running VMs and VMIs.
230+
231+
.Hot plug and hot-unplug commands
232+
[width="100%",cols="1a,2a",options="header"]
233+
|===
234+
|Command |Description
235+
|`virtctl addvolume <vm_name> --volume-name=<datavolume_or_PVC> [--persist] [--serial=<label>]`
236+
|Hot plug a virtual disk by attaching a data volume or persistent volume claim (PVC) to a running VM.
237+
238+
Optional:
239+
240+
* `--persist` mounts the virtual disk permanently on a VM. This flag does not apply to VMIs.
241+
* `--serial=<label>` adds a label to the VM. If you do not specify a label, the default label is the data volume or PVC name.
242+
243+
|`virtctl removevolume <vm_name> --volume-name=<datavolume|PVC>`
244+
|Hot unplug a virtual disk from a running VM.
245+
|===
246+
222247
[id='image-upload-commands_{context}']
223248
== Image upload commands
224249

225-
You can use the `virtctl image-upload` commands to upload a VM image to a data volume.
250+
You use the `virtctl image-upload` commands to upload a VM image to a data volume.
226251

227252
.Image upload commands
228253
[width="100%",cols="1a,2a",options="header"]

virt/install/virt-installing-virtctl.adoc

Lines changed: 0 additions & 25 deletions
This file was deleted.

virt/virt-getting-started.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Plan and install {VirtProductName} on an {product-title} cluster:
2121
* xref:../installing/installing_bare_metal/preparing-to-install-on-bare-metal.adoc#virt-planning-bare-metal-cluster-for-ocp-virt_preparing-to-install-on-bare-metal[Plan your bare metal cluster for {VirtProductName}].
2222
* xref:../virt/install/preparing-cluster-for-virt.adoc#preparing-cluster-for-virt[Prepare your cluster for {VirtProductName}].
2323
* xref:../virt/install/installing-virt-web.adoc#virt-installing-virt-operator_installing-virt-web[Install the {VirtProductName} Operator].
24-
* xref:../virt/install/virt-installing-virtctl.adoc#virt-installing-virtctl[Install the `virtctl` command line interface (CLI) tool].
24+
* xref:../virt/virt-using-the-cli-tools.adoc#installing-virtctl_virt-using-the-cli-tools[Install the `virtctl` command line interface (CLI) tool].
2525

2626
[discrete]
2727
[id="additional-resources_planning-and-installing"]

virt/virt-using-the-cli-tools.adoc

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
:_content-type: ASSEMBLY
22
[id="virt-using-the-cli-tools"]
3-
= Using the virtctl and oc tools
3+
= Using virtctl and libguestfs
44
include::_attributes/common-attributes.adoc[]
55
:context: virt-using-the-cli-tools
66
:toclevels: 3
77

88
toc::[]
99

10-
You use two primary CLI tools used for managing cluster resources:
10+
You can manage {VirtProductName} resources by using the `virtctl` command line tool.
1111

12-
* {VirtProductName} `virtctl` client
13-
+
14-
See xref:../virt/install/virt-installing-virtctl.adoc#virt-installing-virtctl[Installing the `virtctl` client].
12+
You can also deploy a `libguestfs-tools` container by using `virtctl`. link:https://libguestfs.org[`Libguestfs`] is a set of tools for accessing and modifying virtual machine (VM) disk images.
1513

16-
* {product-title} `oc` client
14+
[id="installing-virtctl_virt-using-the-cli-tools"]
15+
== Installing virtctl
1716

18-
include::modules/virt-openshift-client-commands.adoc[leveloffset=+1]
17+
To install `virtctl` on Linux, Windows, and MacOS operating systems, you download and install the the `virtctl` binary file.
1918

20-
For more comprehensive information on `oc` client commands, see the
21-
xref:../cli_reference/openshift_cli/developer-cli-commands.adoc#cli-developer-commands[{product-title} CLI tools] documentation.
19+
To install `virtctl` on {op-system-base-full}, you enable the {VirtProductName} repository and then install the `kubevirt-virtctl` package.
20+
21+
include::modules/virt-installing-virtctl-client.adoc[leveloffset=+2]
22+
23+
include::modules/virt-installing-virtctl-client-yum.adoc[leveloffset=+2]
2224

2325
include::modules/virt-virtctl-commands.adoc[leveloffset=+1]
2426

25-
include::modules/virt-creating-pvc-with-virtctl-guestfs.adoc[leveloffset=+1]
27+
== Using libguestfs
2628

27-
include::modules/virt-about-libguestfs-tools-virtctl-guestfs.adoc[leveloffset=+1]
29+
include::modules/virt-creating-pvc-with-virtctl-guestfs.adoc[leveloffset=+2]
2830

29-
[id="additional-resources_virt-using-the-cli-tools"]
30-
[role="_additional-resources"]
31-
== Additional resources
31+
include::modules/virt-about-libguestfs-tools-virtctl-guestfs.adoc[leveloffset=+2]
3232

33-
* link:https://libguestfs.org[Libguestfs: tools for accessing and modifying virtual machine disk images].

0 commit comments

Comments
 (0)