Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to shutdown or reboot VM forcely in XEN?

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).

like image 949
XuZhangning Avatar asked Apr 02 '13 14:04

XuZhangning


2 Answers

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.

like image 69
Joachim Isaksson Avatar answered Oct 24 '22 06:10

Joachim Isaksson


I had issue with "xm reboot", it will not effect and cause subsequence "xm shutdown" has no effect too. So I think the best approach is to "xm shutdown", check "xm uptime" the domain to see if it shutdown, or until timeout and call "xm destroy"

like image 44
frostyplanet Avatar answered Oct 24 '22 07:10

frostyplanet