Skip to content

Commit bed9bd9

Browse files
authored
Merge pull request #61571 from apinnick/update-virctl-commands
Update virctl commands
2 parents 661950d + d2112a5 commit bed9bd9

12 files changed

+132
-141
lines changed

_topic_maps/_topic_map.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3644,8 +3644,6 @@ Topics:
36443644
- Name: Installing OKD Virtualization using the CLI
36453645
File: installing-virt-cli
36463646
Distros: openshift-origin
3647-
- Name: Installing the virtctl client
3648-
File: virt-installing-virtctl
36493647
- Name: Uninstalling OpenShift Virtualization
36503648
File: uninstalling-virt
36513649
Distros: openshift-enterprise
@@ -3660,7 +3658,7 @@ Topics:
36603658
Distros: openshift-origin
36613659
- Name: Security policies
36623660
File: virt-security-policies
3663-
- Name: Using the CLI tools
3661+
- Name: Using the virtctl and libguestfs CLI tools
36643662
File: virt-using-the-cli-tools
36653663
- Name: Virtual machines
36663664
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: 89 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,20 @@
88

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

11-
.`virtctl` general commands
11+
[NOTE]
12+
====
13+
The virtual machine (VM) commands also apply to virtual machine instances unless otherwise specified.
14+
====
15+
16+
// apinnick: I recommend not breaking these sections into separate modules because of maintenance issues.
17+
// These sections will never be used independently.
18+
19+
[id='virtctl-information-commands_{context}']
20+
== Virtctl information commands
21+
22+
You use `virtctl` information commands to view information about the `virtctl` client.
23+
24+
.Information commands
1225
[width="100%",cols="1a,2a",options="header"]
1326
|===
1427
|Command |Description
@@ -25,15 +38,31 @@ The `virtctl` client is a command-line utility for managing {VirtProductName} re
2538
|View a list of global command options for any `virtctl` command.
2639
|===
2740

28-
// apinnick: I recommend not breaking these sections into separate modules because of maintenance issues.
29-
// These sections will never be used independently.
41+
[id='vm-information-commands_{context}']
42+
== VM information commands
43+
44+
You can use `virtctl` to view information about VMs and VMIs.
45+
46+
.VM information commands
47+
[width="100%",cols="1a,2a",options="header"]
48+
|===
49+
|Command |Description
50+
|`virtctl fslist <vm_name>`
51+
|View the file systems available on a guest machine.
52+
53+
|`virtctl guestosinfo <vm_name>`
54+
|View information about the operating systems on a guest machine.
55+
56+
|`virtctl userlist <vm_name>`
57+
|View the logged-in users on a guest machine.
58+
|===
3059

3160
[id='vm-management-commands_{context}']
32-
== VM and VMI management commands
61+
== VM management commands
3362

34-
You can use `virtctl` to manage virtual machine (VM) or virtual machine instance (VMI) states and to migrate a VM.
63+
You use `virtctl` virtual machine (VM) management commands to manage and migrate VMs and VMIs.
3564

36-
.`virtctl` VM management commands
65+
.VM management commands
3766
[width="100%",cols="1a,2a",options="header"]
3867
|===
3968
|Command |Description
@@ -49,12 +78,11 @@ You can use `virtctl` to manage virtual machine (VM) or virtual machine instance
4978
|`virtctl stop <vm_name> --grace-period 0 --force`
5079
|Force stop a VM. This option might cause data inconsistency or data loss.
5180

52-
|`virtctl pause vm\|vmi <vm_name>`
53-
|Pause a VM or VMI. The machine state is kept
54-
in memory.
81+
|`virtctl pause vm <vm_name>`
82+
|Pause a VM. The machine state is kept in memory.
5583

56-
|`virtctl unpause vm\|vmi <vm_name>`
57-
|Unpause a VM or VMI.
84+
|`virtctl unpause vm <vm_name>`
85+
|Unpause a VM.
5886

5987
|`virtctl migrate <vm_name>`
6088
|Migrate a VM.
@@ -63,41 +91,50 @@ in memory.
6391
|Restart a VM.
6492
|===
6593

66-
[id='vm-and-vmi-connection-commands_{context}']
67-
== VM and VMI connection commands
94+
[id='vm-connection-commands_{context}']
95+
== VM connection commands
6896

69-
You can use `virtctl` to connect to the serial console, expose a port, set a proxy connection, specify a port, and open a VNC connection to a VM.
97+
You use `virtctl` connection commands to expose ports and connect to VMs and VMIs.
7098

71-
.`virtctl console`, `expose`, and `vnc` commands
99+
.VM connection commands
72100
[width="100%",cols="1a,2a",options="header"]
73101
|===
74102
|Command |Description
75-
|`virtctl console <vmi_name>`
76-
|Connect to the serial console of a VMI.
103+
|`virtctl console <vm_name>`
104+
|Connect to the serial console of a VM.
77105

78106
|`virtctl expose <vm_name>`
79-
|Create a service that forwards a designated port of a VM or VMI and expose the service on the specified port of the node.
107+
|Create a service that forwards a designated port of a VM and expose the service on the specified port of the node.
108+
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.
111+
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.
80114

81-
|`virtctl vnc --kubeconfig=$KUBECONFIG <vmi_name>`
82-
|Open a Virtual Network Client (VNC) connection to a VMI.
115+
|`virtctl ssh -i <ssh_key> <user_name>@<vm_name>`
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.
83117

84-
Accessing the graphical console of a VMI through VNC requires a remote viewer on your local machine.
118+
|`virtctl vnc --kubeconfig=$KUBECONFIG <vm_name>`
119+
|Connect to the VNC console of a VM.
85120

86-
|`virtctl vnc --kubeconfig=$KUBECONFIG --proxy-only=true <vmi_name>`
87-
|Display the port number and connect manually to a VMI by using any viewer through the VNC connection.
121+
Accessing the graphical console of a VM through VNC requires a remote viewer on your local machine.
88122

89-
|`virtctl vnc --kubeconfig=$KUBECONFIG --port=<port-number> <vmi_name>`
123+
|`virtctl vnc --kubeconfig=$KUBECONFIG --proxy-only=true <vm_name>`
124+
|Display the port number and connect manually to a VM by using any viewer through the VNC connection.
125+
126+
|`virtctl vnc --kubeconfig=$KUBECONFIG --port=<port-number> <vm_name>`
90127
|Specify a port number to run the proxy on the specified port, if that port is available.
91128

92129
If a port number is not specified, the proxy runs on a random port.
93130
|===
94131

95132
[id='vm-volume-export-commands_{context}']
96-
== VM volume export commands
133+
== VM export commands
97134

98-
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).
99136

100-
.`virtctl vmexport` commands
137+
.VM export commands
101138
[width="100%",cols="1a,2a",options="header"]
102139
|===
103140
|Command |Description
@@ -130,7 +167,7 @@ Optional:
130167
[id='vm-memory-dump-commands_{context}']
131168
== VM memory dump commands
132169

133-
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.
134171

135172
.Prerequisites
136173

@@ -158,7 +195,7 @@ $ virtctl vmexport download <vmexport_name> --vm\|pvc=<object_name> \
158195
--volume=<volume_name> --output=<output_file>
159196
----
160197

161-
.`virtctl memory-dump` commands
198+
.VM memory dump commands
162199
[width="100%",cols="1a,2a",options="header"]
163200
|===
164201
|Command |Description
@@ -185,37 +222,41 @@ You must remove a memory dump manually if you want to change the target PVC.
185222
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.
186223
|===
187224

188-
[id='image-upload-commands_{context}']
189-
== Image upload commands
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
190228

191-
You can use the `virtctl image-upload` commands to upload a VM image to a data volume.
229+
You use `virtctl` to add or remove resources from running VMs and VMIs.
192230

193-
.`virtctl image-upload` commands
231+
.Hot plug and hot-unplug commands
194232
[width="100%",cols="1a,2a",options="header"]
195233
|===
196234
|Command |Description
197-
|`virtctl image-upload dv <datavolume_name> --image-path=</path/to/image> --no-create`
198-
|Upload a VM image to a data volume that already exists.
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.
199237

200-
|`virtctl image-upload dv <datavolume_name> --size=<datavolume_size> --image-path=</path/to/image>`
201-
|Upload a VM image to a new data volume of a specified requested size.
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.
202245
|===
203246

204-
[id='environment-information-commands_{context}']
205-
== Environment information commands
247+
[id='image-upload-commands_{context}']
248+
== Image upload commands
206249

207-
You can use `virtctl` to view information about versions, file systems, guest operating systems, and logged-in users.
250+
You use the `virtctl image-upload` commands to upload a VM image to a data volume.
208251

209-
.`virtctl` environment information commands
252+
.Image upload commands
210253
[width="100%",cols="1a,2a",options="header"]
211254
|===
212255
|Command |Description
213-
|`virtctl fslist <vmi_name>`
214-
|View the file systems available on a guest machine.
215-
216-
|`virtctl guestosinfo <vmi_name>`
217-
|View information about the operating systems on a guest machine.
256+
|`virtctl image-upload dv <datavolume_name> --image-path=</path/to/image> --no-create`
257+
|Upload a VM image to a data volume that already exists.
218258

219-
|`virtctl userlist <vmi_name>`
220-
|View the logged-in users on a guest machine.
259+
|`virtctl image-upload dv <datavolume_name> --size=<datavolume_size> --image-path=</path/to/image>`
260+
|Upload a VM image to a new data volume of a specified requested size.
221261
|===
262+

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"]

0 commit comments

Comments
 (0)