目次
手順
1.iSCSIターゲット/LUNの作成
NASにiSCSIターゲット/LUNを作成する。手順は過去記事を参照。
iSCSI boot on QEMU+KVM case2 - なにかの技術メモ置き場
ターゲット名 | LUN番号 | ディスク容量 |
---|---|---|
tx1320 | 0 | 20GB |
2.BIOSでのiSCSIブートの有効化
Version 2.15.1236. Copyright (C) 2014 American Megatrends, Inc. BIOS Date: 04/16/2015 08:47:47 Ver: R2.14.0 for D3239-A1 Copyright (C) 2015 American Megatrends, Inc. Copyright (C) 2009-2015 Fujitsu Technology Solutions BIOS V4.6.5.4 R2.14.0 for D3239-A1x 4 logical CPUs installed. 10240 MB memory installed. iRMC Firmware rev 8.05F, SDR rev 3.16 Asset Tag : System Asset Tag Press <F2> to enter Setup or <F12> to enter Boot Menu. Entering Setup...
[Advanced]タブ→[Onboard Devices Configuration]を選択する。
Aptio Setup Utility - Copyright (C) 2015 American Megatrends, Inc. Main Advanced Security Power Server Mgmt Boot Save & Exit /----------------------------------------------------+-------------------------\ |> PCI Subsystem Settings |Onboard Devices | |> CPU Configuration |Configuration | |> SATA Configuration | | |> USB Configuration | | |> Onboard Devices Configuration | | |> Memory Status | | |> Super IO Configuration | | |> Network Stack | | |> Option ROM Configuration | | |> PCI Status |-------------------------- - |><: Select Screen | |> iSCSI Configuration |^v: Select Item | | |Enter: Select | | |+/-: Change Opt. | | |F1: General Help | | |F2: Previous Values | | |F3: Optimized Defaults | | |F4: Save & Exit | | |ESC: Exit | \----------------------------------------------------+-------------------------/ Version 2.15.1236. Copyright (C) 2015 American Megatrends, Inc.
LAN1をiSCSIに設定する。
※LAN2は任意。当環境ではPXEを使用するためPXEにしている。
Aptio Setup Utility - Copyright (C) 2015 American Megatrends, Inc. Advanced /----------------------------------------------------+-------------------------\ | Onboard Devices Configuration |[Disabled] | | |LAN controller is | | LAN 1 Controller [Enabled] |disabled. | | LAN 1 Oprom [iSCSI] |[Enabled] | | LAN 2 Controller [Enabled] |LAN controller is | | LAN 2 Oprom [PXE] |enabled. | | | | | High Precision Timer [Enabled] | | | | | | |-------------------------- - |><: Select Screen | | |^v: Select Item | | |Enter: Select | | |+/-: Change Opt. | | |F1: General Help | | |F2: Previous Values | | |F3: Optimized Defaults | | |F4: Save & Exit | | |ESC: Exit | \----------------------------------------------------+-------------------------/ Version 2.15.1236. Copyright (C) 2015 American Megatrends, Inc.
※補足だが、iSCSIはLAN1でしか設定できない。
Aptio Setup Utility - Copyright (C) 2015 American Megatrends, Inc. Advanced /----------------------------------------------------+-------------------------\ | Onboard Devices Configuration |Controls which ^| | |OptionROM will be *| | LAN 1 Controller [Enabled] |loaded for the *| | LAN 1 Oprom [iSCSI] |respective onboard LAN *| | LAN 2 Controller [Enabled] |port. *| | LAN 2 Oprom [PXE] |[Disabled] No OptionROM *| | /--- LAN 1 Oprom ----\ |is loaded. *| | High Precision Timer [E| Disabled | |[PXE] Load the PXE +| | | PXE | |OptionROM. v| | | iSCSI | |-------------------------- - \--------------------/ |><: Select Screen | | |^v: Select Item | | |Enter: Select | | |+/-: Change Opt. | | |F1: General Help | | |F2: Previous Values | | |F3: Optimized Defaults | | |F4: Save & Exit | | |ESC: Exit | \----------------------------------------------------+-------------------------/ Version 2.15.1236. Copyright (C) 2015 American Megatrends, Inc.
Aptio Setup Utility - Copyright (C) 2015 American Megatrends, Inc. Advanced /----------------------------------------------------+-------------------------\ | Onboard Devices Configuration |Controls which ^| | |OptionROM will be *| | LAN 1 Controller [Enabled] |loaded for the *| | LAN 1 Oprom [iSCSI] |respective onboard LAN *| | LAN 2 Controller [Enabled] |port. *| | LAN 2 Oprom [PXE] |[Disabled] No OptionROM *| | |is loaded. *| | High Precision Timer [E/--- LAN 2 Oprom ----\ |[PXE] Load the PXE +| | | Disabled | |OptionROM. v| | | PXE | |-------------------------- - \--------------------/ |><: Select Screen | | |^v: Select Item | | |Enter: Select | | |+/-: Change Opt. | | |F1: General Help | | |F2: Previous Values | | |F3: Optimized Defaults | | |F4: Save & Exit | | |ESC: Exit | \----------------------------------------------------+-------------------------/ Version 2.15.1236. Copyright (C) 2015 American Megatrends, Inc.
BIOSの設定を保存し、再起動する。
3.iSCSIの接続設定
1の設定によりiSCSIのROM?が有効になり、以下のマシン起動時に以下が表示されるようになる。[Ctrl+D]キーを押下する。
Intel(R) iSCSI Remote Boot version 3.0.34 Copyright (c) 2003-2014 Intel Corporation. All rights reserved. Press ESC key to skip iSCSI boot initialization. Press <Ctrl-D> to run setup...
iSCSIブートで使用するIFを選択する。見切れているので、[↓]キーでスクロールする。
本当はストレージNWであるLAN2(③)を使いたかったが、表示されないため使えない。仕方なく④を使用する。
Loc | 説明 | 背面写真のNo |
---|---|---|
4:0:0 | オンボード(LAN1) | ② |
3:0:3 | 拡張LANカード(port3) | ⑦ |
3:0:2 | 拡張LANカード(port2) | ⑥ |
3:0:1 | 拡張LANカード(port1) | ⑤ |
3:0:0 | 拡張LANカード(port0) | ④ |
******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************iSCSI Port Selection****************************** *********** *********** *********** *********** *********** *********** *********** MAC:901B0E6CB659 Dev:1533 Loc:4:0:0 BOOT:DISABLED *********** *********** *********** *********** MAC:001999B89143 Dev:150E Loc:3:0:3 BOOT:DISABLED *********** *********** *********** *********** MAC:001999B89142 Dev:150E Loc:3:0:2 BOOT:DISABLED *********** *********** *********** *********** MAC:001999B89141 Dev:150E Loc:3:0:1 BOOT:DISABLED *********** *********** *********** *********** More below ... *********** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** Select iSCSI Boot priority: P=PRIMARY S=SECONDARY D=DISABLED B=BLINK LED
MAC:001999B89140(Loc:3:0:0)のエントリを選択し、[P]キーを押下する。BOOTが[PRIMARY]に変わる。
[Enter]キーを押下する。
※画面は既に設定済み。
※あと他はデフォルトでは[PXE]だったが、一度[PXE]以外に設定したら戻せなくなったので、なんとなく[DISABLED]にしておいた。
******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************iSCSI Port Selection****************************** *********** *********** *********** More above ... *********** *********** *********** *********** MAC:001999B89143 Dev:150E Loc:3:0:3 BOOT:DISABLED *********** *********** *********** *********** MAC:001999B89142 Dev:150E Loc:3:0:2 BOOT:DISABLED *********** *********** *********** *********** MAC:001999B89141 Dev:150E Loc:3:0:1 BOOT:DISABLED *********** *********** *********** *********** MAC:001999B89140 Dev:150E Loc:3:0:0 BOOT:PRIMARY *********** *********** *********** *********** *********** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** Select iSCSI Boot priority: P=PRIMARY S=SECONDARY D=DISABLED B=BLINK LED
[iSCSI Boot Configuration]を選択し、[Enter]キーを押下する。
******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ****************************iSCSI Port Configuration**************************** ********************* ********************* ********************* ********************* ********************* ********************* ********************* iSCSI Boot Configuration ********************* ********************* ********************* ********************* iSCSI CHAP Configuration ********************* ********************* ********************* ********************* Discard changes and Exit ********************* ********************* ********************* ********************* Save changes and Exit ********************* ********************* ********************* ********************* ********************* ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** Copyright (c) 2003-2014 Intel Corporation. All rights reserved.
以下のように設定し、[OK]を選択し、[Enter]キーを押下する。
※一部見切れているので、設定した箇所を下表にまとめる。デフォルト値のままのものは省略。
パラメータ | 設定値 | 備考 |
---|---|---|
Use dynamic IP configuration (DHCP) | [] | 選択を外す |
Initiator Name | iqn.2020-12.tx1320 | 任意 |
Initiator IP | 172.16.1.103 | 任意 |
Subnet Mask | 255.255.255.0 | 任意 |
Target Name | iqn.2020-09.file01:tx1320 | 手順1で作成したiSCSIターゲットを指定 |
Target IP | 172.16.1.5 | NASのIPを指定 |
******************************************************************************** ****************************iSCSI Boot Configuration**************************** ************* ************* ************* [ ] Use dynamic IP configuration (DHCP) ************* ************* ************* ************* Initiator Name: iqn.2020-12.tx13 ************* ************* Initiator IP: 172.16.1.103____ ************* ************* Subnet Mask: 255.255.255.0___ ************* ************* Gateway: 0.0.0.0_________ ************* ************* VLAN ID: ************* ************* ************* ************* [ ] Use DHCP for iSCSI Target information ************* ************* ************* ************* Target Name: iqn.2020-09.file ************* ************* Target IP: 172.16.1.5______ ************* ************* Target Port: 3260____________ ************* ************* Boot LUN: 0_______________ ************* ************* Press spacebar to change ************* ************* ************* ************* [OK] [Cancel] ************* ************* ************* ******************************************************************************** ******************************************************************************** Copyright (c) 2003-2014 Intel Corporation. All rights reserved.
[Save changes and Exit]を選択し、[Enter]キーを押下する。
******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ****************************iSCSI Port Configuration**************************** ********************* ********************* ********************* ********************* ********************* ********************* ********************* iSCSI Boot Configuration ********************* ********************* ********************* ********************* iSCSI CHAP Configuration ********************* ********************* ********************* ********************* Discard changes and Exit ********************* ********************* ********************* ********************* Save changes and Exit ********************* ********************* ********************* ********************* ********************* ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** Copyright (c) 2003-2014 Intel Corporation. All rights reserved.
[Yes]を選択し、[Enter]キーを押下する。
******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ****************************iSCSI Port Configuration**************************** ********************* ********************* ********************* ********************* ********************* ****************************** ********************* ********************* * * ********************* ********************* * Save changes and exit ? * ********************* ********************* * * ********************* ********************* * * ********************* ********************* * [Yes] [No] * ********************* ********************* * * ********************* ********************* ****************************** ********************* ********************* ********************* ********************* ********************* ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** Copyright (c) 2003-2014 Intel Corporation. All rights reserved.
[ESC]キーを押下する。
※設定画面から抜ける。
******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************iSCSI Port Selection****************************** *********** *********** *********** More above ... *********** *********** *********** *********** MAC:001999B89143 Dev:150E Loc:3:0:3 BOOT:PXE *********** *********** *********** *********** MAC:001999B89142 Dev:150E Loc:3:0:2 BOOT:PXE *********** *********** *********** *********** MAC:001999B89141 Dev:150E Loc:3:0:1 BOOT:PXE *********** *********** *********** *********** MAC:001999B89140 Dev:150E Loc:3:0:0 BOOT:PRIMARY *********** *********** *********** *********** *********** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** Select iSCSI Boot priority: P=PRIMARY S=SECONDARY D=DISABLED B=BLINK LED
以降、マシン起動時に以下が表示されるようになり、iSCSIディスクに接続されていることがわかる。
Intel(R) iSCSI Remote Boot version 3.0.34 Copyright (c) 2003-2014 Intel Corporation. All rights reserved. Press ESC key to skip iSCSI boot initialization. Initializing adapter configuration - MAC address(001999B89140). Using STATIC configuration for primary port, please wait. iSCSI Target Name : iqn.2020-09.file01:tx1320 iSCSI Target IP Address : 172.16.1.5 LUN ID: 0 Port: 3260 iSCSI Initiator IP : 172.16.1.103 iSCSI Gateway IP : 0.0.0.0 iSCSI Initiator Name : iqn.2020-12.tx1320 Attempting to connect to target disk using MAC address(001999B89140) LUN: 0 DEVICE: LIO-ORG FILEIO 20.0 GB
4.OSのインストール
過去記事を参照。
iSCSI boot on QEMU+KVM case2 - なにかの技術メモ置き場
※前回のQEMU+KVM環境とは異なり、今回はiSCSIターゲットへのログインまで自動化されていた。
5.iSCSIブートの確認
Aptio Setup Utility - Copyright (C) 2015 American Megatrends, Inc. Main Advanced Security Power Server Mgmt Boot Save & Exit /----------------------------------------------------+-------------------------\ | PXE Boot Option Retry [Disabled] ^|Sets the system boot | | Boot error handling [Continue] +|order. | | Driver GUID to [Disabled] +| | | console +| | | Virus Warning [Disabled] +| | | Boot Removable Media [Enabled] *| | | *| | | CSM Configuration *| | | *| | | Boot Option Priorities *|-------------------------- - Boot Option #1 [Intel(R) iSCSI Remote *|><: Select Screen | | Boot Loc0] *|^v: Select Item | | Boot Option #2 [(Bus 01 Dev 00)PCI *|Enter: Select | | RAID Adapter] *|+/-: Change Opt. | | Boot Option #3 [P4: TSSTcorp DVD-ROM *|F1: General Help | | SN-108FB] *|F2: Previous Values | | Boot Option #4 [IBA GE Slot 00C8 *|F3: Optimized Defaults | | v1562] *|F4: Save & Exit | | v|ESC: Exit | \----------------------------------------------------+-------------------------/ Version 2.15.1236. Copyright (C) 2015 American Megatrends, Inc.
ここまで来たらiSCSIディスクの中が見えている。
CentOS Linux (4.18.0-193.el8.x86_64) 8 (Core) CentOS Linux (0-rescue-86d2ecc2314d42de98ebca262ae7bbdd) 8 (Core) Use the * and * keys to change the selection. Press 'e' to edit the selected item, or 'c' for a command prompt. The selected entry will be started automatically in 1s.
OSにログインし、各種状態を確認してみる。
[root@tx1320 ~]# iscsiadm -m session tcp: [1] 172.16.1.5:3260,1 iqn.2020-09.file01:tx1320 (non-flash)
ストレージNWのみでiSCSI接続していることが確認できる。この設定はOSインストール時にGUIで設定したものが保持されていると思われる。
[root@localhost ~]# parted -l モデル: LIO-ORG FILEIO (scsi) ディスク /dev/sda: 21.5GB セクタサイズ (論理/物理): 512B/512B パーティションテーブル: msdos ディスクフラグ: 番号 開始 終了 サイズ タイプ ファイルシステム フラグ 1 1049kB 1075MB 1074MB primary ext4 boot 2 1075MB 3222MB 2147MB primary linux-swap(v1) 3 3222MB 21.5GB 18.3GB primary xfs
モデル名と容量から、手順1で作成したディスクであることが確認できる。
※ローカルディスクを搭載している場合は/dev/sdbなどで認識される。
[root@tx1320 ~]# ip address show dev eno1 7: eno1:mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 90:1b:0e:6c:b6:59 brd ff:ff:ff:ff:ff:ff inet 172.16.0.85/24 brd 172.16.0.255 scope global dynamic eno1 valid_lft 507sec preferred_lft 507sec inet6 fe80::921b:eff:fe6c:b659/64 scope link noprefixroute valid_lft forever preferred_lft forever
[root@tx1320 ~]# ip address show dev eno2 5: eno2:mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 90:1b:0e:8c:39:70 brd ff:ff:ff:ff:ff:ff inet 172.16.1.81/24 brd 172.16.1.255 scope global dynamic eno2 valid_lft 505sec preferred_lft 505sec inet6 fe80::921b:eff:fe8c:3970/64 scope link noprefixroute valid_lft forever preferred_lft forever
[root@tx1320 ~]# ip address show dev ens1f0 2: ens1f0:mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:19:99:b8:91:40 brd ff:ff:ff:ff:ff:ff inet 172.16.1.82/24 brd 172.16.1.255 scope global dynamic ens1f0 valid_lft 496sec preferred_lft 496sec inet6 fe80::219:99ff:feb8:9140/64 scope link noprefixroute valid_lft forever preferred_lft forever
→OSインストール時に設定した固定IP・・・になっていない。
[root@tx1320 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eno1 # Generated by dracut initrd NAME="eno1" DEVICE="eno1" ONBOOT=yes NETBOOT=yes UUID="1356cc1e-b584-48cb-8504-976d0fbfcfcd" IPV6INIT=yes BOOTPROTO=dhcp TYPE=Ethernet
DHCPで付与されている。なぜだ。
さらに問題はこのあと。改めて固定IPを設定したのだが、OS再起動に設定が戻ってしまった。
一番驚いたのが、ifcfg-eno1を変更したのに、そのファイルすら戻っていたこと。
ディスクに書き込めていなかった?いや、他のファイルやホスト名変更はOS再起動後も設定が維持されていた。
参考サイト
なし