From 4f45f67fccfcb7374b1d838258f0f48ffad3f6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Herrmann?= Date: Wed, 13 Aug 2025 18:06:55 +0200 Subject: [PATCH] OSDOCS-66695: Taking apart the virtctl module --- modules/virt-generating-a-vm-memory-dump.adoc | 63 ++++ ...virt-hot-plug-and-hot-unplug-commands.adoc | 31 ++ modules/virt-image-upload-commands.adoc | 23 ++ modules/virt-virtctl-commands.adoc | 342 ------------------ .../virt-virtctl-information-commands.adoc | 26 ++ modules/virt-vm-connection-commands.adoc | 45 +++ modules/virt-vm-export-commands.adoc | 57 +++ modules/virt-vm-information-commands.adoc | 24 ++ modules/virt-vm-management-commands.adoc | 41 +++ .../virt-vm-manifest-creation-commands.adoc | 51 +++ virt/about_virt/virt-architecture.adoc | 2 +- .../getting_started/virt-getting-started.adoc | 4 +- .../virt-using-the-cli-tools.adoc | 26 +- virt/managing_vms/virt-exporting-vms.adoc | 2 +- virt/support/virt-collecting-virt-data.adoc | 11 +- 15 files changed, 400 insertions(+), 348 deletions(-) create mode 100644 modules/virt-generating-a-vm-memory-dump.adoc create mode 100644 modules/virt-hot-plug-and-hot-unplug-commands.adoc create mode 100644 modules/virt-image-upload-commands.adoc delete mode 100644 modules/virt-virtctl-commands.adoc create mode 100644 modules/virt-virtctl-information-commands.adoc create mode 100644 modules/virt-vm-connection-commands.adoc create mode 100644 modules/virt-vm-export-commands.adoc create mode 100644 modules/virt-vm-information-commands.adoc create mode 100644 modules/virt-vm-management-commands.adoc create mode 100644 modules/virt-vm-manifest-creation-commands.adoc diff --git a/modules/virt-generating-a-vm-memory-dump.adoc b/modules/virt-generating-a-vm-memory-dump.adoc new file mode 100644 index 0000000000..a535dfa211 --- /dev/null +++ b/modules/virt-generating-a-vm-memory-dump.adoc @@ -0,0 +1,63 @@ +:_newdoc-version: 2.18.5 +:_template-generated: 2025-08-14 +:_mod-docs-content-type: PROCEDURE + +[id="virt-generating-a-vm-memory-dump_{context}"] += Generating a VM memory dump + +When a virtual machine (VM) terminates unexpectedly, you can use the `virtctl memory-dump` to generate a memory dump command to output a VM memory dump and save it on a persistent volume claim (PVC). Afterwards, you can analyze the memory dump to diagnose and troubleshoot issues on the VM. + +// You can specify an existing PVC or use the `--create-claim` flag to create a new PVC. + +.Prerequisites + +* The hot plug feature gate is enabled in the `HyperConverged` custom resource. To do so, run the following command: ++ +[source,terminal,subs="attributes+"] +---- +$ oc patch hyperconverged kubevirt-hyperconverged -n {CNVNamespace} \ + --type json -p '[{"op": "add", "path": "/spec/featureGates", \ + "value": "HotplugVolumes"}]' +---- + +* Optional: You have an existing PVC on which you want to save the memory dump. +** The PVC volume mode must be `FileSystem`. +** The PVC must be large enough to contain the memory dump. ++ +The formula for calculating the PVC size is `(VMMemorySize + 100Mi) * FileSystemOverhead`, where `100Mi` is the memory dump overhead, and `FileSystemOverhead` is defined in the `HCO` object. + +.Procedure + +. Create a memory dump of the required VM: + +** If you have an existing PVC selected on which you want to save the memory dump: ++ +[source,terminal] +---- +$ virtctl memory-dump get --claim-name= +---- + +** If you want to create a new PVC for the memory dump: ++ +[source,terminal] +---- +$ virtctl memory-dump get --claim-name= --create-claim +---- + +. Download the memory dump: ++ +[source,terminal] +---- +$ virtctl memory-dump download --output= +---- + +. Attach the memory dump to a Red Hat Support case. ++ +Alternatively, you can inspect the memory dump, for example by using link:https://github.com/volatilityfoundation/volatility3[the volatility3 tool]. + +. Optional: Remove the memory dump: ++ +[source,terminal] +---- +$ virtctl memory-dump remove +---- \ No newline at end of file diff --git a/modules/virt-hot-plug-and-hot-unplug-commands.adoc b/modules/virt-hot-plug-and-hot-unplug-commands.adoc new file mode 100644 index 0000000000..11203ce09a --- /dev/null +++ b/modules/virt-hot-plug-and-hot-unplug-commands.adoc @@ -0,0 +1,31 @@ +:_newdoc-version: 2.18.5 +:_template-generated: 2025-08-13 +:_mod-docs-content-type: REFERENCE + +[id="hot-plug-and-hot-unplug-commands_{context}"] += Hot plug and hot unplug commands + + +You can use the following `virtctl` commands to add or remove resources from running virtual machines (VMs) and VM instances (VMIs). + +.Hot plug and hot unplug commands +[width="100%",cols="1a,2a",options="header"] +|=== +|Command |Description +|`virtctl addvolume --volume-name= [--persist] [--serial=