Shutting down "Protect from accidental shutdown" VMs from command line
-
Hi, yesterday I got myself into a silly predicament when the VM I was using to run Xen Orchestra got stuck during its shutdown. It had been set to block accidental shutdowns, so I was unable to force shutdown using XCP-NG Centre, or the regular shutdown command on CLI. As far as I can tell, XCP-NG Centre is unable to toggle the "protect from accidental shutdown" setting, so I was pretty much stuck.
Google search turned up this thread:
https://xcp-ng.org/forum/topic/3885/cli-ssh-delete-vms-that-were-set-as-protect-from-accidental-deletion-in-xoThere's a post in there that mentioned "xe vm-param-cleaner", but that command doesnt exist.
As a guess, I tried this command instead, and it was able to clear the setting so I could do a force shutdown from command line:
xe vm-param-clear uuid=<vm_uuid> param-name=blocked-operations
Just posting this as a reference for future generations.
Maybe there should be a CLI command for "really force shutdown like I really really mean it", that ignores the "Protect" setting? With a confirmation prompt or something?