Multi step Jobs?
-
I run a 2 node XCP-NG system as a homelab, the main server runs 24/7, the second server is used for work lab projects and doesn't need to run 24/7 or even every day so I'd like to power it down cleanly to reduce the power costs.
I've been playing with the Jobs section of XOA and have created two jobs, one which suspends all the VMs and then another which powers the host down.
Is it possible to combine them into a single job (or maybe a script?) I could trigger to kick off suspend, then once all VMs were suspended power the machine down? At the moment I have to wait around and check back to safely power the host down.
I spotted the 'Emergency Shutdown' feature, but it doesn't look like I can call that function from a Job? I might want to set this up as a scheduled task so it runs anyway at 11pm or so in case I forget to shut the sytem down manually.
I'm also trying to figure out how to use the Power-On command to bring it back up again using Dell iDRAC without success so far but probably a topic for another thread..
-
-
Hi @markhaines, thanks for the suggestion!
We've discussed this and since it's not a trivial feature to implement and since we have quite a lot of other priorities at the moment, we won't be able to do it in the short term. However, we're keeping it in our "nice to have" list and if we get more requests about it, we'll raise its priority.
In the meantime, we'll add
host.emergencyShutdownHost
to the list of methods you can use in jobs. -
@pdonias Thanks - I think tbh the 'emergency.shutdown' option would do me fine - i've been using that this week 'manually' to shut the server down and it works ok. Is it possible to call this command externally in shell script - i guess it's just using an API call under the hood?
-
@markhaines If you need to call xo-server methods in a script, you can use xo-cli.
-
@pdonias ok, thanks - will have a play!
-
@pdonias @olivierlambert hey thanks for adding this in latest release!!