SUMMARY
How to shutdown a Unitrends physical appliance cleanly during an unplanned power outage.
Note: Use of a properly sized UPS with a Unitrends Physical appliance is a requirement per the Unitrends Software and Hardware Maintenance and Technical Support Agreement and is also clarified in the Site Preparation Guide for Recovery Series Generation 9 Appliances.
A UPS can only run for a short time (we recommend a minimum 15 minutes of run time minimum battery time). The Unitrends appliance or virtual host supporting a Unitrends Virtual Appliance must be signaled to gracefully shut down once on battery power unless the site is supplemented by generator backup. The UPS will wake the appliance when power has returned.
Unitrends has integrated APC brand-compatible UPS management software in our build. Only these UPS are compatible. This is possible when using APC brand (or APC software compatible) UPS systems connected directly to the Unitrends appliance via USB and follow this KB to enable automation during power loss.
ISSUE
During a power outage, the Unitrends physical appliance needs to be shutdown cleanly. This article outlines how to implement this via APC UPS software solutions included with the product for compatible UPS.
RESOLUTION
A clean shutdown from an APS UPS can be implemented for either CentOS 6 or CentOS 7, however, the procedure varies based on the Operating System.
First, determine which version of CentOS Linux your Unitrends physical appliance is running, following the steps in the kb article How can I tell my version of CentOS Linux?
Quick links:
How to set up a APC UPS shutdown for CentOS7
How to set up a APC UPS shutdown for CentOS6
NOTE: The APC UPS that detects power loss and sends us the UPS signal need not be the same device that powers the appliance itself. Many companies will operate other brands of UPS or have rack-level or datacenter lever battery power already in place. Most of these systems won't be able to communicate with a Unitrends appliance to signal safe shutdown without expensive UPS central servers and often custom scripting. To work around this issue, you can power the appliance from a site-level UPS, but then connect a small retail APC brand UPS costing under $100US to the appliance's USB port and a power source to use as a signaling system. This costs less than most UPS vendors charge for a management license for central administration.
CentOS 7 APC UPS shutdown procedures
Follow the procedure to set up APC UPS support on a CentOS 7 Unitrends physical appliance.
- The APC ups must be directly connected to the Unitrends physical appliance via a USB using a USB cable provided by the APC UPS vendor. The APC UPS must be connected prior to running the setup utility.
- If the Unitrends physical appliance is not a CentOS 7 system, stop here and see instructions for CentOS6. If the UPS is not connected to the Unitrends physical appliance, stop here and complete step 1. This process will not work if the prerequisites are not met.
- Access the Unitrends physical appliance remotely using PuTTY. PuTTY will provide command line access to the system. Use the following command to verify the APC is connected using USB:
# ls /dev/usb | grep hid
Note: If nothing shows after running this command, please try a different USB port on the appliance. You should see a result looking similar to, "hiddev0". -
Go to UI and select the button "Activate APC UPS" at CONFIGURE --> Edit --> Advanced --> Support Toolbox.
CentOS 6 APC UPS shutdown procedures
Follow the procedure to set up APC UPS support on a CentOS 6 Unitrends physical appliance.
- The APC ups must be directly connected to the Unitrends physical appliance via a USB using a USB cable provided by the APC UPS vendor. The APC UPS must be connected prior to running the setup utility.
- If the Unitrends physical appliance is not a CentOS 6 system, stop here and see instructions for CentOS7. If the UPS is not connected to the Unitrends physical appliance, stop here and complete step 1. This process will not work if the prerequisites are not met.
- Access the Unitrends physical appliance remotely using PuTTY. PuTTY will provide command line access to the system. Use the following command to verify the APC is connected using USB:
# ls /dev/usb | grep hid
Note: If nothing shows after running this command, please try a different USB port on the appliance. You should see a result looking similar to, "hiddev0". - Download the setup utility from the Unitrends site as below.
# cd /tmp
# wget https://sftp.kaseya.com/utilities/apc/gd-2.0.35-11.el6.x86_64.rpm
# yum localinstall --nogpgcheck gd-2.0.35-11.el6.x86_64.rpm
# wget https://sftp.kaseya.com/utilities/apc/apcConfig.sh
# chmod +x apcConfig.sh - Execute the setup utility, then start the apcupsd service.
# ./apcConfig.sh # service apcupsd start (a reboot will also start the service)
-
Verify the script is running.
# ps aux | grep apc root 4649 0.0 0.0 104988 884 ? Ssl Nov05 0:07 /sbin/apcupsd -f /etc/apcupsd/apcupsd.conf root 22261 0.0 0.0 103248 904 pts/0 S+ 09:37 0:00 grep apc
The script will configure the Unitrends physical appliance to support a shutdown from an APC UPS via USB cable only. If you cannot directly connect your APC UPS to Unitrends via USB, please see below.
Notes about other automated shutdown methods
For the options noted below, please be aware that Unitrends support cannot directly assist in the configuration of these options. Such support would be provided by your UPS or hypervisor vendor (or both). Unitrends will be happy to participate in calls you make to those vendors for any guidance we can provide.
Virtual Appliances:
For Unitrends Backup (virtual appliances) your VM host, network, and storage systems that support your UB deployment must all be protected by a UPS and not exceed their power reserves until the appliance shutdown is complete. If the storage system or connection to it from the hypervisor goes offline while the UB remains online this will typically result in storage corruption. Ensure all components have sufficient power.
Shutdowns of hosted virtual machines typically require the deployment of a machine inside your hypervisor that supports enterprise-class UPS software and will not typically work with a USB cable-connected UPS. For example, VMWare would require the deployment of a machine inside your host that uses APC PowerChute business edition and a network-connected UPS communicating through a UPS server and further including VMWare tools to engage and for VMs to be added to a VMWare shutdown plan.
When scheduling VM host shutdown, Unitrends recommends your UB be the first machine to begin powering down to allow any running backups to be canceled and snapshots consolidated before other machines power down. Equally, it should be your last machine to boot back up after a power event.
SSH power-off options: Some non-APC enterprise UPS systems allow for remote shutdown of other machines. As a vendor-managed Appliance, Unitrends cannot allow the installation of 3rd party software in our units to allow direct remote control. However, some enterprise-class UPS vendors have the capability of issuing remote SSH commands and storing SSH credentials securely. In this situation, most any business class UPS should be capable of powering off a Unitrends appliance remotely. If you cannot connect an APC-compatible UPS directly to your physical Unitrends Appliance using a USB cable for our natively supported shutdown you should contact your UPS vendor to discuss other options. Licensing costs for UPS software may typically exceed the cost of a simple APC UPS being added, however.
Note this would not be an option when following Unitrends security best practices to disable local access via UniView and should be used only when no other options are possible.