rgc2000 / NutClient-ESXi

Network UPS Tools client for VMware ESXi
https://rene.margar.fr/2012/05/client-nut-pour-esxi-5-0/
GNU General Public License v3.0
126 stars 14 forks source link

[REQUEST] Programmatically VM shutdown instead of host. #3

Closed 701789262a closed 10 months ago

701789262a commented 10 months ago

Premise: I have some energy-intensive VMs running on ESXi but they're are not "mission critical".

Request: It would be nice to programmatically shutdown energy-intensive or non-critical VMs first (maybe in different priority groups) and if energy supply is not resumed, the host is shut down at T - x (margin before batteries are empty)

rgc2000 commented 10 months ago

Currently Nut client has no interaction with VMs. As you know it will only tell to the host to shutdown when low batt event is received. Then host start/stop configuration is responsible for how to shutdown/freeze the running VMs.

It could be possible to get an inventory of VMs to shutdown and execute commands to stop them. This would add a new level of complexity to configure Nut Client.

Your need is too specific to your VMware usage and I will not implement it but you can clone the project and make your own release. Remember that I maintain this project on my spare time. I just can't spend hours on it.

701789262a commented 10 months ago

Currently Nut client has no interaction with VMs. As you know it will only tell to the host to shutdown when low batt event is received. Then host start/stop configuration is responsible for how to shutdown/freeze the running VMs.

Aight, I thought you were using esxcli to accomplish the shutdown, and I based my question on that assumption.

Your need is too specific to your VMware usage and I will not implement it

Agreed: it would need to be rewritten from scratch.

Remember that I maintain this project on my spare time. I just can't spend hours on it.

Yep and thanks for your work! I just wanted to know your opinion about it. Keep it up!

petrklus commented 8 months ago

@701789262a I had a similar need and what I've done is to install a separate NUT client on the VM. What is happening now is that the VM turns off when battery is less than 60%, which then prolongs the runtime for the rest. If it's a linux VM, then it should be relatively easy to do.