前回でInfiniBandのHBAが認識できたので、次はIPoverIBでiSCSIの設定をします。
次のコマンドで接続情報を追加します。
#nmcli con add type infiniband con-name ib0 ifname ib0 ip4 192.168.8.10/24
ディスクを確認します。8TBがsdbとsdcに割りあたっています。
# fdisk -l Disk /dev/sdc: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O サイズ (最小 / 推奨): 4096 バイト / 4096 バイト Disk /dev/sdb: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O サイズ (最小 / 推奨): 4096 バイト / 4096 バイト
次にSoftwareRAIDのmdadm をインストールします。
#yum install mdadm
sdbとsdcをmd8tbに割り当てます。
#mdadm --create /dev/md/md8tb --level=raid1 --name=md8tb --raid-devices=2 /dev/sdb /dev/sdc #mdadm --detail --scan > /etc/mdadm.conf
作成結果を確認します。
# mdadm --detail /dev/md/md8tb /dev/md/md8tb: Version : 1.2 Creation Time : Sun Jun 9 19:25:32 2019 Raid Level : raid1 Array Size : 7813894464 (7451.91 GiB 8001.43 GB) Used Dev Size : 7813894464 (7451.91 GiB 8001.43 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Intent Bitmap : Internal Update Time : Sun Jun 9 19:26:33 2019 State : clean, resyncing Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Consistency Policy : bitmap Resync Status : 0% complete Name : d525.gurees.net:md8tb (local to host d525.gurees.net) UUID : 393e8c29:25544971:c4194dc0:8280fde3 Events : 12 Number Major Minor RaidDevice State 0 8 16 0 active sync /dev/sdb 1 8 32 1 active sync /dev/sdc
iSCSIターゲットを構成します。
#yum install targetcli #systemctl enable target.service #systemctl start target.service #targetcli /backstores/block create name=lun1 dev=/dev/md/md8tb #targetcli /iscsi create iqn.2019-06.net.gurres:d525 #targetcli /iscsi/iqn.2019-06.net.gurres:d525/tpg1/luns create /backstores/block/lun1 #targetcli ls o- / ..................................................................... [...] o- backstores .......................................................... [...] | o- block .............................................. [Storage Objects: 1] | | o- lun1 .................... [/dev/md/md8tb (7.3TiB) write-thru activated] | | o- alua ............................................... [ALUA Groups: 1] | | o- default_tg_pt_gp ................... [ALUA state: Active/optimized] | o- fileio ............................................. [Storage Objects: 0] | o- pscsi .............................................. [Storage Objects: 0] | o- ramdisk ............................................ [Storage Objects: 0] o- iscsi ........................................................ [Targets: 1] | o- iqn.2019-06.d525.net.gurres:d525 .............................. [TPGs: 1] | o- tpg1 ........................................... [no-gen-acls, no-auth] | o- acls ...................................................... [ACLs: 0] | o- luns ...................................................... [LUNs: 1] | | o- lun0 .............. [block/lun1 (/dev/md/md8tb) (default_tg_pt_gp)] | o- portals ................................................ [Portals: 1] | o- 0.0.0.0:3260 ................................................. [OK] o- loopback ..................................................... [Targets: 0] o- srpt ......................................................... [Targets: 0] #targetcli saveconfig
iqn.2019-06.net.gurres:d525でIQNを構成しました。
接続もとのイニシエータのIQN調べて接続できるようにします。
#targetcli > cd /iscsi/iqn.2019-06.net.gurres:d525/tpg1/acls > create iqn.1998-01.com.vmware:5cec6c13-0c4d-e2b8-206d-6805ca32c43e-1310a439
これでiSCSIの設定は完了です。