If you’ve been wondering why on_crash='coredump-restart'
or on_crash='coredump_restart'
(as per some manuals) doesnt work or gives you
“Error: Invalid event handling mode: crash”, here’s why:
I spend hours looking for the answer, and no one one ##xen would also tell me why (asked multiple times, and idled long enough)..and after breaking my head for hours I found the answer.
So listen carefully 🙂
A. Xendump can be configured to capture vmcore dumps of para-virtualized (PV) Xen domU/guests automatically upon a crash. ie., by using on_crash=’coredump-restart’
B. Core dumps from fully-virtualized (FV) Xen domU/guests can only be taken manually by running the `xm dump-core` command.
Here’s a detailed how-to on enabling coredump for Xen domU/guest:
1. On the dom0/Xenserver, edit /etc/xen/xend_config.sxp and uncomment
# (enable-dump no)
and make it
(enable-dump yes)
2. Restart Xend (depending on whether you use init.d scripts or service utility)
# /etc/init.d/xend restart
or
# service xend restart
3. On the domU/Guest, edit domU.cfg (domU’s configuration file) and add/edit line
#If your domU is fully-virtualized
on_crash='restart'
or
#If your domU is para-virtualized
on_crash='coredump-restart'
4. Start domU
# xm create /path/to/domU.cfg
5. Now, if your domU/guest is para-virtualized, login to the domU and
Check if kernel.panic key is true
# sysctl -A | grep -e kernel | grep -e panic
Set them if they are not
# sysctl -w kernel.panic=1
# sysctl -w kernel.panic_on_oops=1
6. Test it from inside domU/Guest. (Para-Virtualized Guest)
Warning: The next line of code will crash your domU for test.
# echo "c" >/proc/sysrq-trigger
Note: The above command is a way of invoking magic sysrq
a. It will not work if sysrq is disabled on the box
b. NO. I am not gonna talk about magic sysrq’s in this post; or even how to find if its disabled 🙂
7. Test it from dom0/Xenserver. (Fully-Virtualized Guest)
Warning: The next line of code will crash your domU for test.
# xm dump-core -C
8. Above steps 6/7 will dump vmcore to /var/xen/dump (default directory unless you have changed it)
Oh, BTW, make sure you create that directory if it doesn’t exists before taking the dump 😀
Enjoy analyzing the dump 😉
sounds greek to me 🙂
Comment by Manish — September 28, 2011 @ 9:02 pm
Oh no my friend, it is Latin 😉
Comment by krish — September 29, 2011 @ 8:33 am
I always spent my half an hour to read this web site’s posts daily along with a mug of coffee.
Comment by myds — May 29, 2013 @ 1:21 am
[…] -c <cap>/-w <weight>#priority xm migrate -l <vm> <server> xen coredump is here (xm dump-core/on_crash='coredump-restart') Good Luck! (adsbygoogle = window.adsbygoogle || […]
Pingback by xen tips - Take hold of IT technology trends - learn, practice, troubleshoot, blog — December 28, 2015 @ 2:16 pm