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-set-guest-log-single-vm-cli.adoc
2026-01-20 17:24:19 +00:00

57 lines
1.3 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/support/virt-troubleshooting.adoc
:_mod-docs-content-type: PROCEDURE
[id="virt-set-guest-log-single-vm-cli_{context}"]
= Setting guest system log access for a single VM with the CLI
[role="_abstract"]
You can configure access to VM guest system logs for a single VM by editing the `VirtualMachine` CR. This setting takes precedence over the cluster-wide default configuration.
.Prerequisites
* You have installed the {oc-first}.
.Procedure
. Edit the virtual machine manifest by running the following command:
+
[source,terminal]
----
$ oc edit vm <vm_name>
----
. Update the value of the `logSerialConsole` field. For example:
+
[source,yaml]
----
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: example-vm
spec:
template:
spec:
domain:
devices:
logSerialConsole: true
#...
----
+
To enable access to the guest's serial console log, set the `logSerialConsole` value to `true`.
. Apply the new configuration to the VM by running the following command:
+
[source,terminal]
----
$ oc apply vm <vm_name>
----
. Optional: If you edited a running VM, restart the VM to apply the new configuration. For example:
+
[source,terminal]
----
$ virtctl restart <vm_name> -n <namespace>
----