vCenter shutdown with UPS

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

BSDguy

Member
Sep 22, 2014
168
7
18
53
I have a two node vSphere 6 cluster which has HA enabled. One of the nodes is connected to a Cyberpower CP1500EPFCLCD UPS via USB. I have installed the PowerPanel Business Edition appliance on each node (one is the agent and the other is the client). I have also installed the Windows PowerPanel Business Edition client in each Windows VM. All of this has allowed me to gracefully shutdown my Windows VMs and the ESXi servers.

The problem I have is, how do I gracefully shutdown the VMware appliances, more specifically vCenter? There is a Linux based version of PowerPanel Business Edition but it doesn't seem to install if I SSH into a test vCenter VM.

What are my options for shutting down vCenter (or any appliance really) when there is a power failure if I can't use the Linux based Cyberpower PowerPanel Business Edition client? Scripts? Something else? I'm stumped here!

Since HA is enabled on the cluster the VM startup/shutdown options are disabled so this is not an option.
 

BSDguy

Member
Sep 22, 2014
168
7
18
53
Have you taken a look at NUT - Network UPS Tools - Welcome ? I use it on windows as the Eaton tools didn't quite fit my use case.
I had a brief look last night so will need to read up a bit more about NUT.

Doesn't look like I can use the Cyberpower software to shutdown VMware appliances so I think I may need to create some kind of script that shuts down ALL my VMs (appliances, Linux and Windows) in my HA cluster. I've never used PowerCLI before so this is going to be a challenge!!
 

NetWise

Active Member
Jun 29, 2012
596
133
43
Edmonton, AB, Canada
PowerCLI is the obvious answer here. You note it has HA enabled so I assume shared storage and this VM's are vMotionable. You may then want your shutdown script to either move the VM's to the 'right' host, or also set the VM startup order per host to automatic or a specified order so when the power comes back on, your startup is what you expect it to be.


Sent from my iPhone using Tapatalk
 

nk215

Active Member
Oct 6, 2015
412
143
43
50
I am not familiar with UPS with USB connection. My UPS is connected via network card.

On my ESXi host, I installed a PowerChute appliance. This is the one that communicates with vCenter and issues the Shutdown, VM shutdown, VM migration commands

Powerchute appliance can also power up the VMs when power is back. It can also migrate critical VM to lower power hosts.

I am not sure if PowerChute appliance can communicate with a UPS via USB. If not you should be able to script a guest VM to power down the ESXi host/vCenter
 

BSDguy

Member
Sep 22, 2014
168
7
18
53
Basically I have the Cyberpower appliance running in my cluster. This appliance is the "agent" which is a VM that connects to the UPS via USB. All the other hosts/VMs communicate with the agent to know when there is a power failure and how long to wait until the device is shut down.

Works great until you get to appliances like vCenter as it needs the client installed on it for it to communicate with the agent. Been in contact with their support and they suggested trying the "center" console which hooks into vCenter but you STILL can't shutdown appliances gracefully. All it does is shut down the hosts and does not shut down the VMs gracefully. All very frustrating.

You can't use the VM startup/shutdown order with an HA cluster as these options are disabled.

With the agent appliance you can run a batch file when there is a power failure so I'm assuming this is how I'll get this all to work? ie: batch file calls PowerCLI scripts which powers ALL VMs off first before shutting down the two ESXi servers

So the order I am trying to go for with the shutdown (not worried about the powering up of everything right now) is:

1) Power failure occurs
2) After 3min start gracefully shutting down ALL VMs (including vCenter)
3) When last VM has gracefully shutdown (or been forcefully powered off after some kind of timeout) shutdown both ESXi hosts (I assume its ok to shutdown both ESXi servers that have HA enabled for the cluster at the same time if ALL VMs are off??)
4) Shutdown Windows based SAN
5) Turn off UPS

Any pointers on how I accomplish this using PowerCLI? Never used PowerCLI before!!
 

Tom5051

Active Member
Jan 18, 2017
359
79
28
46
Use the ESXi VM startup/shutdown settings to control the VMs and then you just need a script to issue a shutdown command to the host/s.
Set the UPS to shut off power once the host has had enough time to power down gracefully, set host bios setting to AC full after power loss.
When power is restored to the UPS it should turn the host/s on and then the VMs will start in the order specified in the ESXi settings.
 

BSDguy

Member
Sep 22, 2014
168
7
18
53
You can't use the startup/shutdown settings to control the VMs when the hosts are in an HA cluster (this feature gets disabled).
 
  • Like
Reactions: Tom5051

Tom5051

Active Member
Jan 18, 2017
359
79
28
46
You can't use the startup/shutdown settings to control the VMs when the hosts are in an HA cluster (this feature gets disabled).
Sorry I forgot the OP mentioned HA. You are correct. My mistake.
 

NetWise

Active Member
Jun 29, 2012
596
133
43
Edmonton, AB, Canada
You can't use the startup/shutdown settings to control the VMs when the hosts are in an HA cluster (this feature gets disabled).
True.

So disable HA.

Get the list of VM's on each host and set them to be the startup order of any.

Now shutdown all VM's and then the hosts.

When you power back up, VM's will auto start. Then just reenable HA. That could be a script that runs on startup or hourly say.




Sent from my iPhone using Tapatalk Pro
 

wildchild

Active Member
Feb 4, 2014
389
57
28
Cant you fire off powershell commands to vcenter to first disable HA then give shutdown to the machine ?

Verstuurd vanaf mijn ZP920+ met Tapatalk