Question

How to generate crash dump files for Linux guest VM

  • 10 November 2020
  • 0 replies
  • 1350 views

Userlevel 2
Badge +2
  • Nutanix Employee
  • 12 replies

Activate sysrq on Linux guest VMs

  1. 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".

  1. 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
  1. Check “sysrq” value again
[root@linuxvm ~]# cat /proc/sys/kernel/sysrq
  1. 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"
  1. 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
  1. 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
  1. 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
  1. 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:

crash dump file for linux VM

 


 


This topic has been closed for comments