esxi_stats
esxi_stats copied to clipboard
Add graceful shutdown and reboot Host
Could you please add the ability to graceful shutdown and restart the host? Thanks!
This would be awesome! +1
+1!
This would become really handy when trying to gracefully shutdown all VMs by leveraging the autostart/stop feature in vSphere.
Currently, when power goes out and my UPS starts running low, I execute a NodeRED flow that will shutdown all VMs. It'd be much easier to simply tell the host to shutdown and it will take care of gracefully shutting down the VMs.
Also, I have a RaspberryPI pinging my host every X time and, if it doesn't respond (and house power is not out), it sends a WOL package to wake it up. When it wakes up it automatically starts my VMs again.
So if power goes out, I'd turn off the host and when it comes back, my Pi would come back online automatically, ping the host and WOL it if it doesn't respond.
+1, sounds like a good idea, I would like to automate the start up and shutdown on my OpenVPN VM based on geolocation, when I leave the house.
@santibur06 would you possibly share your Node-RED config for shutting down VMs?
Thanks in advance.
I am not sure how many people run vVotion vs single host. But I think both scenarios need to be addressed to make it successful.
if vMotion
- put the host into MM
- Wait until VMs are migrated
- Shut down host
OR in a single host confiigurationi
- Put the host into MM
- Shutdown all VMs
- Shut down host
This would be very nice!
any chance to introduce ESXi gracefull shutdown?
please aadd the shutdown host option... this will be very very useful for anyone like me that manage the UPS infrastructure via home assistant. I think is ok to issue the shutdown command without entering MM
With power outages potentially becoming more common, this really would be useful to complete my full automation of a UPS-related power down.
I am looking for an automated way to power on/power off gracefully my home lab ESXi host, no vSphere, (for work) using HA. This enhancement would be exactly what I would need. I would like to avoid MM so that a simple power on would start the VM in the auto-startup.
I would even be okay with doing this from a script, but I can't get the list of associated VMs for a host from this integration. -- only the number of running VMs on the host?!?
@ecoen66 host shutdown is available in latest beta, but if you want to get a list of VMs associated with a host you can use a jinja template to create a list like this
{% set vms= namespace(name=[]) %}
# replace ''placeholder'' in the IF statement with name of ESXi host
{% for state in states.sensor %}
{% if state_attr(state.entity_id, 'host_name') == 'placeholder' %}
{% set vms.name = vms.name + [state_attr(state.entity_id,'name')] %}
{% endif %}
{% endfor %}
{{ vms.name }}
Hmm… Is that supposed to shutdown all VMs cleanly prior to host shutdown? If so, that would save me a ton of script logic for my VMs, host + CIMC shutdown sequence for UCS C-series…
The host shutdown command is going to shutdown your host. There is no logic for handling VM shutdowns.
Released in 0.7.0