Appendix 5: Scripted Power Control Tools

The cluster administration console (HPC Cluster Manager) includes actions to start, shut down, and restart compute nodes remotely: Start, Reboot, and Shut Down in the Actions pane in Node Management. These actions are linked to the CcpPower.cmd script, which performs these power control operations, with the exception of the start action that is not enabled, by using operating system commands.

You can replace the default operating system and Windows Management Instrumentation (WMI) commands in CcpPower.cmd with custom power control scripts, such as Intelligent Platform Management Interface (IPMI) scripts.

Important

As a best practice for security in an HPC cluster, if you replace commands in CcpPower.cmd with custom power control scripts, we recommend that you track the location of your scripts and protect them from tampering.

CcpPower.cmd is available in the Bin folder of the installation path for HPC Pack. For example, if you are using the default installation path for HPC Pack 2008 R2, the file is available here:

C:\Program Files\Microsoft HPC Pack 2008 R2\Bin\CcpPower.cmd

The default CcpPower.cmd file has the following code.

@setlocal  
@echo off  
if L%1 == Lon goto on  
if L%1 == Loff goto off  
if L%1 == Lcycle goto cycle  
echo "usage:CcpPower.cmd [on|off|cycle] nodename [ipaddress]"  
goto done  
  
:on  
exit /b 1  
goto done  
  
:off  
wmic /node:"%2" os where Primary=TRUE call Shutdown  
goto done  
  
:cycle  
wmic /node:"%2" os where Primary=TRUE call Reboot  
goto done  
  
:done  
exit /b %ERRORLEVEL%  
endlocal  

To enable scripted power control tools for the Shut Down and Reboot actions in HPC Cluster Manager, replace the entries of the commands in the :off section and the :cycle section of CcpPower.cmd with the name and path of your tool or tools for shutting down and restarting the node. To enable tools for the Start action, replace the entry of the command in the :on section with the name and path of your tool for this action.

Also, you must associate a management IP address with each compute node in the cluster (for example, the IP address for the Base Management Controller (BMC) of the compute node). The management IP address is the third string (%3) that is passed to the CcpPower.cmd script by HPC Cluster Manager and should be provided to your power control tools when you add them in CcpPower.cmd. A management IP address can be associated with each compute node in the cluster in the following ways:

  • When compute nodes are deployed by using a node XML file, by specifying the ManagementIpAddress attribute for each node. For more information, see Appendix 2: Creating a Node XML File, earlier in this guide.

  • By using the Set-HpcNode cmdlet in Windows HPC PowerShell with the ManagementIpAddress parameter. For more information about this cmdlet, see the Windows HPC PowerShell Reference. Alternatively, in Windows HPC PowerShell, type Get-Help Set-HpcNode.