トップページ > インストール関連 > Solaris10でのWANブートサーバーの構築&WANブートインストール
カテゴリー
オラクルエンジニア通信
サポートページ
マニュアルページ
ソフトウェアダウンロード
中古UNIXマシン購入
blogs.sun.com
お勧めサイト
プライベートリンク

Solaris10でのWANブートサーバーの構築&WANブートインストール

準備(必要なもの)

 Solaris10 CD-ROM 1枚目(もしくはDVD)
 インストールデータとなるFlashアーカイブ
 ※WANBootインストールは現時点ではFlashアーカイブでのイ ンストールしかサポートしていない。

apacheの設定


以下のようにSolaris10に標準でインストールされているApache2.0を使用する。
WebServerであれば、何でも動作すると思われるが、SunではSunJavaSystem WebServer とApacheくらいしかWANBootをサポートしないようだ。

bash-3.00# cd /etc/apache2
bash-3.00# ls
highperformance-std.conf  httpd.conf-example        ssl-std.conf
highperformance.conf      magic                     ssl.conf
httpd-std.conf            mime.types
bash-3.00# cp httpd-std.conf httpd.conf
bash-3.00# vi httpd.conf
...
ServerName 192.168.0.100 (任意:通常はhostname.domainname形式)
...
User webservd (こちらも任意)
Group webservd

以下のようにhttpサービスを有効にし、動作を確認できればOK。

bash-3.00# svcadm enable http
bash-3.00# svcs http
STATE          STIME    FMRI
online         11:36:09 svc:/network/http:apache2
bash-3.00# ps -ef | grep httpd
webservd  1241  1240   0 11:36:10 ?   0:00 /usr/apache2/bin/httpd -k start
webservd  1243  1240   0 11:36:10 ?   0:00 /usr/apache2/bin/httpd -k start
webservd  1244  1240   0 11:36:10 ?   0:00 /usr/apache2/bin/httpd -k start
    root  1240     1   0 11:36:09 ?    0:00 /usr/apache2/bin/httpd -k start
webservd  1242  1240   0 11:36:10 ?   0:00 /usr/apache2/bin/httpd -k start
webservd  1245  1240   0 11:36:10 ?   0:00 /usr/apache2/bin/httpd -k start


WANBootサーバーの設定

ここからWANBootに必要な情報をセットアップする。
以下ではSolaris10 3/05 の1枚目のCDを使用している。

※ちなみに Solaris10 1/06 版にはWANBootでバグ(BugID:#6370471)があり失敗するので、WANBootイメージ(miniroot)の作成は3/05版で行っ ている。
1/06版で実行するとクライアントインストール時にminirootのダウンロード後に以下のメッセージが出て、インストールに失敗する。
Searching for JumpStart directory...
/usr/sbin/install.d/profind: bad substitution
Warning: Could not find matching rule in rules.ok> Press the return key for an interactive Solaris install program...

以下のようにApache2のドキュメントルート以下に必要なディレクトリを作成して、CDから必要なデータをセットアップする。データのセットアップに は1時間くらいかかるので、コマンドを実行したら、しばらく別の作業をしていた方がいいだろう。

bash-3.00# cd /var/apache2/htdocs
bash-3.00# mkdir wanboot flash install config miniroot

bash-3.00# cd /cdrom/cdrom0/s0/Solaris_10/Tools/
bash-3.00# ./setup_install_server -b -w /var/apache2/htdocs/wanboot /var/apache2/htdocs/install
Verifying target directory...
Calculating space required for the installation boot image
Copying Solaris_10 Tools hierarchy...
Copying Install Boot Image hierarchy...
Starting WAN boot Image build
Calculating space required for WAN boot Image
Copying WAN boot Image hierarchy...
855584 ブロック
Removing unneeded packages from WAN boot Image hierarchy
Creating the WAN boot Image file
Image size is 241242112 bytes
Copying WAN boot to Image file...
482528 ブロック
WAN boot Image creation complete

        The WAN boot Image file has been placed in
                /var/apache2/htdocs/wanboot/miniroot

        Ensure that you move this file to a location
        accessible to the web server, and that the
        WAN boot configuration file wanboot.conf(4)
        for each WAN boot client contains the entries:

                root_server=<URL>
                        where <URL> is an HTTP or HTTPS URL
                        scheme pointing to the location of the
                        WAN boot CGI program

                root_file=<miniroot>
                        where <miniroot> is the path and file
                        name, relative to the web server
                        document directory, of 'miniroot'

        You should also make sure you have initialized
        the key generation process by issuing (once):

                # /usr/sbin/wanbootutil keygen -m

Install Server setup complete
bash-3.00#

上記メッセージが出ていればOK。
さらに以下のようにCD内にあるwanbootファイルを所定の位置にコピーする。

bash-3.00# cd /cdrom/cdrom0/s0/Solaris_10/Tools/Boot/platform/sun4u/
bash-3.00# ls
kernel   lib      ufsboot  wanboot
bash-3.00# cp wanboot /var/apache2/htdocs/wanboot/wanboot

また、以下の位置にあるWANBootで使用するCGIファイルをApacheのcgi-bin配下にコピーし、実行権の有無を確認する。

bash-3.00# cd /usr/lib/inet/wanboot
bash-3.00# ls
bootlog-cgi  hmac         keygen       netbootinfo  wanboot-cgi
encr         ickey        keymgmt      p12split
bash-3.00# cp wanboot-cgi bootlog-cgi /var/apache2/cgi-bin
bash-3.00# cd /var/apache2/cgi-bin
bash-3.00# ls -l
合計 60
-r-xr-xr-x   1 root     root         914  3月  7日  12:25 bootlog-cgi
-r-xr-xr-x   1 root     bin          274  7月 20日 2005年 printenv
-r-xr-xr-x   1 root     bin          757  8月 24日 1999年 test-cgi
-r-xr-xr-x   1 root     root       27640  3月  7日  12:25 wanboot-cgi
bash-3.00#

次に、以下のように/etc/netbootディレクトリを作成し、wanboot.conf のテンプレートファイルをコピーし、wanboot.confファイルを作成する。

bash-3.00# mkdir /etc/netboot
bash-3.00# cd /etc/inet/
bash-3.00# ls
datemsk.ndpd             ipsecalgs                protocols
hosts                    ipsecinit.sample         routing.conf
ike                      mipagent.conf-sample     secret
inetd.conf               mipagent.conf.fa-sample  services
ipaddrsel.conf           mipagent.conf.ha-sample  slp.conf.example
ipnodes                  netmasks                 sock2path
ipqosconf.1.sample       networks                 wanboot.conf.sample
ipqosconf.2.sample       ntp.client
ipqosconf.3.sample       ntp.server
bash-3.00# cp wanboot.conf.sample /etc/netboot/wanboot.conf
bash-3.00# vi /etc/netboot/wanboot.conf
boot_file=/wanboot/wanboot
encryption_type=
signature_type=
server_authentication=no
client_authentication=no
resolve_hosts=
root_server=http://192.168.0.100/cgi-bin/wanboot-cgi
root_file=/wanboot/miniroot
boot_logger=http://192.168.0.100/cgi-bin/bootlog-cgi
system_conf=system.conf

上記のように各エントリを修正する。
さらにwanboot.confで指定したsystem.confファイルを以下の内容で作成する。
これにはWebサーバー上のJumpStart構成ファイル(sysidcfgファイル、rules.okファイル)の場所を指定する。

bash-3.00# vi /etc/netboot/system.conf
------------------------------------
SsysidCF=http://192.168.0.100/config
SjumpsCF=http://192.168.0.100/config
------------------------------------

JumpStart構成ファイル群は以下のようにCDからコピーしてくると便利だ。
実際に使用するのは check スクリプトだけなので、全部を持ってくる必要はないが。。。

bash-3.00# cp -r /cdrom/cdrom0/s0/Solaris_10/Misc/jumpstart_sample/* /var/apache2/htdocs/config
bash-3.00# cd /var/apache2/htdocs/config
bash-3.00# vi sysidcfg
-----------------------------
network_interface=hme0 {
netmask=255.255.255.0
protocol_ipv6=no
default_route=none }
timezone=Japan
timeserver=localhost
name_service=NONE
security_policy=NONE
root_password="o32YqOv.T6HqE" <-- これでrootのパスワードをsolarisにセットしている
-----------------------------

bash-3.00# vi profile
------------------------------------
install_type            flash_install
archive_location        http://192.168.0.100/flash/s10u1SUNWCuser.flar
partitioning            explicit
filesys                 c0t0d0s0 free /
filesys                 c0t0d0s1 512 swap
------------------------------------

上記のように sysidcfg ファイルと profile ファイルを作成する。
profile ファイルで指定している s10u1SUNWCuser.flar ファイルはWANBootでインストールされるFlashアーカイブだ。
以下のようにコピーしてきたrulesファイルは邪魔なので削除してから、1行だけの新しいrulesファイルを作成する。

bash-3.00# rm rules
bash-3.00# vi rules
-------------------
any - - profile -
-------------------
bash-3.00# ./check
Validating rules...
Validating profile profile...
The custom JumpStart configuration is ok.
bash-3.00# ls
any_machine      profile          sysidcfg         x86-class
check            rules            upgrade
host_class       rules.ok         x86-begin
net924_sun4c     set_nfs4_domain  x86-begin.conf

上記のようにcheckスクリプトを実行しrules.okファイルが作成されたことを確認する。
さらに以下のコマンドを実行しwanboot.confの正当性を確認する。

bash-3.00# bootconfchk /etc/netboot/wanboot.conf

構成(構文)に問題なければ何も表示されない。


WANBootクライアントの準備&インストール

WANBootクライアントでの作業は簡単だ。
PROM4.14以降であればNVRAMパラメータにこれから入力するクライアント情報を記憶させることができるので単独ブート可能だが、今回使用してい るマシンは旧モデルなのでCD-ROMからブートする。
対話的に必要な項目を入力していく。

ok boot cdrom -o prompt -F wanboot - install
...
Rebooting with command: boot cdrom -o prompt -F wanboot - install
Boot device: /pci@1f,0/pci@1,1/ide@3/cdrom@2,0:f  File and args: -o prompt -F wanboot - install

<time unavailable> wanboot info: WAN boot messages->console
<time unavailable> wanboot info: Default net-config-strategy: manual

boot> prompt

host-ip? 192.168.0.102

subnet-mask? 255.255.255.0

router-ip?

hostname? s10test

http-proxy?

client-id?

aes?

3des?

sha1?

bootserver? http://192.168.0.100/cgi-bin/wanboot-cgi


Unknown variable '/192.168.0.100/cgi-bin/wanboot-cgi'; ignored
boot> go

<time unavailable> wanboot progress: wanbootfs: Read 368 of 368 kB (100%)
<time unavailable> wanboot info: wanbootfs: Download complete
Tue Mar  7 04:30:02 wanboot info: WAN boot messages->192.168.0.100:80
SunOS Release 5.10 Version Generic_118822-25 64-bit
Copyright 1983-2005 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Configuring devices.
Network interface was configured manually.
192.168.0.102
Beginning system identification...
Searching for configuration file(s)...
Using sysid configuration file http://192.168.0.100/config/sysidcfg
Search complete.
Discovering additional network configuration...
Completing system identification...
Starting remote procedure call (RPC) services: done.
System identification complete.
Starting Solaris installation program...
Searching for JumpStart directory...
Using rules.ok from http://192.168.0.100/config.
Checking rules.ok file...
Using profile: profile
Executing JumpStart preinstall phase...
Searching for SolStart directory...
Checking rules.ok file...
Using begin script: install_begin
Using finish script: patch_finish
Executing SolStart preinstall phase...
Executing begin script "install_begin"...
Begin script install_begin execution completed.
Wed Mar  8 19:09:02 wanboot info: WAN boot messages->wanbootserv:80

Processing profile
        - Opening Flash archive
        - Validating Flash archive
        - Selecting all disks
        - Configuring boot device
        - Configuring swap (c0t0d0s1)
        - Configuring / (c0t0d0s0)

Verifying disk configuration

Verifying space allocation
        NOTE: 1 archives did not include size information

Preparing system for Flash install

Configuring disk (c0t0d0)
        - Creating Solaris disk label (VTOC)

Creating and checking UFS file systems
        - Creating / (c0t0d0s0)

Beginning Flash archive processing

Predeployment processing
16 blocks
16 blocks
16 blocks

No local customization defined

Extracting archive: s10u1SUNWCuser
        Extracted    0.00 MB (  0% of 1245.01 MB archive)
        Extracted    1.05 MB (  0% of 1245.01 MB archive)
        Extracted    2.05 MB (  0% of 1245.01 MB archive)
        Extracted    3.05 MB (  0% of 1245.01 MB archive)
        Extracted    4.05 MB (  0% of 1245.01 MB archive)
...

以上のように無事Flashアーカイブがダウンロードされているようであればバッチリ。


WANBootサーバー側ではbootlog-cgiの働きで/tmpの以下のファイル(ファイル名はbootlog.クライアントホスト名)にダウン ロードの経過が保存される。
以下のように開いておけば、wanbootファイルやminirootのダウンロード状況を追跡できるので万が一失敗する場合は確認するとよい。

bash-3.00# tail -f /tmp/bootlog.s10test
Mar 08 18:55:54  s10test wanboot: [ID 103106 user.progress] wanbootfs: Read 72 of 368 kB (19%)
Mar 08 18:55:54  s10test wanboot: [ID 318429 user.progress] wanbootfs: Read 152 of 368 kB (41%)
Mar 08 18:55:54  s10test wanboot: [ID 865320 user.progress] wanbootfs: Read 232 of 368 kB (63%)
Mar 08 18:55:54  s10test wanboot: [ID 817831 user.progress] wanbootfs: Read 312 of 368 kB (84%)
Mar 08 18:55:54  s10test wanboot: [ID 383464 user.progress] wanbootfs: Read 368 of 368 kB (100%)
Mar 08 18:55:54  s10test wanboot: [ID 893282 user.info] wanbootfs: Download complete
Mar 08 18:55:54  s10test wanboot: [ID 930382 user.progress] miniroot: Read 4176 of 209121 kB (1%)
Mar 08 18:56:22  s10test wanboot: [ID 156184 user.progress] miniroot: Read 8360 of 209121 kB (3%)
...
...
Mar 08 19:12:43  s10test wanboot: [ID 182987 user.progress] miniroot: Read 205008 of 209121 kB (98%)
Mar 08 19:13:16  s10test wanboot: [ID 650675 user.progress] miniroot: Read 209121 of 209121 kB (100%)
Mar 08 19:13:16  s10test wanboot: [ID 798093 user.info] miniroot: Download complete
Mar 08 19:15:07  s10test ident: [ID 395881 user.info] Processing profile
Mar 08 19:15:07  s10test ident: [ID 330204 user.info] Opening Flash archive
Mar 08 19:15:07  s10test ident: [ID 417296 user.info] Validating Flash archive
Mar 08 19:15:07  s10test ident: [ID 243831 user.info] Selecting all disks
Mar 08 19:15:07  s10test ident: [ID 293289 user.info] Configuring boot device
Mar 08 19:15:07  s10test ident: [ID 853790 user.info] Configuring swap (c0t0d0s1)
Mar 08 19:15:07  s10test ident: [ID 762143 user.info] Configuring / (c0t0d0s0)
Mar 08 19:15:07  s10test ident: [ID 561118 user.info] Verifying disk configuration
Mar 08 19:15:07  s10test ident: [ID 229965 user.info] Verifying space allocation
Mar 08 19:15:07  s10test ident: [ID 276543 user.info] NOTE: 1 archives did not include size information
Mar 08 19:15:07  s10test ident: [ID 751698 user.info] Configuring disk (c0t0d0)
Mar 08 19:15:07  s10test ident: [ID 695117 user.info] Creating Solaris disk label (VTOC)
Mar 08 19:15:07  s10test ident: [ID 275986 user.info] Creating and checking UFS file systems
Mar 08 19:15:07  s10test ident: [ID 814940 user.info] Creating / (c0t0d0s0)
Mar 08 19:15:25  s10test ident: [ID 729579 user.info] Beginning Flash archive processing
Mar 08 19:15:25  s10test ident: [ID 230400 user.info] Extracting archive: s10u1SUNWCuser
Mar 08 19:15:25  s10test ident: [ID 688177 user.progress] Extracted 0.00 MB ( 0% of 1245.01 MB archive)
Mar 08 19:15:26  s10test ident: [ID 819254 user.progress] Extracted 1.05 MB ( 0% of 1245.01 MB archive)
Mar 08 19:15:29  s10test ident: [ID 950326 user.progress] Extracted 2.05 MB ( 0% of 1245.01 MB archive)
.Mar 08 19:28:33  s10test ident: [ID 268212 user.progress] Extracted 1243.04 MB ( 99% of 1245.01 MB archive)
Mar 08 19:28:34  s10test ident: [ID 399284 user.progress] Extracted 1244.04 MB ( 99% of 1245.01 MB archive)
Mar 08 19:28:35  s10test ident: [ID 592472 user.progress] Extracted 1245.01 MB (100% of 1245.01 MB archive)
Mar 08 19:28:36  s10test ident: [ID 635634 user.info] Extraction complete
Mar 08 19:28:37  s10test ident: [ID 974779 user.info] Customizing system files
Mar 08 19:28:37  s10test ident: [ID 212938 user.info] Mount points table (/etc/vfstab)
Mar 08 19:28:37  s10test ident: [ID 423623 user.info] fd - /dev/fd fd - no -
Mar 08 19:28:37  s10test ident: [ID 678088 user.info] /proc - /proc proc - no -
Mar 08 19:28:37  s10test ident: [ID 710906 user.info] /dev/dsk/c0t0d0s1 - - swap - no -
Mar 08 19:28:37  s10test ident: [ID 202906 user.info] /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
Mar 08 19:28:37  s10test ident: [ID 341394 user.info] /devices - /devices devfs - no -
Mar 08 19:28:37  s10test ident: [ID 206143 user.info] ctfs - /system/contract ctfs - no -
Mar 08 19:28:37  s10test ident: [ID 448660 user.info] objfs - /system/object objfs - no -
Mar 08 19:28:37  s10test ident: [ID 220322 user.info] swap - /tmp tmpfs - yes -
Mar 08 19:28:37  s10test ident: [ID 865626 user.info] Network host addresses (/etc/hosts)
Mar 08 19:28:37  s10test ident: [ID 865626 user.info] Network host addresses (/etc/hosts)
Mar 08 19:28:38  s10test ident: [ID 983719 user.info] Cleaning devices
Mar 08 19:28:38  s10test ident: [ID 835219 user.info] Customizing system devices
Mar 08 19:28:38  s10test ident: [ID 538503 user.info] Physical devices (/devices)
Mar 08 19:28:38  s10test ident: [ID 244278 user.info] Logical devices (/dev)
Mar 08 19:28:38  s10test ident: [ID 812425 user.info] Installing boot information
Mar 08 19:28:38  s10test ident: [ID 372785 user.info] Installing boot blocks (c0t0d0s0)
...
...


※ちなみにクライアント側のメモリが不足していると以下のようなエラー メッセージを記録してインストールが失敗する。
Mar 07 13:19:01  s10test wanboot: [ID 735877 user.crit] Cannot create ramdisk "ramdisk-rootfs"
(上記エラーは256MBメモリのシステムで実行した結果)


上記方法でインストールは成功し、milestone all での起動も確認できた。

オラクルユニバーシティSolaris系技術トレーニング一覧

Solarisお勧め書籍

Solaris 11.2 システムハンドブック
Oracle Solaris 11 試験対策本(OCA)