1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-07 09:46:53 +01:00
Files
openshift-docs/modules/virt-set-guest-log-single-vm-cli.adoc
2024-02-21 15:24:19 +00:00

51 lines
1.2 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
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.
.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 <1>
#...
----
<1> 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>
----