AIX上のクラスター製品であるPowerHA for AIXでは、v7.2.4からレポジトリーディスク(クラスター構成情報を共有するストレージ)としてiSCSIディスクが利用可能となっていたので、AIXのみでiSCSIのターゲット(ディスク提供側)、イニシエーター(ディスク利用側)の設定を試みた。
環境
- node0: AIXによるiSCSIターゲット(ディスク提供側)
- 1GBのLVをiSCSIディスクとしてnode1に提供
- node1: AIXによるiSCSIイニシエーター(ディスク利用)
- 1GBのiSCSIディスクを利用
AIXによるiSCSIターゲット(ディスク提供側)
node0
基本的には以下の手順に従う
https://www.ibm.com/docs/ja/aix/7.2?topic=target-configuring-iscsi-software
iSCSI Target Software Device導入
AIX拡張パック(AIX Expansion pack)に含まれるdevices.tmiscsw.rteファイルセットを導入
# installp -aXYg -d <devices.tmiscsw.rteファイルの存在するディレクトリー> devices.tmiscsw
...
中略
...
* * * A T T E N T I O N * * *
System boot image has been updated. You should reboot the
system as soon as possible to properly integrate the changes
and to avoid disruption of current functionality.
installp: bosboot process completed.
+-----------------------------------------------------------------------------+
Summaries:
+-----------------------------------------------------------------------------+
Installation Summary
--------------------
Name Level Part Event Result
-------------------------------------------------------------------------------
devices.tmiscsw.rte 7.2.5.100 USR APPLY SUCCESS
devices.tmiscsw.rte 7.2.5.100 ROOT APPLY SUCCESS
reboot
# shutdown -Fr
iSCSI ターゲット・プロトコル・デバイスの追加
# smit tmiscsi_proto_add # (dev -> iscsi -> tmiscsi -> tmiscsi_proto -> tmiscsi_proto_add)
Add an iSCSI Target Protocol Device
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
iSCSI Target Protocol Device Name tmsw0
Maximum number of sessions [200] +#
Maximum transfer size in one PDU [262144] +#
Access Control enabled [off] +
Apply change to DATABASE only no +
パラメーターはデフォルト
Enter
tmsw0 Availableとなる。
iSCSI ターゲットの追加
# smit tmtarget_add # (dev -> iscsi -> tmiscsi-> tmtarget -> tmtarget_add)
Add an iSCSI Target
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
iSCSI Target Protocol Device Name tmsw0
iSCSI Target Logical Name []
* iSCSI Target Name [iqn.2003-01.com.ibm:tmiscsi0]
Maximum Target LUNs allowed [512] +#
Paths []
Force disconnection of iSCSI clients on remove [no] +
Initiator Reconnection delay [] +#
Addressing method [0] +#
Apply change to DATABASE only no +
Target Registration Method [none] +
SLP Registration Lifetime [] +#
iSNS Servers Names [] +
iSCSI Target Nameは、iqn.もしくは、eui.<16 ASCII-encoded hexadecimal digits>書式での指定が必要。
ここでは他はデフォルトとしている
Enter
target0 Availableとなる
iSCSIディスクとして提供するLVを構成
ここでは簡易に、OSを構成するrootvg上に1GBのLV(論理ボリューム)を作成し、それをiSCSIディスクとして提供する。
# lsvg rootvg
...
VG STATE: active PP SIZE: 32 megabyte(s)
...
# mklv rootvg $((1024 / 32)) # 1024 megabytes / 32 megabytes
fslv00
iSCSI ターゲット・ロジカル・ユニットの追加
# smit tmlun_add # (dev -> iscsi -> tmiscsi-> tmlun -> tmlun_add)
+--------------------------------------------------------------------------+
| iSCSI Parent Target Name |
| |
| Move cursor to desired item and press Enter. |
| |
| target0 Available iSCSI Target Mode Target |
| |
target0を選択してEnter
Add an iSCSI Target Logical Unit
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
iSCSI Parent Target Name target0
Logical Unit Name []
* Backing Device Type [lv] +
Backing Device Name [fslv00] +
Backing File Full Path Name [] /
Maximum Number of Commands to Queue to Device [3] +#
Apply change to DATABASE only no +
lv fslv00を使用してサービスを提供。他にdiskやfileが選択可能。
lu0 Availableとなる。
AIXによるiSCSIイニシエーター(ディスク利用側)
node1
以下の手順に従う
https://www.ibm.com/docs/ja/aix/7.2?topic=target-configuring-iscsi-software-initiator
必要ファイルセット
もし以下ファイルセットが導入されていなければ導入し、cfgmgrコマンドを実行
- devices.common.IBM.iscsi.rte Common iSCSI Files
- devices.iscsi.disk.rte iSCSI Disk Software
- devices.iscsi_sw.rte iSCSI Software Device Driver
iSCSI Protocol Deviceの構成
# smit chgiscsisw # dev -> iscsi -> iscsi_proto -> chgiscsisw
+--------------------------------------------------------------------------+
| iSCSI Protocol Device |
| |
| Move cursor to desired item and press Enter. |
| |
| iscsi0 Available iSCSI Protocol Device |
| |
iscsi0を選択してEnter
Change / Show Characteristics of iSCSI Protocol Device
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
iSCSI Protocol Device iscsi0
Description iSCSI Protocol Device
Status Available
iSCSI Initiator Name [iqn.2003-01.com.ibm:node1]
Discovery Policy file +
Configuration file [/etc/iscsi/targets] /
Support ImmediateData no +
Require InitialR2T yes +
iSCSI Network Error Recovery Policy delayed_fail +
Maximum Targets Allowed [16] +#
Maximum Transfer Size [0x80000] +
Maximum number of commands to queue to driver [200] +#
iSNS Servers IP Addresses [auto]
iSNS Servers Port Numbers []
Apply change to DATABASE only no +
iSCSI Initiator NameにはiSCSIイニシエーター名として、iqn.などのフォーマットでユニークな名前を指定。
設定は/etc/iscsi/targetsテキストファイルを使用して行う。
iscsi0 changedとなる
構成ファイル作成
node0 のIPアドレスを172.16.100.242、アクセスに使用するポート番号を3260とする。
構成ファイル/etc/iscsi/targetsを作成
# echo 172.16.100.242 3260 iqn.2003-01.com.ibm:tmiscsi0 >> /etc/iscsi/targets
# grep -v "^#" /etc/iscsi/targets
172.16.100.242 3260 iqn.2003-01.com.ibm:tmiscsi0
構成ファイル内容をAIXに反映
# cfgmgr -vl iscsi0
----------------
Attempting to configure device 'iscsi0'
Time: 0 LEDS: 0x25b0
Invoking /usr/lib/methods/cfgiscsi -l iscsi0
Number of running methods: 1
----------------
Completed method for: iscsi0, Elapsed time = 1
Return code = 0
***** stdout *****
hdisk1
*** no stderr ****
----------------
Time: 1 LEDS: 0x539
Number of running methods: 0
----------------
Attempting to configure device 'hdisk1'
Time: 1 LEDS: 0x25f3
Invoking /usr/lib/methods/cfgscsidisk -l hdisk1
Number of running methods: 1
----------------
Completed method for: hdisk1, Elapsed time = 0
Return code = 0
*** no stdout ****
*** no stderr ****
----------------
Time: 1 LEDS: 0x539
Number of running methods: 0
----------------
Calling savebase
Return code = 0
*** no stdout ****
*** no stderr ****
Configuration time: 1 seconds
詳細出力が不要である場合にはcfgmgr -l iscsi0とする。
デバイス、アクセスの確認
# lsdev -Ccdisk
hdisk0 Available C4-T1-01 MPIO IBM 2076 FC Disk
hdisk1 Available MPIO IBM AIX iSCSI Target Disk
# lspv
hdisk0 00fa00d6b552f41b rootvg active
hdisk1 none None
# mkvg hdisk1
0516-1254 mkvg: Changing the PVID in the ODM.
vg00
# lspv
hdisk0 00fa00d6b552f41b rootvg active
hdisk1 00cc20c022601f71 vg00 active
# lsvg vg00
VOLUME GROUP: vg00 VG IDENTIFIER: 00cc20c000004b000000018622602097
VG STATE: active PP SIZE: 4 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 234 (936 megabytes)
MAX LVs: 256 FREE PPs: 234 (936 megabytes)
LVs: 0 USED PPs: 0 (0 megabytes)
OPEN LVs: 0 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32768 MAX PVs: 1024
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
MIRROR POOL STRICT: off
PV RESTRICTION: none INFINITE RETRY: no
DISK BLOCK SIZE: 512 CRITICAL VG: no
FS SYNC OPTION: no CRITICAL PVs: no
ENCRYPTION: yes