对适用于 x86/x64 平台的 Solaris 10 操作系统使用 Solaris JumpStartCraig Winter 和 Dale Layfield,2007 年 3 月 摘要Sun Microsystems 的 Solaris JumpStart 技术用于在网络的多个节点上自动安装 Solaris 操作系统和其他关联的软件。 在适用于 x86/x64 平台的 Solaris 10 操作系统上使用 Solaris JumpStart 软件与在适用于 SPARC 平台的 Solaris 10 操作系统上使用该软件基本上相同。但是,需要说明一些细微的差异,以确保正确操作。 本文档提供为 Sun x86/x64 计算机上的 Solaris 10 操作系统设置 JumpStart 服务器以及为两个或更多客户机配置 JumpStart 的必要步骤和说明。 作为一般参考,请参阅 Sun 联机文档使用自定义 JumpStart。 简介本文介绍使用适用于 x86/x64 平台的 Solaris 10 操作系统创建 JumpStart 服务器的分步过程。此版本的 Solaris 10 操作系统可用于在服务器上运行的操作系统以及 JumpStart 安装服务器上的操作系统。基于 AMD Opteron 和 Intel 处理器的计算机都曾用作服务器和客户机,但未给出针对每个计算机使用哪种处理器类型的相关首选项。 为以下内容提供了说明: 必须在客户机上启用预引导执行环境 (Pre-boot Execution Environment, PXE),以便使客户机从网络中进行引导。在某些客户机上,需要在 BIOS 中启用 PXE。 创建客户机引导文件时出现的错误将在最后清理部分加以说明。 Solaris JumpStart 过程这些说明用于设置 JumpStart 安装服务器,该服务器将在两个客户机上安装适用于 x86/x64 平台的 Solaris 10 操作系统。 在此练习中,JumpStart 服务器的节点名为 如果需要,您可以下载 Solaris 10 操作系统。 a. 在服务器上创建安装目录: # mkdir -p /export/install b. 在服务器上的 DVD 播放器中放入适用于 x86/x64 平台的 Solaris 10 操作系统 DVD。转到 DVD 上的 # 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. 验证 # du -sk /export/install 3083278 /export/install d. 从 DVD 播放器中取出 DVD。 # cd /;eject 客户机配置文件用于控制自定义 JumpStart 安装。 a. 在这些文件所在的位置创建配置目录: # mkdir /export/config b. 创建 要创建的第一个文件为 在操作系统安装开始之前,JumpStart 客户机将查找名为
# 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. 创建 要创建的下一个文件为 只有一个 # cd /export/config # vi rules hostname client1 begin1 profile1 finish1 hostname client2 begin2 profile2 finish2 :wq
d. 创建
如果需要,可以使用多个 # 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* 在客户机上安装期间,来自 《Solaris 10 安装指南》中包括自定义 JumpStart 环境变量部分,该部分介绍了可在 e. 创建
如果需要,可以使用多个 # 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* Solaris 安装程序在 JumpStart 目录(即
cp /tmp/install_config/<file_name> /a/<path_name>/ f. 创建
可以创建多个 # 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. 创建
# cd /export/config # cp /export/install/Solaris_10/Misc/jumpstart_sample/check . h. 运行 check 脚本: # ./check Validating rules... Validating profile profile1... Validating profile profile2... The custom JumpStart configuration is ok. 如果未发现错误,将创建 # version=2 checksum=<num> a. 修改 b. 编辑 # 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. 启动 NFS 服务器。 # /etc/init.d/nfs.server start d. 共享这些目录。 # shareall # share - /export/install ro,anon=0 "" - /export/config ro,anon=0 "" - /export/patches ro,anon=0 "" - /export/packages ro,anon=0 "" e. 验证文件共享。 # showmount -e localhost export list for localhost: /export/install (everyone) /export/config (everyone) /export/patches (everyone) /export/packages (everyone) a. 对每个客户机运行 b. 转到 # cd /export/install/Solaris_10/Tools c. 对网络上执行 JumpStart 安装的每个客户机运行
# ./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
以后在 a. 运行 # /usr/sadm/admin/bin/dhcpmgr Java Accessibility Bridge for GNOME loaded. 将出现第一个屏幕: b. 选择“配置为 DHCP 服务器”并单击“确定”。 将出现 DHCP 配置向导: c. 选择“文本文件”并单击“下一步”。 d. 验证存储路径并单击“下一步”。 e. 选择名称服务并单击“下一步”。 f. 验证租用信息并单击“下一步”。 g. 验证 DNS 域信息并单击“下一步”。 h. 验证网络信息并单击“下一步”。 i. 选择网络类型和路由选项,并单击“下一步”。 j. 验证 NIS 域信息并单击“下一步”。 k. 验证 NIS+ 域信息并单击“下一步”。 l. 查看设置并单击“完成”。 将出现 DHCP 管理器,并要求您启动地址向导: m. 单击“是”。 将出现地址向导: n. 键入 IP 地址的数目并单击“确定”。 o. 验证服务器信息并单击“下一步”。 p. 验证 IP 地址并单击“下一步”。 q. 验证客户机配置信息并单击“下一步”。 r. 选择租用类型并单击“下一步”。 s. 查看设置并单击“完成”。 在 将出现“创建宏”表单: t. 在“名称”字段中键入由第一个客户机的 u. 在“选项值”字段中键入 JumpStart 服务器的网络 IP 地址,以创建宏的 v. 重复相同的过程,以创建第二个宏。 x. 单击“添加”。 y. 单击“添加”,然后单击“确定”。 z. 生成第二个宏之后,在“DHCP 管理器”窗口中选择“文件”->“退出”以结束 运行 由于在创建 - install dhcp 因此,请将文件由:
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
更改为:
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
引导客户机。 显示提示符后,在客户机的键盘上按 F12。
Network Boot Request....
CLIENT MAC ADDR: 00 0A E4 2A 33 F8 GUID: 11223344 556 7788 99AA \
BBCCDDEEFF00
DHCP....\|/-\|/-
如果正确设置了所有内容,安装将一直运行到完成为止。如果出现问题,安装程序将退出并进入 shell。错误原因记录在 安装后下面是 JumpStart 安装的日志文件:
/var/sadm/system/logs/install_log
begin_log
finish_log
sysidtool.log
关于作者Craig Winter 和 Dale Layfield 是 Sun Microsystems, Inc 市场开发工程部 MDE Verticals 小组的高级工程师。 Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
BigAdmin SubscriptionsBigAdmin Areas
BigAdmin Sun Center
BigAdmin Topics |