HP Scripting Toolkit for Linux User Manual

5 (1)

HP Scripting Toolkit for Linux User Guide

Abstract

This document provides information about the Scripting Toolkit for Linux utilities and how best to use the Scripting Toolkit for Linux to configure HP ProLiant servers and BladeSystem infrastructure in a Linux environment. This document is intended for IT experts with experience in scripting operating system installations and configuring HP ProLiant servers and BladeSystem infrastructure.

HP Part Number: 415597-407

Published: October 2012

Edition: 16

Notices

© Copyright 2005, 2012 Hewlett-Packard Development Company, L.P.

The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.

Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license.

Microsoft, Windows, and Windows Server are U.S. registered trademarks of Microsoft Corporation. Intel is a trademark of Intel Corporation in the U.S. and other countries.

Contents

 

1 Introduction...............................................................................................

7

Scripting Toolkit........................................................................................................................

7

Minimum requirements..............................................................................................................

7

2 Deployment using the Scripting Toolkit..........................................................

8

Deployment overview................................................................................................................

8

Sample deployment procedure...................................................................................................

8

Creating a network share......................................................................................................

9

Capturing a reference configuration from the source server........................................................

9

Creating an ISO image to be written to media.......................................................................

10

Configuring the target server...............................................................................................

10

Installing the operating system.............................................................................................

11

3 Booting and OS installation.......................................................................

12

SYSLINUX..............................................................................................................................

12

Booting using PXE...................................................................................................................

12

Setting up a TFTP server......................................................................................................

13

Populating the TFTP directory share......................................................................................

14

Setting up a DHCP server...................................................................................................

14

Booting from a USB drive key...................................................................................................

15

Performing an unattended operating system installation...............................................................

15

System hardware configuration............................................................................................

15

Microsoft Windows install_win.sh sample script.....................................................................

19

Red Hat Linux anaconda-ks.cfg sample file............................................................................

19

4 Scripting Toolkit utilities.............................................................................

22

Native package formats..........................................................................................................

22

Syntax conventions.................................................................................................................

22

Utility online help...................................................................................................................

22

Using Scripting Toolkit utilities..................................................................................................

23

Using REBOOT.......................................................................................................................

23

REBOOT command-line syntax.............................................................................................

23

REBOOT command-line arguments.......................................................................................

23

REBOOT return codes.........................................................................................................

23

REBOOT command-line examples........................................................................................

24

Using SETBOOTORDER...........................................................................................................

24

SETBOOTORDER command-line syntax.................................................................................

24

SETBOOTORDER command-line arguments...........................................................................

24

SETBOOTORDER return codes.............................................................................................

24

SETBOOTORDER command-line examples.............................................................................

24

Using STATEMGR...................................................................................................................

24

STATEMGR command-line syntax.........................................................................................

25

STATEMGR command-line arguments....................................................................................

25

STATEMGR return codes.....................................................................................................

25

STATEMGR command-line examples.....................................................................................

25

Using RBSURESET...................................................................................................................

25

RBSURESET command-line syntax.........................................................................................

26

RBSURESET command-line arguments...................................................................................

26

RBSURESET return codes.....................................................................................................

26

Using BOOTEXTRACT ............................................................................................................

26

BOOTEXTRACT command-line syntax...................................................................................

26

BOOTEXTRACT command-line arguments..............................................................................

26

BOOTEXTRACT return codes...............................................................................................

26

Contents 3

Using HPDISCOVERY..............................................................................................................

26

HPDISCOVERY command-line syntax....................................................................................

27

HPDISCOVERY command-line arguments..............................................................................

27

HPDISCOVERY return codes................................................................................................

27

HPDISCOVERY command-line examples................................................................................

27

Using IFHW...........................................................................................................................

27

IFHW command-line syntax.................................................................................................

27

IFHW command-line arguments...........................................................................................

27

IFHW return codes.............................................................................................................

28

IFHW command-line examples............................................................................................

28

Expression operators and terms...........................................................................................

28

Expression examples..........................................................................................................

29

Using HWQUERY...................................................................................................................

29

HWQUERY command-line syntax.........................................................................................

29

HWQUERY command-line arguments...................................................................................

29

HWQUERY return codes.....................................................................................................

29

HWQUERY command-line examples....................................................................................

30

Using CONREP......................................................................................................................

30

CONREP command-line syntax............................................................................................

31

CONREP command line arguments......................................................................................

31

CONREP return codes........................................................................................................

31

CONREP screen output.......................................................................................................

31

CONREP -s (Store to Data file) Example usage for HP ProLiant servers not using the Oxx ROM

 

family...............................................................................................................................

32

CONREP –l (Load from Data File) Example Usage for HP ProLiant servers not using the Oxx ROM

 

family...............................................................................................................................

32

CONREP Data File Sample Contents for HP ProLiant servers not using the Oxx ROM family.........

32

CONREP command file contents for HP ProLiant servers not using the Oxx ROM family...............

33

Using HPRCU.........................................................................................................................

34

HPRCU command-line syntax...............................................................................................

34

HPRCU command line arguments.........................................................................................

35

HPRCU return codes...........................................................................................................

35

HPRCU sample XML format.................................................................................................

35

Using HPACUSCRIPTING.........................................................................................................

36

Capturing a configuration...................................................................................................

36

Using an Input script...........................................................................................................

36

Creating an ACU script file.................................................................................................

37

Sample custom input script.............................................................................................

37

Script file options...............................................................................................................

38

Control category...........................................................................................................

39

Action mode............................................................................................................

40

Method mode..........................................................................................................

40

Controller category.......................................................................................................

40

Controller................................................................................................................

40

ChassisName..........................................................................................................

41

ClearConfigurationWithDataLoss................................................................................

41

LicenseKey, DeleteLicenseKey.....................................................................................

41

PreferredPathMode...................................................................................................

41

ReadCache, WriteCache...........................................................................................

41

RebuildPriority, ExpandPriority....................................................................................

42

SSPState..................................................................................................................

42

SurfaceScanDelay....................................................................................................

42

Video performance options........................................................................................

42

Array category.............................................................................................................

43

Array......................................................................................................................

43

4Contents

Drive.......................................................................................................................

43

DriveType................................................................................................................

43

OnlineSpare............................................................................................................

44

Logical Drive category...................................................................................................

44

ArrayAccelerator......................................................................................................

44

LogicalDrive.............................................................................................................

44

LogicalDriveSSPState.................................................................................................

44

ParityGroups............................................................................................................

45

PreferredPath...........................................................................................................

45

RAID.......................................................................................................................

45

Sectors....................................................................................................................

45

Size........................................................................................................................

45

SSPAdaptersWithAccess............................................................................................

46

StripeSize................................................................................................................

46

HBA category...............................................................................................................

46

ConnectionName.....................................................................................................

46

HBA_WW_ID..........................................................................................................

47

HostMode...............................................................................................................

47

ACU scripting error messages..............................................................................................

47

Using HPLPCFG......................................................................................................................

51

HPLPCFG command-line syntax............................................................................................

51

HPLPCFG command-line arguments......................................................................................

51

HPLPCFG return codes........................................................................................................

51

HPLPCFG command-line examples.......................................................................................

52

Using LO100CFG...................................................................................................................

52

LO100CFG command-line syntax.........................................................................................

52

LO100CFG command-line arguments...................................................................................

53

LO100CFG return codes.....................................................................................................

53

LO100CFG command-file contents.......................................................................................

53

Using HPQLAREP...................................................................................................................

54

HPQLAREP command-line syntax.........................................................................................

54

HPQLAREP command-line arguments....................................................................................

54

HPQLAREP return codes......................................................................................................

55

HPQLAREP command-line examples.....................................................................................

55

Using HPONCFG...................................................................................................................

56

HPONCFG command-line syntax.........................................................................................

56

HPONCFG command-line arguments...................................................................................

56

HPONCFG return codes.....................................................................................................

57

HPONCFG command file contents.......................................................................................

57

Obtaining an entire configuration....................................................................................

57

Obtaining a specific configuration...................................................................................

58

Setting a configuration...................................................................................................

59

HPONCFG command-line examples.....................................................................................

59

5 Troubleshooting........................................................................................

60

Troubleshooting table..............................................................................................................

60

6 Support and other resources......................................................................

61

Information to collect before contacting HP.................................................................................

61

How to contact HP..................................................................................................................

61

Subscription service................................................................................................................

61

Related information.................................................................................................................

61

Scripting Toolkit support..........................................................................................................

62

Typographic conventions.........................................................................................................

62

HP Insight Remote Support software..........................................................................................

62

Contents 5

7 Documentation feedback...........................................................................

64

Acronyms and abbreviations.........................................................................

65

Index.........................................................................................................

67

6Contents

1 Introduction

Scripting Toolkit

The Scripting Toolkit is a server deployment product for IT experts that delivers an unattended automated installation for high-volume server and BladeSystem infrastructure deployments. This document describes how to best use the Scripting Toolkit to configure HP ProLiant servers and BladeSystem infrastructure. It also contains information about the Scripting Toolkit utilities and how to use them in an unattended environment. This document does not include information about installing the operating system.

CAUTION: Improper use of the Scripting Toolkit utilities can result in loss of critical data. Because of the potential data-loss risk, only individuals experienced in scripting operating system installations and configuring HP ProLiant server hardware should use the Scripting Toolkit utilities. Before using the Scripting Toolkit, all necessary precautions must be taken to ensure that mission-critical systems remain online if a failure occurs.

Minimum requirements

Before beginning the deployment process, be sure to have the following items available:

Scripting Toolkit for Linux

HP Scripting Toolkit for Linux User Guide

A Linux workstation (any Linux distribution)

Scripting Toolkit

7

2 Deployment using the Scripting Toolkit

Deployment overview

The Scripting Toolkit includes a set of utilities for configuring and deploying servers in a customized, predictable, and unattended manner. These utilities enable you to duplicate the configuration of a source server on target servers with minimal user interaction.

IMPORTANT: HP ProLiant 100 series servers previous to Gen8 do not support all Scripting Toolkit commands. See the following descriptions for utility usage. Commands that are supported might not work as expected. For a better understanding, read each section of the documentation carefully.

You can perform server deployments in many different ways using the Scripting Toolkit, but every deployment must include the following basic steps:

1.Create a network share.

2.Prepare the bootable media (CD/DVD, USB drive key, or PXE).

3.Configure the system and storage hardware on the target server.

4.Perform the operating system installation.

HP also recommends installing the latest version of the HP SPP. To obtain the most current SPP, see the SPP website at http://www.hp.com/go/spp.

IMPORTANT: Not all options can be configured using Scripting Toolkit utilities. Some options must be configured manually or with other configuration utilities, which are available online, before they can be used with the Scripting Toolkit. For more information on configuration, see the option documentation.

Sample deployment procedure

The following procedure is a case study of a typical deployment. This procedure assumes that you are performing a media-based installation and that you want to replicate an existing server configuration. The process described in this section can vary depending on your specific requirements.

This section provides a simple overview of a basic deployment, but the flexibility of the Scripting Toolkit enables you to do much more. With an understanding of the basic steps and your own deployment environment, you can use the Scripting Toolkit to further customize and automate the deployment process. For information on automating deployments, see “Booting and OS installation” (page 12).

8Deployment using the Scripting Toolkit

HP Scripting Toolkit for Linux User Manual

Creating a network share

To create a network share:

1.Download the appropriate Scripting Toolkit package from the Scripting Toolkit website at http://www.hp.com/go/ProLiantSTK.

2.Extract the package on a common server that resides on the same network as the servers to be deployed.

3.Use the Linux NFS Server Configuration Tool to share the directory in which you extracted the Toolkit package and to assign read and write permissions for all hosts.

Capturing a reference configuration from the source server

Procedure 1

1.At the source server, boot the media (CD/DVD, USB drive key, or PXE) that contains the custom Linux Toolkit image.

2.At the boot prompt, type bash, and then press Enter. When the process is complete, a command prompt appears.

3.Load the network drivers using the loadnet script:

/loadnet.sh

4.Load appropriate storage controller drivers: modprobe -f cciss

Sample deployment procedure

9

5.To add a new device driver name: modprobe —f hpsa

6.Load the channel interface driver for iLO:

insmod /opt/hp/hp-ilo/bin/`uname -r`/hp_ilo.ko

7.Mount the network share: mkdir /mnt/toolkit_share

8.Capture a hardware discovery report using the HPDISCOVERY utility: cd /mnt/toolkit_share/utilities

9.Capture the system BIOS configuration using the CONREP utility: cd /mnt/toolkit_share/utilities

./conrep -s -f/mnt/toolkit_share/data_files/conrep.dat

10.Capture the Smart Array configuration using the ACU utility: cd /mnt/toolkit_share/utilities/hpacuscripting

./hpacuscripting -c /mnt/toolkit_share/data_files/hpacuscripting.dat

11.Capture the iLO configuration using the HPONCFG utility: cd /mnt/toolkit_share/utilities

./hponcfg -w /mnt/toolkit_share/data_files/hponcfg.dat

12.Edit the iLO configuration report to create an iLO configuration script:

vi /mnt/toolkit_share/data_files/hponcfg.dat

Unmount the network share

umount /mnt/toolkit_share

13. Reboot the source server, and then eject the Toolkit CD.

Creating an ISO image to be written to media

The mkisofs command is used to create an ISO image. The following table describes the arguments used with this command.

Argument

Description

-o linuxbootCD.iso

This argument is the output of the mkisofs command, the ISO file.

-b isolinux/isolinux.bin

This argument sets isolinux.bin as the bootloader.

-V LinuxBootCD

This argument sets the volume label of the CD.

./linuxbootCD

This argument specifies the target directory that will be the root of

 

the CD.

To create the ISO image, execute the following command at the shell prompt:

mkisofs -J -iso-level 3 -R -L -o linuxbootCD.iso \ -b isolinux/isolinux.bin -c isolinux/boot.cat \ -V LinuxBootCD \

-no-emul-boot -boot-load-size 4 \ -boot-info-table \

./linuxbootCD

Now, the ISO file can be written to a CD.

Configuring the target server

1.At the target server, boot the media that contains the custom Scripting Toolkit for Linux image.

10 Deployment using the Scripting Toolkit

2.At the boot prompt, type bash and then press Enter. When the process is complete, a command prompt appears.

3.Load the network drivers using the loadnet script:

/loadnet.sh

4.Load appropriate storage controller drivers: modprobe -f cciss

5.Load the channel interface driver for iLO:

insmod /opt/hp/hp-ilo/bin/`uname -r`/hp_ilo.ko

6.Mount the network share: mkdir /mnt/toolkit_share

7.Apply the system BIOS configuration using the CONREP utility:

./conrep -l -f/mnt/toolkit_share/data_files/conrep.dat

8.Apply the Smart Array configuration using the ACU utility: cd /mnt/toolkit_share/utilities/hpacuscripting

9.Apply the iLO configuration using the HPONCFG utility: cd /mnt/toolkit_share/utilities

10.Unmount the network share: umount /mnt/toolkit_share

11.Insert the operating system CD.

12.Reboot the server to run the operating system installation.

Installing the operating system

For information on performing an unattended operating system installation, see “Booting and OS installation” (page 12). For additional information, see the following resources:

Operating system documentation

Kickstart or AutoYAST documentation

Sample deployment procedure

11

3 Booting and OS installation

SYSLINUX

SYSLINUX is a free third-party bootloader available on the SYSLINUX web page at http:// syslinux.zytor.com/index.php.

SYSLINUX is a suite of programs that perform various boot functions. The Scripting Toolkit uses the following bootloader programs:

isolinux.bin—Boot from ISO media.

pxelinux.0—Boot using PXE protocol.

ldlinux.sys—Boot from a USB drive key.

The bootloaders each require a configuration file to run:

isolinux.cfg—Use when booting from ISO media.

default—Use when booting using PXE.

syslinux.cfg—Use when booting from a USB drive key.

In the boot files (isolinux.cfg, default, and syslinux.cfg), the following options are supported in the append statements.

Option

Description

sstk_mount=<device>

This command specifies the device node or name to mount;

 

for example, /dev/hdc or 10.0.0.1:/nfs_bootstrap

sstk_mount_type=<mount type>

This command specifies the file system type of the device;

 

for example, nfs, vfat, or iso9660

sstk_mount_options=<mount options>

This command specifies the options for mounting the device;

 

for example, ro, or ro,nolock for NFS

sstk_script=<script filename>

This command specifies the administrator-created script

 

that executes to continue the process. Typically, the script

 

uses Toolkit tools to configure and update the system, and

 

then begins an operating system installation.

network=1

This command causes the bootstrap script to load network

 

drivers and use DHCP to acquire a network address.

The bootstrap script included with the Toolkit performs the following commands:

mount -t $sstk_mount_type $sstk_mount /mnt/main -o $sstk_mount_options

exec /mnt/main/$sstk_script

For more information about SYSLINUX usage, see the SYSLINUX web page at http:// syslinux.zytor.com/index.php

Booting using PXE

A basic understanding of DHCP, PXE, and TFTP is required to perform the procedure described in this section.

Examples in this section might not be specific to your operating system environment. For more information about your particular environment, see the Linux system administrator's guide.

The following figure illustrates a simplified Scripting Toolkit PXE boot.

12 Booting and OS installation

Setting up a PXE boot environment requires the following general steps:

1.Set up a DHCP server with the appropriate options.

2.Set up a TFTP server with the appropriate options.

3.Populate the TFTP directory share with the Scripting Toolkit boot components.

These steps assume that a Linux workstation is used as the DHCP/TFTP server. You might need to download additional components and adapt the following instructions to suit your environment.

Setting up a TFTP server

Most Linux installations include a TFTP server and an automated method of launching the server upon receiving a TFTP request. The parent process for detecting a TFTP request and launching the TFTP server is called xinetd. However, you might have to enable the TFTP service. The TFTP file is located in the /etc/xinetd.d/ directory. The following is a sample TFTP file:

#default: off

#description: The tftp server serves files using the \

#trivial file transfer protocol. The tftp protocol is \

#often used to boot diskless workstations, download \

#configuration files to network-aware printers and to \

#start the installation process for some operating systems. service tftp

{

socket_type = dgram protocol = udp wait = yes

user = root

Booting using PXE 13

server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = yes

per_source = 11 cps = 100 2

}

In this example, disabled is the default setting, and /tftpboot is the root directory for all client access.

To enable the TFTP service on your server, edit the disable line to read:

disable = no

Populating the TFTP directory share

Use the /tftpboot directory from the “Setting up a TFTP server” (page 13) section as the directory where TFTP clients get their files. To populate the TFTP directory share:

1.Create a /tftpboot directory, if needed.

2.Copy the necessary boot files to the /tftpboot directory:

pxelinux.0 (the SYSLINUX binary used for PXE boot)

initrd.img (the Linux file system)

vmlinuz (the Linux kernel)

3.Create a PXELINUX configuration file subdirectory called /tftpboot/pxelinux.cfg.

4.Copy the default file (the boot configuration used by pxelinux.0) into the /tftpboot/ pxelinux.cfg/ directory.

The tftpboot directory should now contain the following items:

/tftpboot/pxelinux.0

/tftpboot/initrd.img

/tftpboot/vmlinuz

/tftpboot/pxelinux.cfg/default

Setting up a DHCP server

To set up a DHCP server, create and edit a dhcpd.conf file in the /etc directory of your server. The following is a sample dhcpd.conf file:

allow booting;

allow bootp;

ddns-update-style interim;

[You must customize the file by inserting the appropriate DHCP directives, IP ranges, subnet masks, and so on here.]

next-server IP_ADDRESS_OF_TFTP_SERVER;

filename "pxelinux.0";

The next-server command tells the DHCP client where to send the TFTP get request.

The filename command tells the DHCP client which file to get. In this example, the file is pxelinux.0.

When you have finished creating the dhcpd.conf file, restart the DHCP server:

/etc/init.d/dhcpd restart

14 Booting and OS installation

Booting from a USB drive key

Some applications require the use of a writable medium. While booting from CD is not suitable for this purpose, a USB drive key provides the ideal medium as a writable medium.

NOTE: Booting from a USB drive key is supported only on certain HP ProLiant servers. For more information, see the HP SPP website at http://www.hp.com/go/spp.

To set up a USB drive key to boot the Scripting Toolkit environment:

1.Download ss_toolkit.linux.tar.gz@9.xx_pubsw-linux_en from http:// www.hp.com.

Extract the file to a directory of your choice. (The following example uses /Toolkit).

2.Make a directory, extract the files, and then change the directory to the extracted toolkit directory.

mkdir -p /Toolkit

tar xfz ss-scripting-toolkit-linux-9.xx.tar.gz -C /Toolkit cd /Toolkit/ss-scripting-toolkit-linux-9.xx

3.Enter the following command on the BASH command-line prompt:

./mkusbkey.sh /dev/XXX

where XXX is the device node of your USB drive key.

If you do not know the device node associated with your USB drive key, run the fdisk –l command to view the devices available to the operating system.

If the script creates the key successfully, the following message appears:

USB Key created successfully on device /dev/XXX

Performing an unattended operating system installation

Sample scripts are provided with the Scripting Toolkit to simplify the installation process. These scripts are used for the following:

System hardware configuration

Operating system preinstallation configuration

However, these scripts must be modified for your particular environment.

System hardware configuration

The sample install_rhel4.sh script performs many hardware configuration tasks, including:

Copying all Scripting Toolkit utilities from the network share to the target server

Running hardware discovery to determine server type

Obtaining server ID information from the hardware discovery file

Copying server-specific configuration script and data files from the network share

Loading drivers for storage controllers and any other devices that must be configured

Running the CONREP utility

Running the HPACUSCRIPTING utility, if needed (this action is server-specific)

Running any other configuration utilities

Running hardware discovery to determine the boot controller

Obtaining the device node of the boot controller (this information is required for the disk-carving portion of the operating system setup)

Running the operating system-specific setup script

Booting from a USB drive key 15

The scripting for these steps must be adapted to your server deployment process. In particular, be sure to change the IP address and path of the NFS server to match your environment. You might also need to make other modifications, such as adding extra configuration steps (for instance, running HPONCFG to configure iLO) or additional servers.

The sample install_rhel4.sh script is similar to the following:

#!/bin/bash

##this script's methods work for RHEL 5

##SAMPLE. Change the NFS mount points to match your environment export NFS_TOOLKIT_DIR=10.0.0.1:/TOOLKIT

##Internal Variables, do not modify

export TOOLKIT=/TOOLKIT export NFS_MAIN=/mnt/nfs

export HPDISCOVERY_FILE=/TOOLKIT/hpdiscovery.xml export SERVERNAME=

export BOOTDEVNODE= clear

echo "*** Performing RHEL4 installation ***"

echo "Mounting NFS share" mkdir ${NFS_MAIN}

mount -t nfs ${NFS_TOOLKIT_DIR} ${NFS_MAIN} -o ro,nolock if [ $? != 0 ]; then

echo "Unable to mount NFS share, make sure you updated the $0 script with the location of your NFS server."

exec /bin/bash fi

echo "Copying over toolkit scripts and utilities from NFS share" cd ${TOOLKIT}

cp -a ${NFS_MAIN}/scripts/* ${TOOLKIT} cp -a ${NFS_MAIN}/utilities/* ${TOOLKIT} cp -a ${NFS_MAIN}/data_files ${TOOLKIT} echo ""

echo "Loading storage drivers for hardware"

./load_modules.sh echo ""

echo "Pausing to allow drivers to finish loading" sleep 15

echo ""

echo "Configure server"

##run hardware discovery

./hpdiscovery -f ${HPDISCOVERY_FILE}

##use hwquery to fetch the SystemName from hardware discovery file. ( extra " " are required )

export "`./hwquery ${HPDISCOVERY_FILE} allboards.xml SERVERNAME=SystemName`";

echo "Server Type: ${SERVERNAME}" case "${SERVERNAME}" in "ProLiant DL380 G4" )

# Apply System Configuration

./conrep -l -fdata_files/dl380g4_conrep.dat

# Apply Array Configuration for Smart Array 6i Controller if present

16 Booting and OS installation

./ifhw ${HPDISCOVERY_FILE} allboards.xml "PCI:Smart Array 6i Controller" 2> /dev/null

if [ $? = 0 ] ; then

cd ${TOOLKIT}/hpacuscripting

./hpacuscripting -i ../data_files/dl380g4_sa6i_hpacuscripting.dat fi

# Apply Array Configuration for Smart Array P600 Controller if present

./ifhw ${HPDISCOVERY_FILE} allboards.xml "PCI:Smart Array P600 Controller" 2> /dev/null

if [ $? = 0 ] ; then

cd ${TOOLKIT}/hpacuscripting

./hpacuscripting -i ../data_files/dl380g4_p600_hpacuscripting.dat fi

## ADD EXTRA DL380 G4 Configuration Steps HERE

;;

"ProLiant BL45p G1" )

./conrep -l -fdata_files/bl45pg1_conrep.dat

# Apply Array Configuration for Smart Array 6i Controller if present

./ifhw ${HPDISCOVERY_FILE} allboards.xml "PCI:Smart Array 6i Controller" 2> /dev/null

if [ $? = 0 ] ; then

cd ${TOOLKIT}/hpacuscripting

./hpacuscripting -i ../data_files/bl45pg1_sa6i_hpacuscripting.dat fi

## ADD EXTRA BL45p G1 Configuration Steps HERE

;;

"ProLiant ML310 G2" )

./conrep -l -fdata_files/ml310g2_conrep.dat

./ifhw ${HPDISCOVERY_FILE} allboards.xml "PCI:Intel(R) 6300ESB Ultra ATA Storage/SATA Controller"

if [ $? = 0 ] ; then

echo "Plain SATA found"

# Plain SATA, set BOOTDEVNODE manually since hardware discovery won't find IDE devices

export BOOTDEVNODE=/dev/hda fi

##ADD EXTRA ProLiant ML310 G2 Configuration Steps HERE

;;

##ADD MORE SERVERS HERE

ProLiant* )

echo "No configuration process defined for this ProLiant server" echo "Update $0 with steps for this ProLiant server"

exec /bin/bash

;;

* )

echo "Unrecognized Server" exec /bin/bash

;;

esac

## CONTINUE COMMON INSTALL PROCESS cd ${TOOLKIT}

echo "Pausing to allow drivers to catch up" sleep 5

Performing an unattended operating system installation

17

echo ""

echo "Rerun hardware discovery to find boot device"

./hpdiscovery -f ${HPDISCOVERY_FILE}

##use hwquery to fetch the boot dev node from hardware discovery file. if [ -z ${BOOTDEVNODE} ]; then

export `./hwquery ${HPDISCOVERY_FILE} allboards.xml BOOTDEVNODE=DevNode` fi

echo "Boot Device=${BOOTDEVNODE}" if [ -z ${BOOTDEVNODE} ]; then

echo "MISSING boot device dev node. Check that the drivers are loaded." exec /bin/bash

fi

ls -al ${BOOTDEVNODE}*

ln -s ${BOOTDEVNODE} /dev/sssd

echo "### Linux Unattended Install using Kickstart ###"

echo "clearing mbr and a few more sectors" dd if=/dev/zero of=/dev/sssd bs=512 count=32

echo "forcing kernel to re-read partition table" sfdisk --re-read /dev/sssd

sleep 5

echo "landing mbr"

dd if=${NFS_MAIN}/linux_unattend/generic.mbr of=/dev/sssd bs=512 count=1 echo "create new 256M FAT16 partition using sfdisk"

echo "0,256,6,*" | sfdisk -uM -D /dev/sssd

echo "forcing kernel to re-read partition table" sfdisk --re-read /dev/sssd

sleep 5

##make symlink for first partition, usually sda1 or c0d0p1

if test -e ${BOOTDEVNODE}1 ; then ln -s ${BOOTDEVNODE}1 /dev/sssd1 elif test -e ${BOOTDEVNODE}p1 ; then ln -s ${BOOTDEVNODE}p1 /dev/sssd1 else

echo "Partition 1 missing, check that partition creation succeeded" exec /bin/bash

fi

ls -al /dev/sssd1

cd ${NFS_MAIN}/linux_unattend/rhel4/

echo "landing diskboot.img from RHEL4-disc1/images/" dd if=diskboot.img of=/dev/sssd1

## mount disk

echo "mounting to /mnt/dos" mount -t vfat /dev/sssd1 /mnt/dos

##### MAKE SURE YOU MODIFY syslinux-rh.cfg FOR YOUR ENVIRONMENT #######

cp -a syslinux-rh.cfg /mnt/dos/syslinux.cfg cd ${TOOLKIT}

## unmount disk

18 Booting and OS installation

umount /mnt/dos umount ${NFS_MAIN}

## unmount everything else #umount -a

#echo "Rebooting" #sleep 5 #/bin/reboot c:

Microsoft Windows install_win.sh sample script

The install_win.sh sample script performs many of the same hardware configuration tasks described in “Performing an unattended operating system installation” (page 15).

Additionally, the sample install_win.sh script for Microsoft Windows performs preinstallation tasks, including:

Creating a 2 GB FAT16 primary partition

Formatting the partition for the FAT file system

Creating a boot sector for the partition

Copying the FreeDOS operating system to the new C drive

Copying the Windows installation sources, the $oem$ directory, and unattend.txt files to the C drive

To use the install_win.sh sample script to install Microsoft Windows and install_w2k8.sh sample script to install Windows Server 2008:

1.Create an unattend.txt file by following the instructions in the Microsoft documentation at http://support.microsoft.com/kb/155197. A sample unattend.txt file is included in the windows_unattend directory.

2.Copy the Windows source files to the installation source. In this sample script, the installation source is a NFS file share.

3.Adapt the script to perform the correct hardware configuration, and change the NFS server IP address and path to match your environment.

4.Update the syslinux configuration file (pxelinux.cfg, isolinux.cfg, or syslinux.cfg) to reference the install_win.sh or install_w2k8.sh sample script.

Red Hat Linux anaconda-ks.cfg sample file

The operating system-dependent unattended installation file is not created by the Toolkit utilities. The user must create the file separately. In the following example, bold lines indicate modifications made to fully automate the installation of the operating system.

For a complete description of the options that can be modified in the anaconda-ks.cfg unattended installation file to customize the installation of Red Hat Linux, see the operating system documentation or the Red Hat Enterprise Linux Installation Guide at http://www.redhat.com/docs/ manuals/linux/.

lang en_US

REM *** Modify the network settings to reflect required

REM *** network settings.

network --bootproto dhcp

REM *** The IP address should be the address of the

REM *** Linux repository server. The /SHAREVOL/RedHatCD

REM *** must be shared as an NFS volume.

nfs --server 192.1.1.3 --dir /SHAREVOL/RedHatCD

device ethernet eepro100

Performing an unattended operating system installation

19

keyboard "us" zerombr yes clearpart --Linux part /boot --size 30 part swap --size 128

part / --size 100 --grow install

mouse genericps/2 timezone Etc/GMT-6

#xconfig --server "Mach64" --monitor "generic monitor" skipx

rootpw iscrypted $1$ltK6jzho$7pPbE8WPNAeg44UlXqG27 auth --useshadow --enablemd5

lilo --location partition

reboot

%packages ElectricFence setup filesystem basesystem ldconfig glibc shadow-utils mkkickstart mktemp termcap libtermcap bash

MAKEDEV

SysVinit XFree86-Mach64 ncurses

info grep

XFree86-libs chkconfig XFree86-xfs anacron anonftp fileutils mailcap textutils apache

apmd arpwatch ash

at

20 Booting and OS installation

authconfig

autoconf

automake

yp-tools

ypbind

ypserv

zlib

zlib-devel

%post

The previous example contains a limited list of packages to be installed. Add to this section any other packages to be installed.

The server deployment configuration and operating system installation process is complete.

Performing an unattended operating system installation

21

Loading...
+ 47 hidden pages