1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/virt-generating-a-vm-memory-dump.adoc
2025-11-18 16:29:25 +01:00

65 lines
2.1 KiB
Plaintext

:_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
[role="_abstract"]
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 <vm_name> --claim-name=<pvc_name>
----
** If you want to create a new PVC for the memory dump:
+
[source,terminal]
----
$ virtctl memory-dump get <vm_name> --claim-name=<new_pvc_name> --create-claim
----
. Download the memory dump:
+
[source,terminal]
----
$ virtctl memory-dump download <vm_name> --output=<output_file>
----
. 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 <vm_name>
----