How to shutdown or reboot VM forcely in XEN?

XuZhangning picture XuZhangning · Apr 2, 2013 · Viewed 33.5k times · Source

It happen to me to find a VM in XEN run out of memory, OS kill its shell tty so there is no way to input command in VM internally. The only way to fix is shutdown or reboot the VM.

"xm shutdown VM-name" and "xm reboot VM-name" have been tried, but not work. XEN is working fine, the rest VMs are all good, and xm command work for them too. only the ill VM out of control.

Is there any XEN command to shutdown or reboot its VM by force? e.g. some command with "--force" flag. "xm reboot" and "xm shutdown" are too grace in my case, I think.

The XEN version I used is xen-3.0-x86_64 (debian).

Answer

Joachim Isaksson picture Joachim Isaksson · Apr 2, 2013

The xmoption you probably want (although it should really be a last resort) is xm destroy.

xm destroy domain-id

Immediately terminate the domain domain-id. This doesn't give the domain OS any chance to react, and it the equivalent of ripping the power cord out on a physical machine. In most cases you will want to use the shutdown command instead.