HP ProLiant SL2500 HP Scripting Toolkit 9.60 for Windows User Guide - Page 12

Advanced topics, Overview, Customizing deployment scripts using HPDISCOVERY and IFHW

Page 12 highlights

3 Advanced topics Overview The advanced topics addressed in this section cover some of the most common deployment tasks that can be automated using the Scripting Toolkit. IMPORTANT: The script files and script segments in this section are provided only as examples. You must modify the scripts for your environment. When creating or modifying your own scripts, the pause command is a valuable tool to help you determine that each step of the script is functioning as desired. Customizing deployment scripts using HPDISCOVERY and IFHW Use the HPDISCOVERY utility to determine which devices and capabilities are available in a particular HP ProLiant server. HPDISCOVERY generates an XML-based output file that provides information such as system ROM version, amount of RAM available, and the types of devices present in the system. Then, use the HWQUERY and IFHW (IF Hardware utility) files to query the output file, enabling you to add conditional tests to a script so it performs different operations based on the outcome of the tests. Querying the HPDISCOVERY file based on system name In the following script, the IFHW utility searches the HPDISCOVERY data in the hpdiscovery.xml file for the system name HP ProLiant BL20p. If the system name is found, the script calls the bl20p.cmd file. ifhw .\hpdiscovery.xml allboards.xml HWQ:SystemName eq "ProLiant BL20p" if errorlevel 1 goto NEXT1 call .\BL20p.cmd goto end :NEXT1 ifhw .\hpdiscovery.xml allboards.xml HWQ:SystemName eq "ProLiant DL380 G4" if errorlevel 1 goto NEXT2 call .\ DL380G4.cmd goto end Querying the HPDISCOVERY file to determine the presence of a particular card Using IFHW to detect a particular PCI card or device can be valuable in determining which settings to apply. For example, an array controller used as a boot controller might require a RAID 1 setting, while an optional array controller used for a database (such as a Smart Array 5312 Controller) might require a RAID 5 ADG setting. The following example demonstrates how to use IFHW to detect a particular card or device: REM *** Configure the array controllers by reading the configuration REM *** information in the script file and stamping it onto the array REM *** controllers of the target server echo Configuring the Array Controllers... ifhw .\hpdiscovery.xml allboards.xml PCI:"Smart Array 5i Controller" if errorlevel 1 GOTO NEXT1 .\SSA\bin\hpssascripting.exe -i .\ArraySettings\SA5iArray.ini :NEXT1 ifhw .\hpdiscovery.xml allboards.xml PCI:"Smart Array 6i Controller" if errorlevel 1 GOTO NEXT2 12 Advanced topics

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62

3 Advanced topics
Overview
The advanced topics addressed in this section cover some of the most common deployment tasks
that can be automated using the Scripting Toolkit.
IMPORTANT:
The script files and script segments in this section are provided only as examples.
You
must
modify the scripts for your environment. When creating or modifying your own scripts,
the
pause
command is a valuable tool to help you determine that each step of the script is
functioning as desired.
Customizing deployment scripts using HPDISCOVERY and IFHW
Use the HPDISCOVERY utility to determine which devices and capabilities are available in a
particular HP ProLiant server. HPDISCOVERY generates an XML-based output file that provides
information such as system ROM version, amount of RAM available, and the types of devices
present in the system. Then, use the HWQUERY and IFHW (IF Hardware utility) files to query the
output file, enabling you to add conditional tests to a script so it performs different operations
based on the outcome of the tests.
Querying the HPDISCOVERY file based on system name
In the following script, the IFHW utility searches the HPDISCOVERY data in the
hpdiscovery.xml
file for the system name HP ProLiant BL20p. If the system name is found, the script calls the
bl20p.cmd
file.
ifhw .\hpdiscovery.xml allboards.xml HWQ:SystemName eq "ProLiant BL20p"
if errorlevel 1 goto NEXT1
call .\BL20p.cmd
goto end
:NEXT1
ifhw .\hpdiscovery.xml allboards.xml HWQ:SystemName eq "ProLiant DL380 G4"
if errorlevel 1 goto NEXT2
call .\ DL380G4.cmd
goto end
Querying the HPDISCOVERY file to determine the presence of a particular card
Using IFHW to detect a particular PCI card or device can be valuable in determining which settings
to apply. For example, an array controller used as a boot controller might require a RAID 1 setting,
while an optional array controller used for a database (such as a Smart Array 5312 Controller)
might require a RAID 5 ADG setting. The following example demonstrates how to use IFHW to
detect a particular card or device:
REM *** Configure the array controllers by reading the configuration
REM *** information in the script file and stamping it onto the array
REM *** controllers of the target server
echo Configuring the Array Controllers...
ifhw .\hpdiscovery.xml allboards.xml PCI:"Smart Array 5i Controller"
if errorlevel 1 GOTO NEXT1
.\SSA\bin\hpssascripting.exe -i .\ArraySettings\SA5iArray.ini
:NEXT1
ifhw .\hpdiscovery.xml allboards.xml PCI:"Smart Array 6i Controller"
if errorlevel 1 GOTO NEXT2
12
Advanced topics