I had a virtual machine that was stuck trying to reboot. I attempted to force it to reboot via XenCenter, but it wasn’t working. Stuck with the yellow symbol.
Found the following commands:
All command line, so get used to SSH as root
Generally you should SSH to your primary server, but the commands below seemed to work ok on the secondaries (unless otherwise noted)
Get the UUID for your VM
xe vm-list
or
xe vm-list name-label=YOURVMGUESTNAME
Or grab the UUID from XenCenter
In my case it’s:
1dd7cc44-0dce-2149-4a9f-27425ee8eae0
Force the VM to shutdown:
xe vm-shutdown uuid=1dd7cc44-0dce-2149-4a9f-27425ee8eae0 force=true
If that fails, try this:
xe vm-reset-powerstate uuid=1dd7cc44-0dce-2149-4a9f-27425ee8eae0 force=true
I also tried to reset the toolstack on the PRIMARY XENSERVER
xe -toolstack-restart
Good to know that command, but it did nothing for me.
If that fails you may need to kill the domain (similar to removing the power from the VM):
list_domains | grep YOURUUID
The number in the front is the domain ID
Kill the Domain ID
/opt/xensource/debug/xenops destroy_domain -domid YOURDOMAINID