Eaton Shutdown Agent SDA Installation and Configuration Guide VMware ESX & ESXi Virtual architecture VMware ESX & ESXi server host and guest operating systems architecture Virtual/ Guest OS 1 (Windows) Applications, Services, etc. Virtual/ Guest OS 2 (Linux) Applications, Services, etc. Virtual/ Guest OS n (Solaris) Applications, Services, etc. SDA Client VMware Server ESX Server Vima 1.0 or vma SDA Client Virtual/ Guest OS 2 (Linux) Applications, Services, etc. Virtual/ Guest OS n (Solaris) Applications, Services, etc. VMware Server ESXi Hypervisor Eaton UPS from the Powerware series Eaton SDA on VMware Installation Guide February 17, 2010
Table of Contents 1. Introduction...3 2. VMware Server configuration...4 3. Installation on VMware ESX server...7 3.1 Prerequisites...7 3.1.1 Network architecture...7 3.2 SDA Installation...8 4. Installation on VMware ESXi server...9 4.1 Prerequisites...9 4.1.1 VIMA/vMA installation...9 4.1.2 Network architecture...9 4.2 VIMA/vMA configuration...10 4.3 SDA Installation...10 4.4 SDA configuration for VMware ESXi...11 Appendix...12 References...12 Complementary information...12 Eaton SDA on VMware Installation Guide Page 2 of 14
1. Introduction The Eaton SDA program is designed as a simple service to be run as a background process on a number of machines. It runs on many different operating systems and is capable of performing a variety of actions, but especially a clean shutdown, on each. This program is controlled by a Shutdown Broadcast Controller (SBC), which commands many agents at once. The SDA service can perform a wide range of actions on a host machine. Its primary action is to shut down the local machine when instructed by the SBC to do so. This action would generally occur in the case of a detected imminent power failure, perhaps detected by the PAM utility. During a brief power outage a computer system could continue normal operation, drawing power from its UPS unit. If, during an extended power outage, that unit reported a low level of battery power, SDA processes running on the machines powered by that unit would be instructed to cleanly shut down their hosts. SDA is designed to be simple in operation, usually requiring no command-line arguments, and operating non-intrusively for extended periods of time on a set of machines. Most of the functionality of the SDA/SBC pair can be controlled from the SBC, since many implementations may not allow for easy access to machines running SDA. Consult the SBC user s guide before deploying SDA. This guide will walk you through the successful installation of SDA on supported VMware ESX and VMware ESXi servers. The process involves installing SDA only once on the appropriate client machine rather on every host and guest machine. The benefits comprises of: Only one binary of SDA client is required to be deployed to manage all virtual machines. Dynamic management of virtual machines configuration with a personalized script. SDA client is tested on VMware virtualization server with two guest operating systems for electrical power events like shutdown and low battery. Eaton SDA on VMware Installation Guide Page 3 of 14
2. VMware Server configuration Before installing Eaton SDA on VMware server, the following configurations have to be made: For automatic OS boot on startup, you must configure the physical machine to do the same. This setting is present in your machine s BIOS. For further information, see specific technical hardware documentation. To allow interactions between physical and virtual machines, VMware tools should be installed on each virtual machine. For further information, see the appropriate VMware Server documentation. For automatic virtual machine boot on VMware server startup the procedure described below should be followed. For VMware ESXi you can configure the automatic startup and shutdown properties of guest operating systems as suspended. For SDA to work properly on VMware ESXi, VIMA/vMA needs to be configured as Automatic Shutdown of guest (VIMA/vMA) when ESXi host is going down and Automatic Startup of guest (VIMA/vMA) when ESXi host is starting. Following procedure will explain the configuration of shutdown and startup properties for both VMware ESX and ESXi From the Virtual Infrastructure Client interface select topmost item ESX or ESXi host server from left hand side tree hierarchy. Then, in the panel displayed on right 1. Select Configuration tab 2. Select Virtual machine startup / shutdown menu -> Click Properties present in right hand corner. Eaton SDA on VMware Installation Guide Page 4 of 14
Following window will appear on screen, Select the check box for the option Allow virtual machines to start and stop automatically with the system. For VMware ESXi, following additional steps have to be performed: Select VIMA/vMA guest machine and click on edit button and configure as shown below (also refer the figure above) Startup Settings Click Use specified settings Startup Delay 10 Seconds Shutdown Settings Click Use specified settings Shutdown delay 30 seconds Note: In the «Properties» page, you also have the possibility to define the Startup Order of your virtual Machines. Start and Stop VMs with the system : Enabled Default Startup Delay : x Seconds Default Shutdown Delay : x Seconds Startup Order : Automatic Startup Eaton SDA on VMware Installation Guide Page 5 of 14
This configuration is illustrated in the following screenshot: Eaton SDA on VMware Installation Guide Page 6 of 14
3. Installation on VMware ESX server VMware ESX controls shutdown and restart functions directly from the administration console, or from an application hosted on the ESX layer. So, we can install Eaton SDA client only on host operating system and control the shutdown of guest and host machine(s). 3.1 Prerequisites The following are the prerequisites: 1. VMware ESX Server Machine with Host having 5 MB free space 2. VMware Infrastructure client with the settings described in VMware Server configuration, installed on a different machine. 3. SDA 1.0 Installer 4. SSH client like putty for installation and configuration 5. SCP Client like WinSCP to upload packages to VMware ESX server 3.1.1 Network architecture All hardware elements must have an operational network configuration that allows them to dialog freely with each other. SDA client uses UDP for communication with the server. Please make sure that the following UDP ports are enabled on ESX server Firewall Open UDP ports 7013, 7014 if you want to go with default Eaton Ports. Example: esxcfg-firewall o 7013,udp,in,sda esxcfg-firewall o 7014,udp,in,sda esxcfg-firewall o 7013,udp,out,sda esxcfg-firewall o 7014,udp,out,sda To configure your VMware ESX Server for the network, please refer to the VMware user manual. Eaton SDA on VMware Installation Guide Page 7 of 14
3.2 SDA Installation The following steps will explain about obtaining the latest version of SDA from the Eaton Web site and its installation on VMware ESX server. Download tar file of SDA for Unix/Linux from the following Eaton Web site: http://powerquality.eaton.com/support/software-drivers/downloads/powervision.asp Click on the appropriate download link of SDA tar file for Unix/Linux. Upload the package on your VMware ESX host environment, with a SCP Client (Example under windows environment: WinSCP) Connect with SSH to the VMware server (Example under Windows environment: Putty). You must have corresponding rights to execute and install programs on VMware ESX. Refer to VMware ESX help manual for further information. In the folder where installation package of SDA is uploaded, add execution right to the package, by typing: chmod 755 package_name E.g. for the package name ShutdownAgent_103_unix.tar type chmod 755 ShutdownAgent_103_unix.tar Untar the install script by using the tar command, example follows tar -xvf ShutdownAgent_103_unix.tar Install SDA by typing./install.sh Go through various installation options and SDA will get installed on the system. VMware is a registered trademark of VMware, Inc. Eaton SDA on VMware Installation Guide Page 8 of 14
4. Installation on VMware ESXi server VMware ESXi does not have administrative console for hypervisor and hence we cannot install SDA on hypervisor system. However we can install SDA on VMware Infrastructure Management Assistant (VIMA 1.0) or on vsphere Management Assistant (vma 4.0) to manage shutdown of the VMware ESXi in case of UPS shutdown and/or power anomalies. We can also configure ESXi to safely suspend or shutdown guest operating system by properly configuring ESXi hypervisor. Thus in this way we just have only one SDA on one guest operating system (VIMA/vMA) and command the safe shutdown of all associated systems. 4.1 Prerequisites The following are prerequisites: 1. VMware ESXi Server Machine 2. VMware Infrastructure Management Assistant VIMA 1.0 or vsphere Management Assistant (vma 4.0) installed as guest. 3. VMware Infrastructure client with the settings described in VMware Server configuration, installed on a different machine. 4. SDA 1.0 Installer 5. SSH client like putty for installation and configuration 6. SCP Client like WinSCP to upload packages to VMware ESXi server 4.1.1 VIMA/vMA installation Please visit http://www.vmware.com/support/developer/vima/ for more information about download and installation of VIMA or vma on ESX/ESXi host machines. 4.1.2 Network architecture All hardware elements must have an operational network configuration that allows them to dialog freely with each other. SDA client uses UDP for communication with the server. Please make sure that the following UDP ports need to be enabled on VIMA/vMA Firewall Open UDP ports 7013, 7014 if you want to go with default Eaton Ports. Example: sudo iptables I INPUT p udp --dport 7013 j ACCEPT sudo iptables I INPUT p udp - dport 7014 j ACCEPT sudo iptables I OUTPUT p udp - dport 7013 j ACCEPT sudo iptables I OUTPUT p udp - dport 7014 j ACCEPT After this save the iptables configuration by running following command sudo service iptables save To configure your VMware ESXi Server for the network, please refer to the VMware ESXi user manual. Eaton SDA on VMware Installation Guide Page 9 of 14
4.2 VIMA/vMA configuration To install SDA on VIMA/vMA administrative privileges are required. Transfer the SDA tar file to VIMA/vMA machine using ssh or download it using ftp. Before installing SDA on VIMA/vMA, machines need to be configured for target servers. For more information about adding target servers, refer Adding Target Servers to VIMA present in VIMA user guide. Command to add target server is sudo vifp addserver <servername> This command will ask for the root password of target server. After this step we need to initialize vi fastpass for use of SDA scripts on the target server, as follows vifpinit <servername> Now SDA installation on VIMA/vMA can be started. 4.3 SDA Installation The following steps will explain about obtaining the latest version of SDA from the Eaton Web site and its installation on VIMA/vMA. Download tar file of SDA for Unix/Linux from the following Eaton Web site: http://powerquality.eaton.com/support/software-drivers/downloads/powervision.asp Click on the appropriate download link of SDA tar file for Unix/Linux. Upload the package on your VIMA/vMA, with a SCP Client (Example under windows environment: WinSCP) Connect with SSH to VIMA/vMA (Example under Windows environment: Putty). You must have corresponding rights to execute and install programs on VIMA/vMA. Refer to VMware ESXi and VIMA/vMA help manuals for further information. In the folder where installation package of SDA is uploaded, add execution right to the package, by typing: sudo chmod 755 package_name E.g. for the package name ShutdownAgent_103_unix.tar type sudo chmod 755 ShutdownAgent_103_unix.tar Untar the install script by using the tar command, example follows sudo tar -xvf ShutdownAgent_103_unix.tar Install SDA by typing Eaton SDA on VMware Installation Guide Page 10 of 14
sudo./install.sh Go through various installation options and SDA will get installed on the system. VMware is a registered trademark of VMware, Inc. 4.4 SDA configuration for VMware ESXi To shutdown ESX/ESXi servers from VIMA/vMA, list of ESXi servers needs to be furnished to SDA. To update server list please follow the procedure described below: 1. Go to SDA installation directory E.g. to move to default installation directory, type cd /usr/powerware/sda 2. Add all ESXi host server list in the file VMwareESXHosts present in the installation directory, use the following command to do it: sudo vi VMwareESXHosts Add the hostname of all the ESXi servers separated by space. Please note that the hostname of the server on which VIMA/vMA is installed should be the last entry in the file. For example, consider that 3 servers having the hostnames 166.99.230.5, ESXi.linuxserverHost1.com and 166.99.230.22 are to be added in the file VMwareESXHosts. 166.99.230.5 is the server having VIMA/vMA as guest on it. Then, the server names should be added in the following sequence in the file: ESXi.linuxserverHost1.com 166.99.230.22 166.99.230.5 This completes the installation and configuration of SDA on VMware ESXi server. Eaton SDA on VMware Installation Guide Page 11 of 14
Appendix References References documents for VMware ESX Server are available on VMware Web site: http://www.vmware.com/support/pubs/vi_pubs.html References documents for VMware tools are available in Installation des VMware tools: «Basic System Administration ESX Server 3.0.1 and Virtual Center 2.0.1» manual, chapter «Installing and Upgrading VMware Tools. Please visit http://www.vmware.com/support/developer/vima/ for more information about download and installation of VIMA or vma on ESXi host machines. Complementary information VMware ESX server 3.5 & 4 Configuration When power events or UPS alerts are generated and SDA receives the shutdown command, SDA starts executing shutdown.sh script file. The script file executes in following manner, also the code is given below. 1. It will check the number of guest operating systems running on that server. 2. It will then start shutting down the guest operating systems one by one, with 2 seconds delay between shutdowns of each guest. 3. After all guest operating systems are down it will start shutdown of the host server. It may be required to modify the shutdown.sh script file to configure SDA client to be configured properly so that it will shutdown all guest operating system and host properly. You can modify the shutdown.sh file to configure shutdown behavior according to your need. To shutdown virtual machines in the order detailed in VIC, you may have to edit and customize the stopvmware function present in the shutdown.sh script file. The script looks like: Eaton SDA on VMware Installation Guide Page 12 of 14
# Customizable VMware ESX shutdown stopvmware() { # Test if we have a VMware ESX v3 setup if [ -x /usr/bin/vmware ] then ESXV3=`/usr/bin/vmware -v grep "ESX Server 3"` ESXV4=`/usr/bin/vmware -v grep "VMware ESX 4"` if [ -n "$ESXV3" -o "$ESXV4" ] then # Get the VM list IFS="" VMLIST=`/usr/bin/vmware-cmd -l` for VM in $VMLIST do echo $VM #read r # Get the VM state VMSTATE=`/usr/bin/vmware-cmd "$VM" getstate awk '{print $3}'` echo $VMSTATE #read r } # Guest OS shutdown if VMSTATE is equal to "on" if [ "$VMSTATE" == "on" ] then /usr/bin/vmware-cmd "$VM" stop trysoft # delay a bit the next sequence sleep 2 fi done # Delay for 1 minute to give the VMs more time # to cleanly shutdown sleep 60 fi fi Eaton SDA on VMware Installation Guide Page 13 of 14
Eaton and Powerware are trade names, trademarks, and/or service marks of Eaton Corporation or its subsidiaries and affiliates. All other trademarks are property of their respective owners. Eaton SDA on VMware Installation Guide Page 14 of 14