PowerScale でアラートの警告をCLIで消す


PowerScale/Isilon/One FSシミュレータをvSphere環境上にたてて放置しておいたら、アラートが上がっている。

One or more drives (location(s) Bay 7, Bay 8, Bay 9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy.

各ノードのBayについて出ている。

[Cluster Management]-[Hardware Configuration]の[Drives]で該当ノードをスロットを確認するとたしかに「Empty」となっている。

sshアクセスして「isi status」の結果をとってみる。

isilon-1# isi status
Cluster Name: isilon
Cluster Health:     [ ATTN]
Data Reduction:     1.08 : 1
Storage Efficiency: 0.27 : 1
Cluster Storage:  HDD                 SSD Storage
Size:             403.2G (548.1G Raw) 0 (0 Raw)
VHS Size:         144.9G
Used:             7.3G (2%)           0 (n/a)
Avail:            395.9G (98%)        0 (n/a)

                   Health  Throughput (bps)  HDD Storage      SSD Storage
ID |IP Address     |DASR |  In   Out  Total| Used / Size     |Used / Size
---+---------------+-----+-----+-----+-----+-----------------+-----------------
  1|172.17.44.85   | OK  |    0| 1.4M| 1.4M| 1.0G/57.6G(  2%)|(No Storage SSDs)
  2|n/a            |-A-- |    0| 224k| 224k| 791M/57.6G(  1%)|(No Storage SSDs)
  3|172.17.44.87   | OK  |    0|    0|    0| 1.2G/57.6G(  2%)|(No Storage SSDs)
  4|172.17.44.88   | OK  |    0| 526k| 526k|1022M/57.6G(  2%)|(No Storage SSDs)
  5|172.17.44.89   | OK  |    0|49.7k|49.7k| 922M/57.6G(  2%)|(No Storage SSDs)
  6|172.17.44.86   | OK  |    0|33.3k|33.3k| 1.3G/57.6G(  2%)|(No Storage SSDs)
  7|n/a            |-A-- |    0|60.1k|60.1k| 1.2G/57.6G(  2%)|(No Storage SSDs)
---+---------------+-----+-----+-----+-----+-----------------+-----------------
Cluster Totals:          |    0| 2.2M| 2.2M| 7.3G/ 403G(  2%)|(No Storage SSDs)

     Health Fields: D = Down, A = Attention, S = Smartfailed, R = Read-Only

Critical Events:
Time            LNN  Event
--------------- ---- -------------------------------------------------------
03/15 19:12:38  2    One or more drives (location(s) Bay  7, Bay  8, Bay ...
03/15 19:23:19  7    One or more drives (location(s) Bay  7, Bay  8, Bay ...


Cluster Job Status:

No running jobs.

No paused or waiting jobs.

No failed jobs.

Recent job results:
Time            Job                        Event
--------------- -------------------------- ------------------------------
03/16 04:00:25  ShadowStoreProtect[63]     Succeeded
03/16 02:00:13  WormQueue[62]              Succeeded
03/16 00:01:00  ShadowStoreDelete[61]      Succeeded
03/15 22:12:38  SnapshotDelete[60]         Succeeded
03/15 22:02:43  FSAnalyze[59]              Succeeded
03/15 22:01:12  SmartPools[58]             Succeeded
03/15 20:00:26  ShadowStoreProtect[57]     Succeeded
03/15 19:16:11  MultiScan[56]              Succeeded
03/15 19:04:57  MultiScan[55]              Succeeded
03/15 19:00:06  MultiScan[53]              Succeeded

isilon-1#

イベントのアラートをとりあえず消すか、と、まずはイベントのeventgroup IDを確認するため「isi event events list –format=csv」を実行。
(「isi event events list」だと無駄なスペースが多くて探しにくいので、コンパクトなcsv出力にしています。)

isilon-1# isi event events list --format=csv
ID,Occurred,Sev,Lnn,"Eventgroup ID",Message
1.2,1646613393,W,1,1,"The SmartPools upgrade has not completed. Please contact PowerScale support and reference emc321047"
1.176,1646613393,U,1,1,
1.331,1646613875,I,-1,1024,"Resolving event group"
1.273,1646613695,W,-1,1024,"Node 2 is unprovisioned"
1.1120,1647338834,C,0,1051,"Resolved from PAPI"
1.356,1646614051,C,1,1051,"One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy."
1.1119,1647338833,C,0,1052,"Resolved from PAPI"
2.314,1646614344,C,-1,1052,"One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy."
1.1122,1647338838,C,0,1053,"Resolved from PAPI"
3.263,1646614413,C,-1,1053,"One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy."
1.802,1647310249,C,0,1054,"Resolved from PAPI"
4.254,1646614484,C,4,1054,"One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy."
4.269,1646665200,I,4,1060,"Heartbeat Event"
1.376,1646665200,I,1,1061,"Heartbeat Event"
3.304,1646751600,I,-1,1085,"Heartbeat Event"
4.296,1646751600,I,4,1086,"Heartbeat Event"
2.355,1646751600,I,-1,1087,"Heartbeat Event"
1.426,1646751600,I,1,1088,"Heartbeat Event"
2.384,1646838000,I,-1,1111,"Heartbeat Event"
4.325,1646838000,I,4,1112,"Heartbeat Event"
3.333,1646838000,I,-1,1113,"Heartbeat Event"
1.477,1646838000,I,1,1114,"Heartbeat Event"
2.412,1646924400,I,-1,1137,"Heartbeat Event"
1.527,1646924400,I,1,1138,"Heartbeat Event"
4.353,1646924400,I,4,1144,"Heartbeat Event"
3.361,1646924400,I,-1,1145,"Heartbeat Event"
2.441,1647010800,I,-1,1163,"Heartbeat Event"
4.382,1647010800,I,4,1164,"Heartbeat Event"
3.390,1647010800,I,-1,1165,"Heartbeat Event"
1.578,1647010800,I,1,1166,"Heartbeat Event"
1.635,1647097200,I,1,1194,"Heartbeat Event"
3.420,1647097200,I,-1,1200,"Heartbeat Event"
4.412,1647097200,I,4,1201,"Heartbeat Event"
2.471,1647097200,I,-1,1202,"Heartbeat Event"
2.500,1647183600,I,-1,1220,"Heartbeat Event"
1.686,1647183600,I,1,1221,"Heartbeat Event"
3.449,1647183600,I,-1,1227,"Heartbeat Event"
4.441,1647183600,I,4,1228,"Heartbeat Event"
2.529,1647270000,I,-1,1246,"Heartbeat Event"
3.478,1647270000,I,-1,1247,"Heartbeat Event"
4.470,1647270000,I,4,1248,"Heartbeat Event"
1.737,1647270000,I,1,1249,"Heartbeat Event"
1.1121,1647338837,C,0,1457,"Resolved from PAPI"
5.271,1647337391,C,5,1457,"One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy."
1.1028,1647337630,I,3,1458,"Resolving event group"
1.1016,1647337569,W,3,1458,"Node 3 is unprovisioned"
1.1054,1647338168,I,6,1471,"Resolving event group"
1.1042,1647338049,W,6,1471,"Node 6 is unprovisioned"
1.1109,1647338661,C,0,1476,"Resolved from PAPI"
6.270,1647338209,C,3,1476,"One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy."
1.1137,1647339264,I,7,1520,"Resolving event group"
1.1124,1647339143,C,7,1520,"Node 7 is offline"
8.270,1647339158,C,2,1523,"One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy."
1.1138,1647339265,I,7,1525,"Node 7 is online (offline event 1.1124, Tue Mar 15 19:12:23 2022 to Tue Mar 15 19:14:24 2022)"
9.268,1647339799,C,7,1535,"One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy."
8.445,1647356400,I,2,1578,"Heartbeat Event"
7.297,1647356401,I,6,1579,"Heartbeat Event"
5.325,1647356400,I,5,1580,"Heartbeat Event"
6.306,1647356400,I,3,1581,"Heartbeat Event"
1.1201,1647356401,I,1,1582,"Heartbeat Event"
9.432,1647356400,I,7,1588,"Heartbeat Event"
4.589,1647356401,I,4,1589,"Heartbeat Event"
1.322,1646613815,I,1,4,"Resolving event group"
1.171,1646613514,W,1,4,"Node 1 is unprovisioned"
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total: 64                                                                                                                                            
isilon-1#

出力の「Lnn」に注目してもらうと見えてくるのですが、isi statusで出ている2,7以外でもこのメッセージは出ていて、それはすでにResolveとしていたりします。

Lnn単位でフィルターするオプションはないようなので、grepします。

「isi status」で確認した時刻「03/15 19:23:19」を使います。

Critical Events:
Time            LNN  Event
--------------- ---- -------------------------------------------------------
03/15 19:12:38  2    One or more drives (location(s) Bay  7, Bay  8, Bay ...
03/15 19:23:19  7    One or more drives (location(s) Bay  7, Bay  8, Bay ...

format=csvの時の時刻はunixtimeとなっているのでdateコマンドを使って変換します。ただし、OneFSのdateコマンドはBSD dateなのでオプションの違いに注意する必要があります。

isilon-1# date -j -f "%Y-%m-%d %H:%M:%S" "2022-03-15 19:12:38" +%s
1647339158
isilon-1#

unixtimeが判明したので、grepします。

isilon-1# isi event events list --format=csv|grep 1647339158
8.270,1647339158,C,2,1523,"One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy."
isilon-1#

出力は「ID,Occurred,Sev,Lnn,”Eventgroup ID”,Message」という順番なので
 ID:8.270
 Lnn:2
 Eventgroup ID:1523
となります。

イベントの単品を確認する場合は「isi event events view <ID>」を実行します。

isilon-1# isi event events view 8.270
           ID: 8.270
Eventgroup ID: 1523
   Event Type: 100010011
      Message: One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy.
        Devid: 8
          Lnn: 2
         Time: 2022-03-15T19:12:38
     Severity: critical
        Value: 9.0
isilon-1#

Eventgroup IDベースで確認するのであれば「isi event view –id=<EventGroupID>」

isilon-1# isi event view --id=1523
          ID: 1523
     Started: 03/15 19:12
 Causes Long: One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy.
         Lnn: 2
       Devid: 8
  Last Event: 2022-03-15T19:12:38
      Ignore: No
 Ignore Time: Never
    Resolved: No
Resolve Time: Never
       Ended: --
      Events: 1
    Severity: critical
isilon-1#

解決するには「isi event modify –id=<EventGroupID> –resolved=true」を実行

isilon-1# isi event modify --id=1523 --resolved=true
isilon-1# isi status
Cluster Name: isilon
<略>
Critical Events:
Time            LNN  Event
--------------- ---- -------------------------------------------------------
03/15 19:23:19  7    One or more drives (location(s) Bay  7, Bay  8, Bay ...

<略>
isilon-1# 

該当するアラートが消えました。

同様に残っているもう1つも消します。

isilon-1# date -j -f "%Y-%m-%d %H:%M:%S" "2022-03-15 19:23:19" +%s
1647339799
isilon-1# isi event events list --format=csv|grep 1647339799
9.268,1647339799,C,7,1535,"One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy."
isilon-1# isi event view --id 1535
          ID: 1535
     Started: 03/15 19:23
 Causes Long: One or more drives (location(s) Bay  7, Bay  8, Bay  9, Bay 10, Bay 11, Bay 12, Bay 13, Bay 14, Bay 15 / type(s) HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD, HDD) are not healthy.
         Lnn: 7
       Devid: 9
  Last Event: 2022-03-15T19:23:19
      Ignore: No
 Ignore Time: Never
    Resolved: No
Resolve Time: Never
       Ended: --
      Events: 1
    Severity: critical
isilon-1# isi event modify --id=1535 --resolved=true
isilon-1# isi status
Cluster Name: isilon
Cluster Health:     [ ATTN]
Data Reduction:     1.08 : 1
Storage Efficiency: 0.27 : 1
Cluster Storage:  HDD                 SSD Storage
Size:             403.2G (548.1G Raw) 0 (0 Raw)
VHS Size:         144.9G
Used:             7.4G (2%)           0 (n/a)
Avail:            395.8G (98%)        0 (n/a)

                   Health  Throughput (bps)  HDD Storage      SSD Storage
ID |IP Address     |DASR |  In   Out  Total| Used / Size     |Used / Size
---+---------------+-----+-----+-----+-----+-----------------+-----------------
  1|172.17.44.85   | OK  | 551k| 4.7M| 5.3M| 1.0G/57.6G(  2%)|(No Storage SSDs)
  2|n/a            | OK  |    0|14.5k|14.5k| 795M/57.6G(  1%)|(No Storage SSDs)
  3|172.17.44.87   | OK  |    0|33.2k|33.2k| 1.2G/57.6G(  2%)|(No Storage SSDs)
  4|172.17.44.88   | OK  |    0|49.7k|49.7k| 1.0G/57.6G(  2%)|(No Storage SSDs)
  5|172.17.44.89   | OK  |    0|22.4k|22.4k| 924M/57.6G(  2%)|(No Storage SSDs)
  6|172.17.44.86   | OK  |    0| 230k| 230k| 1.3G/57.6G(  2%)|(No Storage SSDs)
  7|n/a            |-A-- | 9.7k| 96.0| 9.8k| 1.2G/57.6G(  2%)|(No Storage SSDs)
---+---------------+-----+-----+-----+-----+-----------------+-----------------
Cluster Totals:          | 561k| 5.1M| 5.6M| 7.4G/ 403G(  2%)|(No Storage SSDs)

     Health Fields: D = Down, A = Attention, S = Smartfailed, R = Read-Only

Critical Events:
Time            LNN  Event
--------------- ---- -------------------------------------------------------


Cluster Job Status:

No running jobs.

No paused or waiting jobs.

No failed jobs.

Recent job results:
Time            Job                        Event
--------------- -------------------------- ------------------------------
03/16 04:00:25  ShadowStoreProtect[63]     Succeeded
03/16 02:00:13  WormQueue[62]              Succeeded
03/16 00:01:00  ShadowStoreDelete[61]      Succeeded
03/15 22:12:38  SnapshotDelete[60]         Succeeded
03/15 22:02:43  FSAnalyze[59]              Succeeded
03/15 22:01:12  SmartPools[58]             Succeeded
03/15 20:00:26  ShadowStoreProtect[57]     Succeeded
03/15 19:16:11  MultiScan[56]              Succeeded
03/15 19:04:57  MultiScan[55]              Succeeded
03/15 19:00:06  MultiScan[53]              Succeeded

isilon-1#

あれ?「Critical Events」に何もないのに、「Cluster Health:ATTN」のまま?

大丈夫です。クラスタステータスの更新は少し時間が掛かっているだけでした。

isilon-1# isi status
Cluster Name: isilon
Cluster Health:     [  OK ]
Data Reduction:     1.08 : 1
Storage Efficiency: 0.27 : 1
Cluster Storage:  HDD                 SSD Storage
Size:             403.2G (548.1G Raw) 0 (0 Raw)
VHS Size:         144.9G
Used:             7.4G (2%)           0 (n/a)
Avail:            395.8G (98%)        0 (n/a)

                   Health  Throughput (bps)  HDD Storage      SSD Storage
ID |IP Address     |DASR |  In   Out  Total| Used / Size     |Used / Size
---+---------------+-----+-----+-----+-----+-----------------+-----------------
  1|172.17.44.85   | OK  |    0| 200k| 200k| 1.0G/57.6G(  2%)|(No Storage SSDs)
  2|n/a            | OK  |    0|    0|    0| 792M/57.6G(  1%)|(No Storage SSDs)
  3|172.17.44.87   | OK  |    0| 244k| 244k| 1.2G/57.6G(  2%)|(No Storage SSDs)
  4|172.17.44.88   | OK  |    0|24.9k|24.9k| 1.0G/57.6G(  2%)|(No Storage SSDs)
  5|172.17.44.89   | OK  |    0| 128k| 128k| 924M/57.6G(  2%)|(No Storage SSDs)
  6|172.17.44.86   | OK  |    0|33.3k|33.3k| 1.3G/57.6G(  2%)|(No Storage SSDs)
  7|n/a            | OK  |    0| 175k| 175k| 1.2G/57.6G(  2%)|(No Storage SSDs)
---+---------------+-----+-----+-----+-----+-----------------+-----------------
Cluster Totals:          |    0| 805k| 805k| 7.4G/ 403G(  2%)|(No Storage SSDs)

     Health Fields: D = Down, A = Attention, S = Smartfailed, R = Read-Only

Critical Events:
Time            LNN  Event
--------------- ---- -------------------------------------------------------


Cluster Job Status:

No running jobs.

No paused or waiting jobs.

No failed jobs.

Recent job results:
Time            Job                        Event
--------------- -------------------------- ------------------------------
03/16 04:00:25  ShadowStoreProtect[63]     Succeeded
03/16 02:00:13  WormQueue[62]              Succeeded
03/16 00:01:00  ShadowStoreDelete[61]      Succeeded
03/15 22:12:38  SnapshotDelete[60]         Succeeded
03/15 22:02:43  FSAnalyze[59]              Succeeded
03/15 22:01:12  SmartPools[58]             Succeeded
03/15 20:00:26  ShadowStoreProtect[57]     Succeeded
03/15 19:16:11  MultiScan[56]              Succeeded
03/15 19:04:57  MultiScan[55]              Succeeded
03/15 19:00:06  MultiScan[53]              Succeeded

isilon-1#

TeraTermマクロでコマンド出力結果を使って別のコマンドを実行する


NetAppの設定をTeraTermマクロで取得出来るようにマクロを作成中し https://github.com/osakanataro/get-ontap-config で公開中です。

物理ディスク一覧を作成する際、単純に「storage disk show」で取得すると、2ノードの表示が入り交じり、どちらに所属している物理ディスクなのか判別が面倒。

なので、「storage disk show -nodelist ノード名」という形で出力を分けたいのだが、NetAppに対して「system node show -fields node」で取得したノード一覧からノード名を抜き出して、それぞれに対してコマンドを実行するためには、TeraTermマクロで実装できるのかを調査した。

調査

まず、NetAppのノード名一覧の出力を確認

netapp01::> system node show -fields node
node
-------------
netapp01-01
netapp01-02
2 entries were displayed.

netapp01::>

ノードとして「netapp01-01」と「netapp01-02」があることを確認。

また、system node showコマンドの出力のうち最初の2行はヘッダ、そして、ノード名出力後に「~ entries were displayed.」と出力がある。これらは使わないので除外が必要。

スクリプト

サンプルとして、ノード一覧を表示して、各ノードに対して「system node run -node ノード名 hostname」を実行する、というものを作成した。

setsync 1
timeout=60
strdim nodenames 20
I=0
sendln 'system node show -fields node'
recvln ; コマンド入力 のecho出力  をスキップ
recvln ; ヘッダ部分 をスキップ
recvln ; --- 部分 をスキップ

endflag=1
while endflag=1
	recvln
	strscan inputstr 'displayed.'
	if result>0 then
		endflag=0
	else
		nodenames[I] = inputstr
		I=I+1
	endif
endwhile
wait '::> '

J=0
while I > J
	sendln 'system node run -node ' nodenames[J] ' hostname'
	wait '::> '
	J=J+1
endwhile

setsync 0

スクリプトの解説

今回のようなコマンド出力結果を受け取る場合は、「setsync 1」を実行して、確実に出力結果を受け取る設定(同期)とする必要がある。

次に「recvln」する際、TeraTermマクロからNetAppに送信した文字列もrecvlnで受け取ることになっているため、最初の1行は捨てている。(recvlnして、その後、何の処理もしていない)

続けて2行がヘッダなので、「recvln」で2行分受け取り、何も処理していない。

「2 entries were displayed.」というエントリ以降の行は不要なので、whileを終了する処理を入れるが、1台だったりすると1 entry wasとかになったりしそうなのでdisplayed.だけで終了検出。

whileを抜けたあとは、コマンドプロンプトの「::> 」が来るまで待ちを入れる。

スクリプト実行例

netapp01::> system node show -fields node
node
-------------
netapp01-01
netapp01-02
2 entries were displayed.

netapp01::> system node run -node netapp01-01 hostname
netapp01-01
netapp01::> system node run -node netapp01-02 hostname
netapp01-02
netapp01::>

Ubuntu 20.04で標準のdrbd 8.4.11を使う場合の注意点


Ubuntu 20.04でインストールされるdrbdは8.4なのか9.11なのか?」で標準のdrbd 8.4.11と、レポジトリ追加してのdrbd 9.19.1で設定する手法について記載した。

標準のdrbd 8.4.11で使って見るかと設定してみたところ、いくつか問題が発生していた。

その1: 起動時のエラーログ

drbd起動時に下記の様な「/lib/drbd/drbd: line 148: /var/lib/linstor/loop_device_mapping: No such file or directory」というログが出力されている。

root@ubuntu02:~# systemctl status drbd
● drbd.service - DRBD -- please disable. Unless you are NOT using a cluster manager.
     Loaded: loaded (/lib/systemd/system/drbd.service; enabled; vendor preset: enabled)
     Active: active (exited) since Mon 2021-12-20 14:07:35 JST; 2s ago
    Process: 241197 ExecStart=/lib/drbd/drbd start (code=exited, status=0/SUCCESS)
   Main PID: 241197 (code=exited, status=0/SUCCESS)

Dec 20 14:07:34 ubuntu02 drbd[241197]: /lib/drbd/drbd: line 148: /var/lib/linstor/loop_device_mapping: No such file or directory
Dec 20 14:07:34 ubuntu02 drbd[241216]: [
Dec 20 14:07:34 ubuntu02 drbd[241216]:      create res: alfons
Dec 20 14:07:34 ubuntu02 drbd[241216]:    prepare disk: alfons
Dec 20 14:07:34 ubuntu02 drbd[241216]:     adjust disk: alfons
Dec 20 14:07:34 ubuntu02 drbd[241216]:      adjust net: alfons
Dec 20 14:07:34 ubuntu02 drbd[241216]: ]
Dec 20 14:07:35 ubuntu02 drbd[241258]: WARN: stdin/stdout is not a TTY; using /dev/console
Dec 20 14:07:35 ubuntu02 drbd[241197]:    ...done.
Dec 20 14:07:35 ubuntu02 systemd[1]: Finished DRBD -- please disable. Unless you are NOT using a cluster manager..
root@ubuntu02:~#

まず、 /var/lib/linstor ディレクトリは標準状態では存在していない。

root@ubuntu02:~# ls -l /var/lib/linstor
ls: cannot access '/var/lib/linstor': No such file or directory
root@ubuntu02:~#

エラーの出力元の /lib/drbd/drbd の中で /var/lib/linstor/loop_device_mapping はどういう場面で登場しているかを調べる

# Set up/detach linstor loopback devices for LINSTOR file based pools
# FIXME I think setting up these loop device mappings should be done elsewhere,
# and not in the DRBD init file; possibly we need proper support in drbdadm.
handle_linstor_loopback()
{
        local line dev file
        # || [[ -n $line ]]: in case there is no newline at EOF
        while read -r line || [[ -n $line ]] ; do
                dev=${line%%:*}
                file=${line#*:}
                test -f "$file" && test -r "$file" && test -w "$file" || continue
                # should -f be allowed?
                [[ $dev = loop* ]] || [[ $dev = /dev/loop* ]] || continue
                case "$1" in
                        # what about existing, but "wrong", mappings?
                        start) losetup "$dev" 2>/dev/null || losetup "$dev" "$file";;
                        stop)  losetup "$dev" 2>/dev/null && losetup -d "$dev";;
                esac
        done < /var/lib/linstor/loop_device_mapping

        # at least we tried.
        return 0
}

/var/lib/linstor/loop_device_mapping を入力ファイルとして指定している。

どうやらdrbd起動時に /dev/loop10 = /work/testfile.iso みたいなループデバイスを作るための設定ファイルであるようだ。

ファイルが存在しないことによるログ出力なので、下記で対応した

root@ubuntu02:~# mkdir  /var/lib/linstor
root@ubuntu02:~# touch /var/lib/linstor/loop_device_mapping
root@ubuntu02:~# 

その2: drbdの降格に失敗する

「drbdadm primary shares」でPrimaryとして動作させたあと、他方のサーバに切り替えるため降格する「drbdadm secondary shares」を実行したところ、「0: State change failed: (-12) Device is held open by someone」というメッセージで失敗した。

root@ubuntu01:~#  drbdadm secondary shares
0: State change failed: (-12) Device is held open by someone
Command 'drbdsetup-84 secondary 0' terminated with exit code 11
root@ubuntu01:~# 

誰が使っているのかと「lsof /dev/drbd0」を実行してみたところ、multipathdが握っていた。

root@ubuntu01:~#  lsof /dev/drbd0
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
multipath 4910 root    5r   BLK  147,0      0t0  890 /dev/drbd0
root@ubuntu01:~# 

まずは単純にmultipathd.socketを停止させてから降格を実施してみる。

root@ubuntu01:~# systemctl stop multipathd.socket
root@ubuntu01:~#  drbdadm secondary shares
root@ubuntu01:~#

問題無く降格できた。

というわけで、/dev/drbd0 をmultipathdの対象外とするための設定を作成する。

/etc/mul/etc/multipath.conf に 下記の様な形でblacklist を追加した。

defaults {
    user_friendly_names yes
}

blacklist {
        devnode "^drbd[0-9]"
}

「multipath -t」を実行すると、初期値などが反映された フル記載の multipathd設定が表示されるので、 blacklist セクションに drbdに関する記述が追加されていることを確認する。

この対処後は、multipathdを起動した状態であっても drbdの降格に成功するようになった。

ClonezillaをLACP+タグVLAN環境で使う


システムディスクのバックアップ/リストアを行えるDebian/Ubuntuベースで構成されているClonezilla を使ってシステム障害に備えたバックアップディスクを取得しようと思ったのだが、ネットワークがLACP (802.3ad) +タグVLANで作成されていることに気がついた。

複数NICが搭載されている環境でClonzillaを起動すると、ネットワーク設定の際に「bond0 Use_channel_bonding」という選択肢が表示される。

しかし、次のNetwork Configで「static Use static IP address」を選択してみてもIPアドレスに関する設定のみでLACPで使うNICの選択やVLANに関する入力する場面はない。

というわけで、「enter_shell Enter_command_line_prompt._Do_it_manually」を選択してみるしかない。

選択してみると、設定したあと「exit」すれば続きから始まるよ、といわれる。

では、どのように設定を行うのか?下記でヒントを発見

Clonezillaの機能追加希望「#61 no lacp / etherchannel / Bonding support」(2015年07月15日~2016年10月13日)
Clonezillaのフォーラム「VLANs / bonding configuration」(2020年12月09日~2020年12月14日)

手動で設定する場合のやりかたと、ocs-live-nicbonding というスクリプトを追加して今後のバージョンで使える様にする、というものになる。

Clonezilla 2.8.0で確認してみると ocs-live-nicbonding は存在していた。

しかし、ドキュメントが見当たらないので、スクリプトを読んでみると下記仕様のようだった。

・bond0 を mode=802.3ad(LACP) 、miimon=100 で作成する
・ocs-live-nicbonding のオプションとして指定したNICがスレーブデバイスとして登録される
・xmit_hash_policy は指定しないのでデフォルトのlayer2設定

というわけで、eth3,eth4を使用してbond0を作成する場合は「ocs-live-nicbonding eth3 eth4」と実行する

「ip a s bond0」を実行してbond0が作成されていることを確認

bond0へのタグVLAN追加はvconfigコマンドで実行。

「vconfig add bond0 <VLANID>」を実行する

そうすると「bond0.<VLAN ID>」というデバイスが作成される(「ip a s bond0.<VLANID>」で確認)

IPアドレスを「ifconfig bond0.<VLANID> <IPアドレス> netmask <ネットマスク> up」を実行して設定。

で「exit」を実行すると、下記の様にClonezillaの操作に戻ります。

ONTAPで未接続のイーサポートを無効化する手法


NetApp ONTAPのWeb管理画面 ONTAP System Managerは、未使用でネットワークケーブルを接続していないポートがあると、オフラインになってるポートがあるよ、的な警告を表示する。

System Managerからだと簡単にネットワークポートの無効化が設定できる

無効化したいポートを選択して、「無効化」

続行します。

選択したポートのグラフィックが灰色に変化します。

さて、この操作、コマンドで行うにはどうすればいいのか?

まず、状況については「network port show」で確認出来ます。

fas8300::> network port show

Node: fas8300-01
                                                  Speed(Mbps) Health
Port      IPspace      Broadcast Domain Link MTU  Admin/Oper  Status
--------- ------------ ---------------- ---- ---- ----------- --------
a0a       Default      -                up   9000     -/-     healthy
a0a-1000  Default      Storage          up   9000     -/-     healthy
e0M       Default      Default          up   1500  auto/1000  healthy
e0c       Cluster      Cluster          up   9000 100000/100000 healthy
e0d       Cluster      Cluster          up   9000 100000/100000 healthy
e0e       Default      -                up   9000  auto/25000 healthy
e0f       Default      -                up   9000  auto/25000 healthy
e0g       Default      -                up   9000  auto/25000 healthy
e0h       Default      -                down 9000  auto/-     -

Node: fas8300-02
                                                  Speed(Mbps) Health
Port      IPspace      Broadcast Domain Link MTU  Admin/Oper  Status
--------- ------------ ---------------- ---- ---- ----------- --------
a0a       Default      -                up   9000     -/-     healthy
a0a-1000  Default      Storage          up   9000     -/-     healthy
e0M       Default      Default          up   1500  auto/1000  healthy
e0c       Cluster      Cluster          up   9000  auto/100000 healthy
e0d       Cluster      Cluster          up   9000  auto/100000 healthy
e0e       Default      -                up   9000  auto/25000 healthy
e0f       Default      -                up   9000  auto/25000 healthy
e0g       Default      -                up   9000  auto/25000 healthy
e0h       Default      -                up   9000  auto/25000 healthy
18 entries were displayed.

fas8300::>

しかし、network port modifyで指定できるオプションには、link up/downに関する設定がなさそう・・・

fas8300::> network port modify -node fas8300-01 -port e0h -?
  [ -mtu <integer> ]                                            MTU
  [ -autonegotiate-admin {true|false} ]                         Auto-Negotiation Administrative
  [ -duplex-admin {auto|half|full} ]                            Duplex Mode Administrative
  [ -speed-admin {auto|10|100|1000|10000|100000|40000|25000} ]  Speed Administrative
  [ -flowcontrol-admin {none|receive|send|full} ]               Flow Control Administrative
  [ -ipspace <IPspace> ]                                        IPspace Name

fas8300::>

マニュアルの「network port modify」を確認してみると下記の記述がある。

[-up-admin {true|false}] – Up Administrative (privilege: advanced)
The administrative state of the port. If set to true, the port is used if it is operational. If set to false, the port is configured down.

標準の管理CLIではなく、advanced以上の権限であれば実行できる、とのこと。

fas8300::> set advanced

Warning: These advanced commands are potentially dangerous; use them only when directed to do so by NetApp
         personnel.
Do you want to continue? {y|n}: y

fas8300::*>

advancedモードに切り替えてから、再度オプション一覧を確認

fas8300::*> network port modify -node fas8300-01 -port e0h -?
  [ -mtu <integer> ]                                            MTU
  [ -autonegotiate-admin {true|false} ]                         Auto-Negotiation Administrative
  [ -duplex-admin {auto|half|full} ]                            Duplex Mode Administrative
  [ -speed-admin {auto|10|100|1000|10000|100000|40000|25000} ]  Speed Administrative
  [ -flowcontrol-admin {none|receive|send|full} ]               Flow Control Administrative
  [ -up-admin {true|false} ]                                    *Up Administrative
  [ -ipspace <IPspace> ]                                        IPspace Name
  [ -ignore-health-status {true|false} ]                        *Ignore Port Health Status

fas8300::*>

設定出来る項目に現れました。

fas8300::*> network port modify -node fas8300-01 -port e0h -up-admin true

fas8300::*>

設定が反映されたかを確認します

fas8300::*> network port show

Node: fas8300-01
                                                                       Ignore
                                                  Speed(Mbps) Health   Health
Port      IPspace      Broadcast Domain Link MTU  Admin/Oper  Status   Status
--------- ------------ ---------------- ---- ---- ----------- -------- ------
a0a       Default      -                up   9000     -/-     healthy  false
a0a-1000  Default      Storage          up   9000     -/-     healthy  false
e0M       Default      Default          up   1500  auto/1000  healthy  false
e0c       Cluster      Cluster          up   9000 100000/100000 healthy false
e0d       Cluster      Cluster          up   9000 100000/100000 healthy false
e0e       Default      -                up   9000  auto/25000 healthy  false
e0f       Default      -                up   9000  auto/25000 healthy  false
e0g       Default      -                up   9000  auto/25000 healthy  false
e0h       Default      -                up   9000  auto/25000 healthy  false

Node: fas8300-02
                                                                       Ignore
                                                  Speed(Mbps) Health   Health
Port      IPspace      Broadcast Domain Link MTU  Admin/Oper  Status   Status
--------- ------------ ---------------- ---- ---- ----------- -------- ------
a0a       Default      -                up   9000     -/-     healthy  false
a0a-1000  Default      Storage          up   9000     -/-     healthy  false
e0M       Default      Default          up   1500  auto/1000  healthy  false
e0c       Cluster      Cluster          up   9000  auto/100000 healthy false
e0d       Cluster      Cluster          up   9000  auto/100000 healthy false
e0e       Default      -                up   9000  auto/25000 healthy  false
e0f       Default      -                up   9000  auto/25000 healthy  false
e0g       Default      -                up   9000  auto/25000 healthy  false
e0h       Default      -                up   9000  auto/25000 healthy  false
18 entries were displayed.

fas8300::*>

全てのポートがupになりました。

System Managerの方でも表示がupに戻ったかを確認できました。

Web GUIだと簡単に設定変更できるものが、コマンドだとadvanced権限必要だった、というのは驚きでした。