VMware Cloud Community
0j3r3my0
Contributor
Contributor
Jump to solution

APC PowerChute on VMware ESXi 4

Hi!

We've a problem with the ESXi 4 during the test with our APC SUA-2200 UPS. We have only 1 ESXi server. The vMA doesn't want to shut the ESXi down when receive the shutdown signal, so when the UPS battery. So when the battery dies the machine just powers off without graceful shutdown of the VMs. The UPS has an installed network management card. We deployed a vMA to our ESXi and installed the APC's PowerChute Software (PCNS). So the status is the following:

1. The network management in the UPS card is working correctly (we can access the webUI from any computer)

2. The vMA has a correct Powerchute software. We opened all require ports with the iptables. So we can reach the PowerChute's webUI.

3. We configured the ESXi with the vSphere to automaticaly startup/shutdown with the system. If we reboots the ESXi with the vShere the system shuts the Virtual Machines down correctly.

4. The PowerChute can communicate with the UPS Network card correctly. And the vMA receives the shutdown signal correctly. But the vMA only shuts down itself and leaves the ESXi on, that is our problem.

How can we force the vMA to shutdown our ESXi?

Have you experienced a problem like this before with the PowerChute, or do you have any idea what causes this error?

Thank you for your help!

Regards,

Robert

<!Session data>

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
J1mbo
Virtuoso
Virtuoso
Jump to solution

With APC UPS the amount of battery time remaining at the shutdown signal can be configured (low battery duration) to over 24 minutes on the 750RM I used to test this. I would suggest increasing the time much beyond five minutes.

Also it is worth thinking about the return battery capacity, i.e. how much the batteries can be charged before the UPS will re-enable output.

If the UPS is fully depleted and AC is restored, provided the BIOS is configured to always-on on the attached server, the server will resume (and start the VMs, eventually). However if AC is again interrupted, which in my experience of power failures is quite likely, there may not be enough capacity to complete the boot and resume, and then commence an orderly shutdown again. Hence specifying a high retun battery capacity, say 45%, and a return delay of a minute to filter further may be sensible.

All VMs need to be set to shutdown or suspend in the policy, as you have found. It is worth noting that the time between each can be reduced from the default of 60 seconds and that provided vmware tools are installed, the routine progresses to the next VM immediately that a shutdown or suspend is completed. Running these concurrently could well take longer though since there would be massive disk contention generated for what is basically sequential write IO.

One advantage of the Windows Powerchute software is that is will shut down the (virtual)machine it's running on after running whatever scripts are set, in this way the issue of sleep-resume you mention is presumably side-stepped.

Hope that helps.

View solution in original post

0 Kudos
59 Replies
DSTAVERT
Immortal
Immortal
Jump to solution

Have a look at the following. There are many references to UPS in the forums.

http://communities.vmware.com/message/1418614#1418614

http://communities.vmware.com/docs/DOC-9531

-- David -- VMware Communities Moderator
0 Kudos
0j3r3my0
Contributor
Contributor
Jump to solution

Yes I've checked those references, but these entries are for free scripts so these wasn't very helpful . In our case we have bought the PowerChute software from APC and I could not find helpful references for our PowerChute.<!Session data>

0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

If there is network access to the APC device you should be able to shut down the guests with the Powerchute software installed on the guests. Unless there is something specific for ESXi from APC you will need to use the scripts to shut down ESXi.

-- David -- VMware Communities Moderator
0 Kudos
mikefoley
VMware Employee
VMware Employee
Jump to solution

As already mentioned, you need to have PowerChute run a script to tell ESXi that it needs to shutdown.

I do this at home with a Windows laptop that's connected to the same UPS as the ESXi box. When Windows detects that it's on battery, it runs a Powershell script that shuts the ESXi server down. Works great, very reliable.

mike

mike

0 Kudos
0j3r3my0
Contributor
Contributor
Jump to solution

In our case the PowerChute we bought is a "PowerChute PCNS for ESXi" version and it has to be installed on the vMA of the ESXi. And we got a documentation that helped us configure "<![endif]><![if gte mso 9]> Allow virtual

machines to start and stop automatically with the system" with the vSphere but the guest machines still haven't shutted down gracefuly. So that version of the Powerchute should start a command that shuts down the ESXi, but it still doesn't work.

Any more idea?

Thank you for the answers!

Robert

0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

You must make sure you have VMware tools installed on all VMs

From a knowledge base article at APC

In order for PowerChute Network Shutdown to be able to shut down the virtual machines (VM) on

VMware ESXi or ESX, you need to configure a "Guest Shutdown" on each VM.

To configure guest virtual machines (VM) to shut down with the host:

1. Go to the vCenter Server, and for each ESXi host, select "Virtual Machine Startup/Shutdown".

2. Change the Virtual Machine Shutdown setting from "Turn off" to "Guest Shutdown".

3. Specify the shutdown order, by arranging guest VMs in "Startup Order". (Shutdown order is the reverse of startup order).

4. Click OK to accept the changes.

5. Change the "Any Order" option to "Manual Startup" for all the VMs.

6. Change the "Startup" settings to "Disabled" for all the VMs.

-- David -- VMware Communities Moderator
0 Kudos
0j3r3my0
Contributor
Contributor
Jump to solution

We have already done these settings before, but the PowerChute still not shuts the ESXi down. These settings seems to be working when we test the ESXi shutdown (or reboot) with the vSphere manually. But when we do testing with the the vMA doesn't send shutdown signal to the ESXi.<!Session data>

0 Kudos
mikefoley
VMware Employee
VMware Employee
Jump to solution

Can you post your script you're using to shutdown the ESXi server?

mike

0 Kudos
0j3r3my0
Contributor
Contributor
Jump to solution

We haven't got any shutdown script, because we expect that the installed Powerchute Network Shutdown (PCNS) will do the ESXi shutdown through the vMA.<!Session data>

0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

Have you set up authentication and added servers to the vMA appliance?

What is the result of vifp listservers from the vMA

-- David -- VMware Communities Moderator
0 Kudos
0j3r3my0
Contributor
Contributor
Jump to solution

I've done the vifp addserver so the listservers gives back the server DNS name and the OS name (ESXi), seems correct.

Robert

0 Kudos
mikefoley
VMware Employee
VMware Employee
Jump to solution

You need to have the PowerChute software run a script to shutdown the ESXi server. Shutting down vMA isn't enough.

mike

mike

0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

Have you set vMA up with stored authentication?

Can you run a command like

vicfg-cfgbackup --server yourservername -s test.tar 

I would have a look through the APC forums.

Alternately I would have a look at the scripts posted earlier.

-- David -- VMware Communities Moderator
0 Kudos
0j3r3my0
Contributor
Contributor
Jump to solution

We are able to initiate firmware backup with the command you suggested with fastpass so we don't have to authenticate ourself any time we perform commands like this.

0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

??????

APC forums.

Go through the documentation again step by step an verify everything.

-- David -- VMware Communities Moderator
0 Kudos
0j3r3my0
Contributor
Contributor
Jump to solution

I've run through the documentation again and checked the settings but I haven't found any forgotten setting in it. I've also checked the forum on the APC site.

Could you tell me how can I check the ESXi logs to find that the ESXi received shutdown signal from vMA. Because in vSphere when I lose the connection during the test I could not see any useful information about the initiated shutdown.

Thank you very much!

Robert

0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

Is vMA on the host you are trying to shut down?

In the Client On the Configuration Tab / Software / Advanced Settings / Syslog

Point your logs to a datastore. It will preserve the log on reboot. You can also use the unsupported console to get to the logs (ALT +F1 type unsupported and enter. type the root password at the prompt)

The logs are in /var/logs.

You may also be able to see realtime messages from the console screen ALT + F12

-- David -- VMware Communities Moderator
0j3r3my0
Contributor
Contributor
Jump to solution

Yes, the vMA is deployed to our single host as a VM which we'd like to shutdown.

0 Kudos
fixitchris
Hot Shot
Hot Shot
Jump to solution

I don't think you'll like the answer:

http://nam-en.apc.com/cgi-bin/nam_en.cfg/php/enduser/std_adp.php?p_faqid=10727&p_created=1256050063&...

If you do have the free esxi then starting at 3.5u4 the SDK's used to interact with the host became read-only. Operation such as shutting down VMs and the host are write operations.

There are some alternatives, but I would recommend purchasing the standard license for your host. This actually opens up doors to a lot of free pieces of code including VIX API, VDDK API, VIM, POWERCLI.

Otherwise, have powerchute launch a script instead of shutting down the OS (should be capable of this , I hope). This script will create a file in a shared folder, accessible by all VMs. Let's call the file "IAMDYING.NOW". All other VMs will run a scheduled task every minute and check for this file. If the file exists then every VM will shut itself down either with the "shutdown" or "reboot" command (windows and linux respectively). As for the host.... well it will just die when the UPS powers itself off not to drain the battery. If your BIOS is set to recover on AC failure then the host will come back on and go through the motions. You got your basics covered.

my past work on this topic: http://communities.vmware.com/thread/205306?tstart=0

0 Kudos