Archive for the ‘kernel’ Category.

Mental note: Sending a SysRQ to a VM

On the host, run the following command:

  # virsh send-key rhel6 KEY_LEFTALT KEY_SYSRQ KEY_C

where rhel6 is the name of the VM, and KEY_C is the command that you want to send, in this case it will generate a crash dump.

The available commands are:

  • loglevel(0-9)
  • reboot(b)
  • crash(c)
  • terminate-all-tasks(e)
  • memory-full-oom-kill(f)
  • kill-all-tasks(i)
  • thaw-filesystems(j)
  • sak(k)
  • show-backtrace-all-active-cpus(l)
  • show-memory-usage(m)
  • nice-all-RT-tasks(n)
  • poweroff(o)
  • show-registers(p)
  • show-all-timers(q)
  • unraw(r)
  • sync(s)
  • show-task-states(t)
  • unmount(u)
  • show-blocked-tasks(w)
  • dump-ftrace-buffer(z)

Finally, it will works only if the sysctl kernel.sysrq is equals to 1:

  # sysctl  -w kernel.sysrq=1