8
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[AIX] 検証環境用 AIX NIMマスター構成手順(NIMマスター,クライアント,mksysbリソース)

Last updated at Posted at 2022-12-08

はじめに

AIX NIM(Network Installation Manager) の検証環境を手早く作成する必要があり、必要最小限の構成手順を備忘録で記載します。

playbookで書きましょうというAnsibleの巨匠の先輩の声が聞こえてきそうですがひとまずOSコマンドレベルで。後にAnsible化を検討いたします...


環境

IBM Cloud PowerVS を使用

・NIM マスター:   AIX7.3TL00SP1 (ホスト名: nimmaster1)
・NIMクライアント:  AIX7.1TL05SP9(ホスト名: nimclient1)


設定の流れ

① NIMサーバーのセットアップ
② NIMクライアント定義
 ~ 問題発生・対応 ~  
③ NIMクライアントのmksysbリソースの定義

  • 簡易に作成する検証環境のため、NIM用のファイルシステム(/export/lpp_source等)の定義は作成せず/(root)ファイルシステム上に構成しています。

① NIMサーバーのセットアップ

*NIMマスターで実行

参照 :ネットワーク・インストール管理 (NIM) サーバーのセットアップ

(1) NIMマスターの ホスト名と IP アドレスを /etc/hosts に記入

ホスト名確認

# hostname
nimmaster1

NIMネットワークで使用するネットワークのIPアドレスを確認

# ifconfig -a
en0: flags=1e084863,81cc0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 172.16.x.xxx netmask 0xffffff00 broadcast 172.16.5.255
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
en1: flags=1e084863,81cc0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet6 fe80::xxxx:3cff:xxxx:7e18/64
         tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
sit0: flags=8100041<UP,RUNNING,LINK0>
        inet6 ::/96
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1%1/128
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
#

-> en0を使用します。

/etc/hosts へ書き込み

# echo "172.16.x.xxx nimmaster1" >> /etc/hosts

(2) NIMマスター構成

# lslpp -l | grep nim
  bos.sysmgt.nim.client      7.3.0.0  COMMITTED  Network Install Manager -
  bos.sysmgt.nim.client      7.3.0.0  COMMITTED  Network Install Manager -
#

NIM マスターにするために nim_master_setup コマンドを実行します。

下記ではファイルセットが配置されているインストール・デバイスが"/usr/sys/inst.images"の例です。

# time nim_master_setup -a device=/usr/sys/inst.images -a mk_resource=no

############################## NIM master setup ##############################
#                                                                            #
#  During script execution, lpp_source and spot resource creation times      #
#  may vary. To view the install log at any time during nim_master_setup,    #
#  run the command: tail -f /var/adm/ras/nim.setup in a separate screen.     #
#                                                                            #
##############################################################################
Creating image.data file...done

Device location is /usr/sys/inst.images
Resources will be defined on volume group rootvg
Resources will exist in filesystem /export/nim
Checking for backup software...already installed
Checking /tmp space requirement...done
Installing NIM master fileset....
+-----------------------------------------------------------------------------+
                    Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...

SUCCESSES
---------
  Filesets listed in this section passed pre-installation verification
  and will be installed.

  Selected Filesets
  -----------------
  bos.sysmgt.nim.master 7.3.0.0               # Network Install Manager - Ma...

  << End of Success Section >>

+-----------------------------------------------------------------------------+
                   BUILDDATE Verification ...
+-----------------------------------------------------------------------------+
Verifying build dates...done
FILESET STATISTICS
------------------
    1  Selected to be installed, of which:
        1  Passed pre-installation verification
  ----
    1  Total to be installed

+-----------------------------------------------------------------------------+
                         Installing Software...
+-----------------------------------------------------------------------------+

installp: APPLYING software for:
        bos.sysmgt.nim.master 7.3.0.0


. . . . . << Copyright notice for bos.sysmgt >> . . . . . . .
 Licensed Materials - Property of IBM

 5765CD300
   Copyright International Business Machines Corp. 1993, 2021.

 All rights reserved.
 US Government Users Restricted Rights - Use, duplication or disclosure
 restricted by GSA ADP Schedule Contract with IBM Corp.
. . . . . << End of copyright notice for bos.sysmgt >>. . . .

Successfully updated the Kernel Authorization Table.
Successfully updated the Kernel Role Table.
Successfully updated the Kernel Command Table.
Successfully updated the Kernel Device Table.
Successfully updated the Kernel Object Domain Table.
Successfully updated the Kernel  Domains Table.
Successfully updated the Kernel RBAC log level.
Finished processing all filesets.  (Total time:  40 secs).

+-----------------------------------------------------------------------------+
                                Summaries:
+-----------------------------------------------------------------------------+

Installation Summary
--------------------
Name                        Level           Part        Event       Result
-------------------------------------------------------------------------------
bos.sysmgt.nim.master       7.3.0.0         USR         APPLY       SUCCESS
Defining NIM master...
0513-071 The nimesis Subsystem has been added.
0513-071 The nimd Subsystem has been added.
0513-059 The nimesis Subsystem has been started. Subsystem PID is 17301944.

NIM master setup is complete - enjoy!

real    1m25.55s
user    0m0.76s
sys     0m0.41s
# echo $?
0

enjoy..!

導入後のファイルセット確認

# lslpp -l | grep nim
  bos.sysmgt.nim.client      7.3.0.0  COMMITTED  Network Install Manager -
  bos.sysmgt.nim.master      7.3.0.0  COMMITTED  Network Install Manager -
  bos.sysmgt.nim.client      7.3.0.0  COMMITTED  Network Install Manager -
#

nim_master_setup で以下が定義されました。

# lsnim
master          machines        master
boot            resources       boot
nim_script      resources       nim_script
certificate     resources       certificate
master_net      networks        ent
# ls -l /etc/niminfo
-rw-r--r--    1 root     system          165 Dec 07 19:39 /etc/niminfo
# cat /etc/niminfo
# nimconfig
export NIM_NAME=master
export NIM_CONFIGURATION=master
export NIM_MASTER_PORT=1058
export NIM_REGISTRATION_PORT=1059
export NIM_MASTER_HOSTNAME=nimmaster1

② NIMクライアント定義

(1) /etc/hosts に nimclient1 のエントリーを追加

*NIMマスターで実行

# echo "172.16.x.xx nimclient1" >> /etc/hosts

(2) NIMクライアント側の /etc/hosts に nimmaster1, nimclient1 のエントリーを追加

*NIMクライアントで実行

# echo "172.16.x.xxx nimmaster1" >> /etc/hosts
# echo "172.16.x.xx nimclient1" >> /etc/hosts

(3) NIM マシンの定義

*NIMマスターで実行

・smit nim_mkmac
=> Host Name of Machine に1) で/etc/hostsに設定したホスト名を入力
  => で詳細(下記参照)を定義して実行


Type or select values in entry fields.
Press Enter AFTER making all desired changes.

                                                        [Entry Fields]
* NIM Machine Name                                   [nimclient1]
* Machine Type                                       [standalone]                                +
* Hardware Platform Type                             [chrp]                                      +
  Kernel to use for Network Boot                     [64]                                        +
  Communication Protocol used by client              []                                          +
  Primary Network Install Interface
*   Cable Type                                        N/A   #<= 変更しています                                      +
    Network Speed Setting                            []                                          +
    Network Duplex Setting                           []                                          +
*   NIM Network                                       master_net
*   Host Name                                         nimclient1
    Network Adapter Hardware Address                 [0]
    Network Adapter Logical Device Name              []
  IPL ROM Emulation Device                           []                                          +/
  CPU Id                                             []
  VLAN Tag Priority (0 to 7)                         []                                           #
  VLAN Tag Identifier (0 to 4094)                    []                                           #
  Machine Group                                      []                                          +

  Managing System Information
  WPAR Options
    Managing System                                  []
    -OR-
    LPAR Options
      Identity                                       []
      Management Source                              []                                          +

  Comments                                           []

(4) 確認

*NIMマスターで実行

nimclient1 マシンリソースの定義を確認します。

# lsnim -l nimclient1
nimclient1:
   class          = machines
   type           = standalone
   connect        = nimsh
   platform       = chrp
   netboot_kernel = 64
   if1            = master_net nimclient1 0
   cable_type1    = N/A
   Cstate         = ready for a NIM operation
   prev_state     = ready for a NIM operation
   Mstate         = currently running
#

~ 問題発生・対応 ~ (接続エラー)

マスターからクライアントへの接続が確認できない事象が発生しました...

下記はNIMマスターからクライアントのshowlog を実施した結果です。

                                           COMMAND STATUS

Command: OK            stdout: yes           stderr: no

Before command completion, additional instructions may appear below.

warning: warning: 0042-001 m_showlog: processing error encountered on "nimclient1":
   0042-006 m_showlog: (From_Master) connect Connection refused

nconn: connect() failed, errno is 79
nimclient1: Connection refused

Connection refused です..

問題判別と対応

色々調査した結果、以下で解決しました。

NIMクライアント側の/etc/niminfo が存在していないことを確認。(存在する場合は削除を実行)
NIMクライアント側で niminit を実行
 => smit niminit

以下を定義しています。

                      Configure Network Installation Management Client Fileset

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

                                                        [Entry Fields]
* Machine Name                                       [nimclient1]
* Primary Network Install Interface                  [en0]                                       +
* Host Name of Network Install Master                [nimmaster1]

  Hardware Platform Type                              chrp
  Kernel to use for Network Boot                     [64]                                        +
  Communication Protocol used by client              []                                          +
  Ethernet Interface Options
    Network Speed Setting                            []                                          +
    Network Duplex Setting                           []                                          +
  VLAN Tag Priority (0 to 7)                         []                                           #
  VLAN Tag Identifier (0 to 4094)                    []                                           #
  Comments                                           []

  Alternate Port Numbers for Network Communications
       (reserved values will be used if left blank)
    Client Registration                              []                                           #
    Client Communications                            []                                           #
# smitty niminit
                                           COMMAND STATUS

Command: OK            stdout: yes           stderr: no

Before command completion, additional instructions may appear below.

0513-059 The nimsh Subsystem has been started. Subsystem PID is 13303872.

-> nimsh が稼働しました。

その後にNIMマスターから NIMクライアントに対して showlog を実行すると、今度は接続エラーは出ませんでした。

                                           COMMAND STATUS

Command: OK            stdout: yes           stderr: no

Before command completion, additional instructions may appear below.

warning: warning: 0042-001 m_showlog: processing error encountered on "nimclient1":
   0042-218 c_showlog: The log file is either empty or does not exist at /var/adm/ras/nim.installp

NIMクライアント側で nimsh が稼働していないことが原因だったようです


③ NIMクライアントのmksysbリソースの定義

*NIMマスターで実行

(1) ファイルシステム拡張

mksysb を/ ファイルシステム上の /etc/mksysb/ 下に取得します。
/ (root) を拡張します。

# chfs -a size=11G /

(2) mksysb リソース用ディレクトリ作成

# mkdir /export/mksysb
# ls -l /export/mksysb
total 0
#

(3) mksysbリソースの定義

・smit nim_res
 => Define a Resource
  => Resource Type に mksysb を選択

                                         Define a Resource

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

                                                        [Entry Fields]
* Resource Name                                      [nimclient1_mksysb]
* Resource Type                                       mksysb
* Server of Resource                                 [master]                                    +
* Location of Resource                               [/export/mksysb/nimclinent1_mksysb]          /
  NFS Client Security Method                         []                                          +
  NFS Version Access                                 []                                          +
  Comments                                           []

  Source for Replication                             []                                          +
                  -OR-
  System Backup Image Creation Options:
    CREATE system backup image?                       yes                                        +
    NIM CLIENT to backup                             [nimclient1]                                +
    PREVIEW only?                                     no                                         +
    IGNORE space requirements?                        no                                         +
    EXPAND /tmp if needed?                            yes                                         +
    Create MAP files?                                 no                                         +
    Backup extended attributes?                       yes                                        +
    Number of BLOCKS to write in a single output     []                                           #
     (leave blank to use system default)
    Use local EXCLUDE file?                           no                                         +
     (specify no to include all files in backup)
                  -OR-
    EXCLUDE_FILES resource                           []                                          +
     (leave blank to include all files in backup)
   Create backup using snapshots?                     yes                                        +
    Backup encrypted files?                           yes                                        +
    Backup DMAPI filesystem files?                    yes                                        +
  Disable software packing of backup?                 no                                         +
  Use exclude_packing.rootvg file?                    no                                         +

実行中

Command: running       stdout: yes           stderr: no

Before command completion, additional instructions may appear below.


+---------------------------------------------------------------------+
                System Backup Image Space Information
              (Sizes are displayed in 1024-byte blocks.)
+---------------------------------------------------------------------+

Required = 2441149 (2384 MB)    Available = 11483404 (11215 MB)

Command: OK が返りました。

Command: OK            stdout: yes           stderr: no

Before command completion, additional instructions may appear below.


+---------------------------------------------------------------------+
                System Backup Image Space Information
              (Sizes are displayed in 1024-byte blocks.)
+---------------------------------------------------------------------+

Required = 2441149 (2384 MB)    Available = 11483404 (11215 MB)



Creating information file (/image.data) for rootvg..

Creating snapshots.....
Creating list of files to back up
..........
Backing up 56930 files..............................
22088 of 56930 files backed up (38%)..............................
51511 of 56930 files backed up (90%)....

56930 of 56930 files backed up (100%)
0512-038 savevg: Backup Completed Successfully.

(4) 取得したmksysb リソースの確認

# lsnim -l nimclient1_mksysb
nimclient1_mksysb:
   class         = resources
   type          = mksysb
   creation_date = Wed Dec 7 23:56:15 2022
   source_image  = nimclient1
   arch          = power
   Rstate        = ready for use
   prev_state    = unavailable for use
   location      = /export/mksysb/nimclient1_mksysb
   version       = 7
   release       = 1
   mod           = 5
   oslevel_r     = 7100-05
   oslevel_s     = 7100-05-09-2148
   alloc_count   = 0
   server        = master
#

mksysb ファイルのサイズは 1.7GB 程度です。

# ls -l /export/mksysb/nimclient1_mksysb
-rw-r--r--    1 root     system   1742080000 Dec 07 23:55 /export/mksysb/nimclient1_mksysb
#

mksysb リソースの作成が完了しました。

この後は必要に応じて lpp_source、spot リソース等を作成して検証環境とする予定です。


おわりに

Ansible での NIM定義は以下が参考になります。

いつか(?)検証します...

以上です。

8
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?