ChinaUnix.net 首页 | 博客 | Linux | 论坛 | 人才 | 培训 | 知识库 | 资料 | 读书 | 手册 | 精华 | 下载 | 沙龙 | 搜索
Linux首页 | Linux论坛 | 论坛精华 | 开源新闻 | 技术文章 | 专题专栏 | 新手指南 | 迁移方案 | 产品方案 | 开源项目 | 开源图书 | 软件下载 | 人才招聘 | Linux博客
  搜索

  产品与方案
·中科红旗全面打造现代化邮政体系
·红旗助力“网上审批服务” 推动电子政务
·红旗正版化开创呼和浩特网吧建设新起点
·红旗Linux助信息产业部邮件服务器“快跑”
·中标普华Linux 为电子政务信息化保驾护航
·中标普华Linux助力基金产业
·中标普华Office率先支持UOF标准
·中标普华邮件系统助力西藏政府信息化建设
·红旗Linux助力国库集中支付系统改革
·红旗助中信卫星 掀起GIS通信应用风暴
·红旗软件助力烟草总局 全面建设“数字烟草”
·红旗助力“信访阳光工程”打造畅通信访渠道
·红帽联合FIS发布下一代实时核心银行平台
·红旗助力金盾 打造全无忧出入境信息系统
·红旗Linux全力打造中国邮政总局名址信息库
·爱尔兰证交所从Unix迁移到红帽企业Linux
·一流的意大利银行选择使用红帽企业Linux
·PLUS Finanzservice选择使用红帽企业Linux
·红帽助力TransACT Communications 公司
·法国零售业巨头Lapeyre采用Redhat Linux
·旅游预订网站选择使用红帽企业Linux
·马哈拉施特拉邦政府的红帽解决之道
·美国联邦政府案例
·红帽为慕尼黑展览会提供现代化集群系统
·Yuba郡用开源软件和红帽产品提高了效率
·红帽企业Linux助印度理工建立高性能计算中心
·采用红帽Linux 将系统维护时间缩短了65%
·从UNIX迁移到Linux使Peñoles公司获益非浅
·Hikal公司用红帽企业Linux开展任务关键的ERP项目
·KDE3.5.4新版本发布
·芝加哥商业交易所从Unix向Linux迁移
·南方基金管理有限公司成功案例 Red Hat Linux
·广东北电通讯设备有限公司成功案例
·挪威国家石油公司从UNIX迁移到红帽Linux,成本减半
·中央电视台CCTV动画部案例 Red Hat Linux

  图书

鸟哥的Linux私房菜基础学..


Linux程序设计.第3版


Linux设备驱动开发详解


  下载
·Endian Firewall
·linux kernel(Linux 内核)
·CentOS
·Fedora Core 6
·Scientific Linux
·Slackware 11.0
·Gentoo Linux
·ubuntu-6.10-i386服务器版本
·ubuntu-6.10-amd64服务器版
·ubuntu-6.10-i386桌面版
·ubuntu-6.10-amd64桌面版
·Engarde Linux
您的位置: Linux时代 > 技术文档 > 系统安全 >

使用JumpStart快速安装Solaris

日期:2007-04-02 作者:sun.com 来自:linux.chinaunix.net


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:

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=<encrypted from /etc/shadow>
  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=<encrypted from /etc/shadow>
  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/<file_name> /a/<path_name>/

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=<num>

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 "<text>"] <pathname>
  #       [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<filename> file for each client.

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

- install dhcp

Therefore, change the file from this:

default=0
timeout=30
title 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=0
timeout=4
title 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 \
                                              BBCCDDEEFF00
    
    DHCP....\|/-\|/-
    

    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.

原文链接:http://www.sun.com/bigadmin/features/articles/jumpstart_x86_x64.jsp

本文被浏览



 相关新闻

Solaris战胜Linux所需要的七大法宝2007-01-26 10:09:48
Sun升级Solaris 支持费远低于红帽2007-01-18 11:38:47
SUN Solaris开源远落后于Linux?2006-12-05 09:10:31
3步骤移植Solaris到Linux Java程序属此范畴2006-12-05 09:07:34
Solaris 10 实现安全Kerberos 身份验证2006-12-04 13:52:20
Solaris可能改用GPL许可 将与Linux异花授粉2006-11-15 09:13:26
ISS对Linux和Solaris提供保护2006-10-18 09:40:25
OpenSolaris用户组北京聚会!2006-09-28 18:21:23


 相关评论
关于我们 | 联系方式 | 广告合作 | 诚聘英才 | 网站地图 | 免费注册

Copyright © 2001-2006 ChinaUnix.net All Rights Reserved

感谢所有关心和支持过ChinaUnix的朋友们

京ICP证041476号