Free Webinar
December 20 | 11 am PT / 2 pm ET
Do you want to advance
Windows Server Failover Clustering management skills?
Pick the best WSFC management option!
Speaker: Ivan Ischenko, Pre-Sales Engineer, StarWind

StarWind Virtual SAN® Gentle Shutdown with PowerChute

Published: December 17, 2018

INTRODUCTION

PowerChute is a cross-platform application for managing APC Smart UPS. Functions of this application allow users to manage UPS and prevent the unexpected power outage or plan the hardware maintenance when needed. PowerChute has various editions such as Business, Personal and Network.

PowerChute Personal is to be used for personal UPS with the PowerChute port (such as Back-UPS 650) and to be connected to a single PC via USB.

PowerChute Business uses Smart UPS card connected to the server directly via USB or COM. PowerChute Business allows users to control the whole environment from a single point. To do this, the only thing needed is installation of the PowerChute agent on each machine that will be controlled.

PowerChute Network installed at any place allows users to control the whole system from different machines. The only thing needed is to connect to the web form and manage the environment from it.

PowerChute Network offers two possible methods for environment management – through the pre-installed agents (like Business version) and using the scripts (PowerShell, Power CLI, etc.).

This article is about using PowerChute Network with StarWind Software to prevent data loss in case write-back cache is in use. In combination, the software allows shutting down the VMs and hosts gently and properly.

Pre-Configuring the Servers

PowerChute Network must be installed on each machine where all scripts and commands will be running. There is no need to connect this machine directly to UPS, but the only thing needed here is a pre-configured Network Management Card on APC Smart UPS.

It’s recommended to install PowerChute on a dedicated machine (or server) that has its own UPS.

Installing PowerChute Network

1. Launch the downloaded setup file on the server to install PowerChute Network. The Setup wizard will appear. Read and accept the License Agreement. Click I Agree to continue.

2. PowerChute Network requires a Java Runtime Environment (JRE). Choose the Use the private JRE bundled with PowerChute option. Click Next to continue.

3. Tick the Enable SNMP Support option to manage the PowerChute from a different console. Click Next to continue.

4. Choose Enable VMware Support if VMware is used in the environment. Otherwise tick Do not enable VMware Support. Click Next to continue.

5. Select Browse to modify the installation path if necessary. Otherwise save the path offered by default. Click Next to continue.

6. Click Install to continue.

7. Click Finish to close the wizard.

Configuring PowerChute Network

8. Click Next to continue.

9. Select the appropriate network configuration. Click Next to continue.

10. Specify the connection scenario.

NOTE: If it is a Hyper-V environment, then proceed to step 15.

11. Specify the connection method to the environment (single host or vCenter) if Enable VMware support was selected during installation.

For single host select the Standalone VMware Host option as shown below.

For vCenter select the Host managed by vCenter Server option as shown below.

12. Specify the IP address and credentials of the vCenter

NOTE: Tick the vCenter Server running on a VM option if the vCenter is running on the VM inside the ESXi host.

13. Select the hosts powered by the UPS(s).

14. Specify the Virtualization Settings.

15. Specify the Network Management Card credentials of your APC Smart UPS. Click Next to continue.

16. Click Apply to finish the configuration.

Applying StarWind Maintenance Script

17. StarWind has designed the script which allows users to gently turn off the VMs and hosts, put the StarWind devices into maintenance mode to prevent the data loss and long synchronization process. Here is the instruction on how to apply it:

17.1 Go to Configure Events and click on UPS on Battery Command file.

17.2 Specify the command file for the UPC on Battery event (local or network path can be chosen).

Choose the script file that contains the following (for ESXI):

NOTE: Install Power-CLI to use this script: Log in to StarWind VM and install vSphere PowerCLI on each StarWind virtual machine by adding the PowerShell module (Internet connectivity is required). To do so, run the following command in PowerShell:

For Hyper-V scenario:

NOTE: VMs or Nodes might be needed to install some Windows updates, so it is highly recommended to setup them in the PowerChute console before running this script itself.

NOTE: Allow PowerShell remote session on both hosts to use this script. Setup power off configuration in PowerChute console for all the VMs, then run the following script from PowerChute console (apply the Maintenance mode on StarWind devices).

Exit StarWind Maintenance Mode

To turn off the StarWind maintenance mode, put the following script directly to C:\ and name it as SW_Maintenance_Off.ps1.

CONCLUSION

This technical paper has covered the configuration process of the PowerChute Network and applying StarWind Maintenance Script. The combination of the PowerChute Network software and StarWind Maintenance Script allows users to gently turn off the VMs and hosts, put the StarWind devices into maintenance mode and prevent the impact of unexpected power outage. Users can save their data and avoid long synchronization.