Activate sysrq on Linux guest VMs
-
Log in to the Linux Guest VM as root user and check the value of "sysrq" as below.
[root@linuxvm ~]# cat /proc/sys/kernel/sysrq
16
Default value is 16 which stands for "enable sync command".
-
Modify the value of "sysrq" from "16" to "1". "1" means "Enable all functions in sysrq
We can set this value to be persistent or non-persistent depending on situation
Non persistent
[root@linuxvm ~]# echo "1" > /proc/sys/kernel/sysrq
Permanent - Reboot will be required to apply the change
[root@linuxvm ~]# echo "kernel.sysrq =1" >> /etc/sysctl.d/99-sysctl.conf
- Check “sysrq” value again
[root@linuxvm ~]# cat /proc/sys/kernel/sysrq
-
Find AHV host in which linux VM is running
nutanix@cvm:~$ acli vm.get <VM name> | grep host_name
host_name: "X.X.X.X"
-
CVM to check the UUID of Linux Guest VM from any CVM
nutanix@cvm:~$ acli vm.list | grep <VM name>
linuxvm 66551923-eb86-4c69-933b-ecf15ec5f59c
-
run below command to find out the domain ID of the Linux Guest VM by grepping VM's UUID confirmed in "Step 5".
root@ahv ~]# virsh list | grep 66551923-eb86-4c69-933b-ecf15ec5f59c
104 66551923-eb86-4c69-933b-ecf15ec5f59c running
- Run command on AHV host to force panic the Linux Guest VM with the domain ID confirmed from "Step 6".
[root@ahv ~]# virsh send-key 104 KEY_LEFTALT KEY_SYSRQ KEY_C
- Once reboot of the Linux Guest VM is completed, login to the VM and check if the dump files are available under "/var/crash"
[root@linuxvm ~]# pwd
/var/crash
[root@linuxvm ~]# ls -alt
127.0.0.1-2020-03-11-09:07:26
[root@linuxvm ~]# cd 127.0.0.1-2020-03-11-09:07:26
[root@linuxvm ~]# ls -alst
total 113832
0 drwxr-xr-x. 2 root root 44 Mar 11 09:07 .
113044 -rw-------. 1 root root 115754458 Mar 11 09:07 vmcore
788 -rw-r--r--. 1 root root 806202 Mar 11 09:07 vmcore-dmesg.txt
0 drwxr-xr-x. 6 root root 154 Mar 11 09:07 ..
Steps are mentioned in following document: