Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2089104
  • 博文数量: 519
  • 博客积分: 10070
  • 博客等级: 上将
  • 技术积分: 3985
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-29 14:05
个人简介

只问耕耘

文章分类

全部博文(519)

文章存档

2016年(1)

2013年(5)

2011年(46)

2010年(220)

2009年(51)

2008年(39)

2007年(141)

2006年(16)

我的朋友

分类:

2007-08-16 09:49:51

使用JumpStart快速安装Solaris 
Abstract
Sun Microsystems' Solaris JumpStart technology is used to automate the installation of the Solaris Operating System and other associated software on multiple nodes of a network.

Using Solaris JumpStart software on the Solaris 10 OS for x86/x64 platforms is essentially the same as on Solaris 10 OS for SPARC platforms. However, there are some subtle differences that need to be addressed for correct operation.

This document provides the steps and explanations necessary to set up a JumpStart server for the Solaris 10 OS on a Sun x86/x64 machine, along with configuring JumpStart for two or more clients.

As a general reference, refer to the Sun online document Using Custom JumpStart.


Introduction

This article presents step-by-step procedures for creating a JumpStart server using the Solaris 10 OS for x86/x64 platforms. This version of the Solaris 10 OS is used both for the OS running on the server and for the OS on the JumpStart installation server. Both AMD Opteron and Intel processor-based machines were used as servers and clients with no preference given as to which processor type was used for each.

Instructions are provided to:

  • Create a JumpStart Installation Server
  • Create the Client Configuration Files
  • Share the Installation and Configuration Directories
  • Create the Client tftpboot Files
  • Configure and Run the DHCP Server
  • Perform a Hands-Off JumpStart Installation

Pre-boot Execution Environment (PXE) must be enabled on the clients in order to allow them to boot from the network. On some clients, PXE needs to be enabled in the BIOS.

A bug in the creation of the client boot file is addressed in the Final Clean-Up section.


Solaris JumpStart Procedure

These instructions are for setting up a JumpStart installation server that will install the Solaris 10 OS for x86/x64 platforms on two clients.

In this exercise, the node name of the JumpStart server is stinger2 and its IP address is 172.16.64.194. The default router's IP address is 172.16.64.1. The network address where the JumpStart server resides is 172.16.64.0.

If you need to, you can download the Solaris 10 OS.

1. Create a JumpStart Installation Server

a. Create an installation directory on the server:

# mkdir -p /export/install

b. Put the Solaris 10 OS for x86/x64 platforms DVD in the DVD player on the server. Create the installation server by going to the Solaris_10/Tools directory on the DVD and running the setup_install_server command. The Solaris software is copied to the newly created directory. Specify the absolute path name as the argument.

# cd /cdrom/cdrom0/Solaris_10/Tools  # ./setup_install_server /export/install  Verifying target directory...  Calculating the required disk space for the Solaris_10 product  \|/-\|/-  Calculating space required for the installation boot image  \|/-\|/-  Copying the CD image to disk...  \|/-\|/-  Copying Install Boot Image hierarchy...  \|/-\|/-  Copying /boot x86 netboot hierarchy...  \|/-\|/-  Install Server setup complete  #

c. Verify that the install directory has been populated.

  # du -sk /export/install  3083278 /export/install

d. Remove the DVD from the DVD player.

  # cd /;eject

Create the Client Configuration Files

The client configuration files are used to control a custom JumpStart installation.

a. Create a configuration directory where the files will reside:

  # mkdir /export/config

b. Create the sysidcfg file:

The first file to create is the sysidcfg file. This file must be properly formatted with correct information or the file is ignored and the hands-off JumpStart installation is aborted. The installation then defaults to the standard Solaris interactive installation.

A JumpStart client looks for a file named sysidcfg before the OS installation begins. This file must be named "sysidcfg", so in order to have multiple versions of the file, each sysidcfg file must reside in a separate directory. Each client can have its own sysidcfg file, or multiple clients can use the same sysidcfg file. The sysidcfg file is assigned to a client by the add_install_client command. The following shows the creation of two sysidcfg files:

  # cd /export/config  # mkdir sysidcfg1  # cd sysidcfg1  # vi sysidcfg  system_locale=en_US.ISO8859-1  timezone=US/Pacific  timeserver=localhost  terminal=vt100  name_service=NONE  security_policy=NONE  root_password=  network_interface=bge0 {hostname=client1                          netmask=255.255.255.0                          protocol_ipv6=no                          default_route=172.16.64.1}  :wq  # cd ../  # mkdir sysidcfg2  # cd sysidcfg2  # vi sysidcfg  system_locale=en_US.ISO8859-1  timezone=US/Pacific  timeserver=localhost  terminal=vt100  name_service=NONE  security_policy=NONE  root_password=  network_interface=bge0 {hostname=client2                          netmask=255.255.255.0                          protocol_ipv6=no                          default_route=172.16.64.1}  :wq

c. Create the rules file:

The next file to create is the rules file. This is a text file that contains a rule for each client or group of clients on which the Solaris OS will be installed. Each line of the rules file tells JumpStart which begin, profile, and finish files to use for each client or group of clients.

There is only one rules file. It can contain multiple lines depending upon how many unique configurations are needed. The following shows the contents of a rules file that contains information for two separate clients:

  # cd /export/config  # vi rules  hostname client1 begin1 profile1 finish1  hostname client2 begin2 profile2 finish2  :wq

The rules file is used by the check script when it creates the rules.ok file. Successful creation of the rules.ok file is required for custom JumpStart installations.

d. Create the begin file:

The begin file is a user-defined Bourne shell script that is used to perform tasks on the client before the installation of the Solaris OS begins. Typical tasks include creating derived profiles and the backing up of files before upgrading.

Multiple begin files can be used if desired. The following shows the creation of two begin files:

  # cd /export/config  # vi begin1  #!/bin/sh  echo "Begin Script for JumpStart client1..."  :wq  # vi begin2  #!/bin/sh  echo "Begin Script for JumpStart client2..."  :wq  # chmod 755 begin*

During installation on the client, output from the begin file is written to /tmp/begin.log. After the installation is done, the log file can be found in /var/sadm/system/logs/begin.log.

The Solaris 10 Installation Guide includes a Custom JumpStart Environment Variables section that describes variables you can use in begin scripts.

e. Create the finish file:

The finish file is a user-defined Bourne shell script that is used to perform tasks on the client after the installation of the Solaris OS has completed. This script is typically used to add additional files, add packages and patches, customize the root environment, and install additional software.

Multiple finish files can be used if desired. The following shows the creation of two finish files:

  # cd /export/config  # vi finish1  #!/bin/sh  echo "Finish Script for JumpStart client1..."  echo "Get rid of the nfs prompt during the initial boot"  touch /a/etc/.NFS4inst_state.domain  :wq  # vi finish2  #!/bin/sh  echo "Finish Script for JumpStart client2..."  echo "Get rid of the nfs prompt during the initial boot"  touch /a/etc/.NFS4inst_state.domain  :wq  # chmod 755 finish*

The Solaris installation program mounts the client systems' file systems on /a. The finish script can be used to add, change, or remove files with respect to /a. These file systems remain mounted on /a until the initial system reboot.

The JumpStart directory, that is, /export/install, is mounted on the directory that is specified by the SI_CONFIG_DIR variable. The directory is set to /tmp/install_config by default. Files can be copied from the JumpStart directory to the client by commands run in the finish script. Files that are to be added to the installed system are placed in the JumpStart directory and are then accessible by the client.

The following line in the finish script copies a file to the newly installed file system hierarchy on the client:

  cp /tmp/install_config/ /a//

f. Create the profile file:

The profile file is a text file that defines how the Solaris OS is installed on a client.

Multiple profile files can be created. Several clients can use the same profile file, or each client can have its own profile file. The following shows the creation of two profile files:

  # cd /export/config  # vi profile1  # install_type MUST be first  install_type      initial_install  # start with the minimal required number of packages  cluster           SUNWCXall  cluster           SUNWCapache delete  cluster           SUNWCpcmc   delete  cluster           SUNWCpcmcx  delete  cluster           SUNWCthai   delete  cluster           SUNWClp     delete  cluster           SUNWCnis    delete  cluster           SUNWCppp    delete  # format the entire disk for Solaris  fdisk   all   solaris all  # define how the disk is partitioned  partitioning      explicit  filesys           rootdisk.s0 6144  /  filesys           rootdisk.s1 1024  swap  filesys           rootdisk.s7 free  /state/partition1  # install systems as standalone  system_type standalone  # specify patches to install  patch 119281-06 nfs 172.16.64.194:/export/patches  # specify packages to install  package SPROcc add nfs 172.16.64.194:/export/packages  :wq  # vi profile2  # install_type MUST be first  install_type      initial_install  # start with the minimal required number of packages  cluster           SUNWCXall  cluster           SUNWCapache delete  cluster           SUNWCpcmc   delete  cluster           SUNWCpcmcx  delete  cluster           SUNWCthai   delete  cluster           SUNWClp     delete  cluster           SUNWCnis    delete  cluster           SUNWCppp    delete  # format the entire disk for Solaris  fdisk   all   solaris all  # define how the disk is partitioned  partitioning      explicit  filesys           rootdisk.s0 6144  /  filesys           rootdisk.s1 4096  swap  filesys           rootdisk.s7 free  /state/partition1  # install systems as standalone  system_type standalone  # specify patches to install  patch 119281-06 nfs 172.16.64.194:/export/patches  # specify packages to install  package SPROcc add nfs 172.16.64.194:/export/packages  :wq

g. Create the check script:

The check script is used to validate that the rules and profile files are correctly set up. First copy the check script to the local directory, that is, /export/config, as shown:

  # cd /export/config  # cp /export/install/Solaris_10/Misc/jumpstart_sample/check .

h. Run the check script:

  # ./check  Validating rules...  Validating profile profile1...  Validating profile profile2...  The custom JumpStart configuration is ok.

If no errors are found, the rules.ok file is created. This file is the same as the rules file but with its comments and blank lines removed. The check script adds the following comment to the end of the rules.ok file:

  # version=2 checksum=

3. Share the Installation and Configuration Directories

a. Modify dfstab to share the JumpStart directories.

b. Edit the /etc/dfs/dfstab file:

  # vi /etc/dfs/dfstab  #       Place share(1M) commands here for automatic execution  #       on entering init state 3.  #  #       Issue the command 'svcadm enable network/nfs/server' to  #       run the NFS daemon processes and the share commands, after  #       adding the very first entry to this file.  #  #       share [-F fstype] [ -o options] [-d ""]   #       [resource]  #       for example,  #       share  -F nfs  -o rw=engineering  -d "home dirs"  /export/home2  share -F nfs -o ro,anon=0 /export/install  share -F nfs -o ro,anon=0 /export/config  share -F nfs -o ro,anon=0 /export/patches  share -F nfs -o ro,anon=0 /export/packages  :wq

c. Start the NFS server.

  # /etc/init.d/nfs.server start

d. Share the directories.

  # shareall  # share  -               /export/install   ro,anon=0   ""  -               /export/config   ro,anon=0   ""  -               /export/patches   ro,anon=0   ""  -               /export/packages   ro,anon=0   ""

e. Verify file sharing.

  # showmount -e localhost  export list for localhost:  /export/install  (everyone)  /export/config   (everyone)  /export/patches  (everyone)  /export/packages (everyone)

4. Create the Client tftpboot Files

a. Run the add_install_client script for each client.

b. Go to the location of the add_install_client script:

  # cd /export/install/Solaris_10/Tools

c. Run the add_install_client script for each client on the network that performs a JumpStart installation. Ensure that you use the correct arguments for each client. The -e argument is the MAC address for the client and the -p argument shows the directory name of the sysidcfg file that is used by the client. The following shows running add_install_client for two separate clients:

  # ./add_install_client \      -d \      -e 00:0a:e4:37:16:4d \      -s 172.16.64.194:/export/install \      -c 172.16.64.194:/export/config \      -p 172.16.64.194:/export/config/sysidcfg1 i86pc  enabling tftp in /etc/inetd.conf  Converting /etc/inetd.conf  enabling network/tftp/udp6 service  copying boot file to /tftpboot/pxegrub.I86PC.Solaris_10-1  If not already configured, enable PXE boot by creating  a macro named 01000AE429C1FD with:    Boot server IP (BootSrvA) : 172.16.64.194    Boot file      (BootFile) : 01000AE429C1FD  # ./add_install_client \      -d \      -e 00:0a:e4:2a:33:f8 \      -s 172.16.64.194:/export/install \      -c 172.16.64.194:/export/config \      -p 172.16.64.194:/export/config/sysidcfg2 i86pc  enabling tftp in /etc/inetd.conf  Converting /etc/inetd.conf  enabling network/tftp/udp6 service  copying boot file to /tftpboot/pxegrub.I86PC.Solaris_10-1  If not already configured, enable PXE boot by creating  a macro named 01000AE42A33F8 with:    Boot server IP (BootSrvA) : 172.16.64.194    Boot file      (BootFile) : 01000AE42A33F8

The Boot server IP and Boot file values are used later when macros are created while dhcpmgr is running.

5. Configure and Run the DHCP Server

a. Run dhcpmgr:

  # /usr/sadm/admin/bin/dhcpmgr  Java Accessibility Bridge for GNOME loaded.

The first screen appears:
(Click on images to enlarge)

b. Select Configure as a DHCP Server and click OK.

The DHCP Configuration Wizard appears:

c. Select Text Files and click Next.

d. Verify the storage path and click Next.

e. Select a nameservice and click Next.

f. Verify the lease information and click Next.

g. Verify the DNS domain information and click Next.

h. Verify the network information and click Next.

i. Select the network type and routing option and click Next.

j. Verify the NIS domain information and click Next.

k. Verify the NIS+ domain information and click Next.

l. Review the settings and click Finish.

The DHCP Manager appears and you are asked to start the Address Wizard:

m. Click Yes.

The Address Wizard appears:

n. Type the number of IP addresses and click Next.

o. Verify the server information and click Next.

p. Verify the IP addresses and click Next.

q. Verify the client configuration information and click Next.

r. Select the lease type and click Next.

s. Review the settings and click Finish.

With dhcpmgr still running, create the BootFile and BootSrvA macros. To access the Create Macros form, first select the Macros tab on the DHCP Manager form. Then select Edit->Create on the top menu.

The Create Macro form appears:

t. Create the BootFile portion of the macro by typing into the Name field the name that was generated by the add_install_client script for the first client. This name is also used in the Option Value field. After typing the information, click Add.

u. Create the BootSrvA portion of the macro by typing the network IP address of the JumpStart server into the Option Value field. After typing the information, click Add. Then click OK to complete the creation of the first macro.

v. Repeat the same process to create the second macro.

x. Click Add.

y. Click Add and then click OK.

z. After generating the second macro, select File->Exit in the DHCP Manager window to end the dhcpmgr utility.

Final Clean-Up

When you ran the add_install_client script, the script created a menu.lst file for each client.

Due to a bug in the creation of the /tftpboot/menu.lst file, you must add the following text after kernel/unix on line 4:

- install dhcp

Therefore, change the file from this:

default=0timeout=30title Solaris_10 Jumpstart    kernel /I86PC.Solaris_10-1/multiboot kernel/unix -B \install_config=172.16.64.194:/export/config, \sysid_config=172.16.64.194:/export/config/sysidcfg1, \install_media=172.16.64.194:/export/install, \install_boot=172.16.64.194:/export/install/boot    module /I86PC.Solaris_10-1/x86.miniroot

to this:

default=0timeout=4title Solaris_10 Jumpstart    kernel /I86PC.Solaris_10-1/multiboot kernel/unix - install dhcp -B \install_config=172.16.64.194:/export/config, \sysid_config=172.16.64.194:/export/config/sysidcfg1, \install_media=172.16.64.194:/export/install, \install_boot=172.16.64.194:/export/install/boot    module /I86PC.Solaris_10-1/x86.miniroot

Perform a Hands-Off JumpStart Installation

    Boot the clients.

    After the prompt is displayed, press F12 on the client's keyboard.

    Network Boot Request....CLIENT MAC ADDR: 00 0A E4 2A 33 F8  GUID: 11223344 556 7788 99AA \                                          BBCCDDEEFF00DHCP....\|/-\|/-

    If everything has been set up correctly, the installation runs to completion. If a problem occurs, the installer exits and drops into a shell. The cause of the error is recorded in the install_log file.


Post Installation

The following are the log files for the JumpStart installation:

  /var/sadm/system/logs/install_log                        begin_log                        finish_log                        sysidtool.log

About the Authors

Craig Winter and Dale Layfield are Staff Engineers for the MDE Verticals Group in Market Development Engineering at Sun Microsystems, Inc.

原文链接:

阅读(653) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~