[アップデート] Amazon FSx for NetApp ONTAPでEMSイベントログを確認できるようになりました

障害発生時の状況把握に役立つぞ
2023.08.20

どんなイベントがいつ発生したの確認したいな

こんにちは、のんピ(@non____97)です。

皆さんはAmazon Fsx for NetApp ONTAP(以降FSxN)でEMSイベントを確認したいなと思ったことはありますか? 私はあります。

EMS(Event Management System )イベントとはiSCSI LUN の作成やボリュームの自動サイズ変更など、ONTAP内のイベントを記録する機能です。

今回のアップデートでFSxNはEMSをサポートしました。

今までは何かしらONTAP内でイベントが発生した場合、CloudWatchメトリクスやワークロードの挙動などからどのようなイベントが発生したのか推測する形でした。具体的にどのようなイベントがいつ発生したのかを知る術がありませんでした。

EMSをサポートしたことにより、そのイベントの詳細を確認できるようになりました。

実際に確認してみたので紹介します。

いきなりまとめ

  • Amazon Fsx for NetApp ONTAPでもEMSイベントログを確認できるようになった
  • 2023/8/20時点で実行できるEMS周りのコマンドはevent catalog showevent log showのみ
  • EMSイベントをsyslogサーバーに転送したりメールで通知したりするといったことはできない
  • CloudWatch LogsやS3バケットに出力することもできない

やってみた

FSxNファイルシステムを適当に作成しました。

どのようなeventコマンドが叩けられるのか確認してみます。

::> event ?
  catalog>                    View the event catalog.
  log>                        Display the list of event occurrences

::> event catalog ?
  show                        Display event definitions

::> event catalog show ?
  [ -instance | -fields <fieldname>, ... ]
  [[-message-name] <Message Name>]                                  Message Name
  [ -filter-name <text> ]                                           Filter Name
  [ -severity {EMERGENCY|ALERT|ERROR|NOTICE|INFORMATIONAL|DEBUG} ]  Severity
  [ -description <text> ]                                           Description
  [ -action <text> ]                                                Corrective Action
  [ -snmp-trap-type {Standard|Built-in|Severity-based} ]            SNMP Trap Type
  [ -deprecated {true|false} ]                                      Is Deprecated

::> event log ?
  show                        Display latest log events

::> event log show ?
  [ -detail | -detailtime | -instance | -fields <fieldname>, ... ]
  [[-node] <nodename>]                                              Node
  [[-seqnum] <Sequence Number>]                                     Sequence#
  [ -time <"MM/DD/YYYY HH:MM:SS"> ]                                 Time
  [ -severity {EMERGENCY|ALERT|ERROR|NOTICE|INFORMATIONAL|DEBUG} ]  Severity (default: <=ERROR)
  [ -source <text> ]                                                Source
  [ -message-name <Message Name> ]                                  Message Name
  [ -event <text> ]                                                 Event
  [ -action <text> ]                                                Corrective Action
  [ -description <text> ]                                           Description
  [ -filter-name <Filter Name> ]                                    Filter Name

event catalog showevent log showのみのようです。

権限レベルをdiagnosticに変更して同じように確認してみます。

::> set diagnostic

Warning: These diagnostic commands are for use by NetApp personnel only.
Do you want to continue? {y|n}: y

::*> event ?
  catalog>                    View the event catalog.
  log>                        Display the list of event occurrences

::*> event catalog ?
  show                        Display event definitions

::*> event catalog show ?
  [ -instance | -fields <fieldname>, ... ]
  [[-message-name] <Message Name>]                                  Message Name
  [ -filter-name <text> ]                                           Filter Name
  [ -severity {EMERGENCY|ALERT|ERROR|NOTICE|INFORMATIONAL|DEBUG} ]  Severity
  [ -description <text> ]                                           Description
  [ -action <text> ]                                                Corrective Action
  [ -snmp-trap-type {Standard|Built-in|Severity-based} ]            SNMP Trap Type
  [ -deprecated {true|false} ]                                      Is Deprecated

::*> event log ?
  show                        Display latest log events

::*> event log show ?
  [ -detail | -detailtime | -instance | -fields <fieldname>, ... ]
  [[-node] <nodename>]                                                                         Node
  [[-seqnum] <Sequence Number>]                                                                Sequence#
  [ -time <"MM/DD/YYYY HH:MM:SS"> ]                                                            Time
  [ -severity {EMERGENCY|ALERT|ERROR|NOTICE|INFORMATIONAL|DEBUG} ]                             Severity
  [ -ems-severity {NODE_FAULT|SVC_FAULT|NODE_ERROR|SVC_ERROR|WARNING|NOTICE|INFO|DEBUG|VAR} ]  *EMS Severity
  [ -source <text> ]                                                                           Source
  [ -message-name <Message Name> ]                                                             Message Name
  [ -event <text> ]                                                                            Event
  [ -kernel-generation-num <integer> ]                                                         *Kernel Generation Number
  [ -kernel-sequence-num <integer> ]                                                           *Kernel Sequence Number
  [ -event-xml-len <integer> ]                                                                 *EMS Event XML Length
  [ -num-suppressed-since-last <integer> ]                                                     *Number of Times Suppressed Since Last Time Logged
  [ -action <text> ]                                                                           Corrective Action
  [ -description <text> ]                                                                      Description
  [ -filter-name <Filter Name> ]                                                               Filter Name

各コマンドのオプションは増えましたが、コマンド自体は変わりありませんね。

event notification createなどはないため、EMSイベントをsyslogサーバーに転送したりメールで通知したりするといったことはできないようです。

2023/8/20時点のFSxNではできませんが、EMSイベントの通知方法は以下NetApp公式ドキュメントをご覧ください。

AWS側の設定としてもCloudWatch LogsやS3バケットに出力するといったものはありませんでした。イベントが何か発生した際に通知したい場合は定期的にVPC LambdaからONTAP REST APIを叩いて取得することになりそうです。

実際のイベントログを確認してみましょう。

::> event log show
Time                Node             Severity      Event
------------------- ---------------- ------------- ---------------------------
8/19/2023 22:44:02  FsxId0a3fea624cfa58381-01
                                     EMERGENCY     monitor.globalStatus.critical: Controller failover of FsxId0a3fea624cfa58381-02 is not possible: Mailbox disks are not healthy.
8/19/2023 22:44:00  FsxId0a3fea624cfa58381-02
                                     EMERGENCY     monitor.globalStatus.critical: Controller failover of FsxId0a3fea624cfa58381-01 is not possible: Mailbox disks are not healthy.
8/19/2023 22:43:00  FsxId0a3fea624cfa58381-02
                                     EMERGENCY     monitor.globalStatus.critical: Controller failover of FsxId0a3fea624cfa58381-01 is not possible: Controller Failover takeover disabled.
8/19/2023 22:40:01  FsxId0a3fea624cfa58381-01
                                     EMERGENCY     monitor.globalStatus.critical: Controller failover partner unknown. Controller failover not possible.
8/19/2023 22:40:01  FsxId0a3fea624cfa58381-02
                                     EMERGENCY     monitor.globalStatus.critical: Controller failover partner unknown. Controller failover not possible.
5 entries were displayed.

5件表示されました。

時間帯からしてFSxNファイルシステム作成時にフェイルオーバーイベントが記録されたようです。

各イベントの説明はevent catalog showから確認できます。

::> event catalog show -message-name monitor.globalStatus.critical

     Message Name: monitor.globalStatus.critical
         Severity: EMERGENCY
      Description: This message occurs when the system's global health is critical; for example, if a fan failed.
Corrective Action: Check the event log for other conditions that can cause this global status message. Follow the corrective actions in those messages.
   SNMP Trap Type: Built-in
    Is Deprecated: false

イベントの説明の確認をする際に都度、event catalog showを叩く必要はなく、EMS Referenceからでも確認できます。

注意点としてFSxNでは記録されないイベントも存在するようです。

ONTAP EMS メッセージの中には、FSx for ONTAP ファイルシステムで使用できないものがあります。

FSx for ONTAP EMS イベントのモニタリング - FSx for ONTAP

event catalog showで表示されるもの = FSxNでサポートしているイベントかどうかは分かりませんが、全てで7589イベントあるようです。

::> event catalog show
Message                          Severity         SNMP Trap Type
-------------------------------- ---------------- -----------------
AccessCache.NearLimits           ALERT            Severity-based
AccessCache.ReachedLimits        EMERGENCY        Severity-based
CR.Data.File.Inaccessible        NOTICE           Severity-based
CR.Del.CrptStreamData.Fail       NOTICE           Severity-based
CR.Del.CrptStreamRedir.Fail      NOTICE           Severity-based
CR.Del.DangStreamData.Fail       NOTICE           Severity-based
CR.Del.DangStreamRedir.Fail      NOTICE           Severity-based
CR.Fix.Corrupt.Redir.Failed      NOTICE           Severity-based
CR.Fix.Crpt.Data.Dir.Failed      INFORMATIONAL    Severity-based
CR.Fix.Crpt.Data.File.Failed     NOTICE           Severity-based
.
.
(中略)
.
.
zsm.socket.listener.create       NOTICE           Severity-based
zsm.socket.listener.setoption    NOTICE           Severity-based
zsm.socket.output.event          INFORMATIONAL    Severity-based
ztl.smap.online.status           NOTICE           Severity-based
7589 entries were displayed.

デフォルトではSeverityERROR以上のものしか表示されません。

NOTICEINFORMATIONALDEBUGのイベントログも表示させてみましょう。

::> event log show -severity NOTICE, INFORMATIONAL, DEBUG
Time                Node             Severity      Event
------------------- ---------------- ------------- ---------------------------
8/20/2023 06:01:16  FsxId0a3fea624cfa58381-01
                                     NOTICE        arw.volume.state: Anti-ransomware state was changed to "disabled" on volume "vol2" (UUID: "f9464565-3f1e-11ee-98e4-bd127086968e") in Vserver "svm" (UUID: "01acc9e5-3ee3-11ee-98e4-bd127086968e").
8/20/2023 05:57:05  FsxId0a3fea624cfa58381-01
                                     NOTICE        LUN.destroy: LUN /vol/vol1/lun, vol vol1 (DSID 1026) destroyed (UUID: 3450215e-bda5-4a8e-bf0a-747ce9aaa6dd).
8/20/2023 00:42:54  FsxId0a3fea624cfa58381-01
                                     NOTICE        LUN.space.resv.not.honored: Space reservations in volume vol1 (DSID 1026) are not honored, either because the volume space guarantee is set to 'none' or it is disabled due to lack of space in its containing aggregate.
8/20/2023 00:42:54  FsxId0a3fea624cfa58381-01
                                     NOTICE        LUN.nvfail.option.on: The nvfail option for the volume vol1 (DSID 1026) has been turned on. The volume contains LUN or NVMe namespaces and it is recommended that this option be kept on for such volumes.
8/19/2023 22:53:41  FsxId0a3fea624cfa58381-01
                                     NOTICE        arw.volume.state: Anti-ransomware state was changed to "disabled" on volume "vol1" (UUID: "3de6e8ce-3ee3-11ee-98e4-bd127086968e") in Vserver "svm" (UUID: "01acc9e5-3ee3-11ee-98e4-bd127086968e").
8/19/2023 22:53:13  FsxId0a3fea624cfa58381-01
                                     NOTICE        Nblade.graceEnd: NFS server grace state has ended for Vserver "svm", LIF ID "1030", LIF IP address "10.0.1.114".
8/19/2023 22:52:25  FsxId0a3fea624cfa58381-01
                                     INFORMATIONAL Nblade.nfsCredCacheFlushed: When the administrator modifies the "extended-groups-limit" option or "auth-sys-extended-groups" option using the "vserver nfs modify" command, the entire credential cache is flushed that holds credentials on connections that use mixed-mode security style volumes or RPCSEC_GSS authentication or extended groups over AUTH_SYS. This makes subsequent operations on such connections slower for a short while, until the credential cache is repopulated. The value of "auth-sys-extended-groups" option is 0 (1:enabled, 0:disabled). The value of "extended-groups-limit" option is 32.
8/19/2023 22:52:25  FsxId0a3fea624cfa58381-02
                                     INFORMATIONAL Nblade.nfsCredCacheFlushed: When the administrator modifies the "extended-groups-limit" option or "auth-sys-extended-groups" option using the "vserver nfs modify" command, the entire credential cache is flushed that holds credentials on connections that use mixed-mode security style volumes or RPCSEC_GSS authentication or extended groups over AUTH_SYS. This makes subsequent operations on such connections slower for a short while, until the credential cache is repopulated. The value of "auth-sys-extended-groups" option is 0 (1:enabled, 0:disabled). The value of "extended-groups-limit" option is 32.
8/19/2023 22:52:22  FsxId0a3fea624cfa58381-01
                                     NOTICE        Nblade.graceBegin: NFS server grace state has begun for Vserver "svm", LIF ID "1030", LIP IP address "10.0.1.114".
8/19/2023 22:52:21  FsxId0a3fea624cfa58381-01
                                     NOTICE        Nblade.recoveryBegin: NFS server lock recovery has begun for Vserver "svm", LIFID "1030", LIF IP address "10.0.1.114".
8/19/2023 22:52:11  FsxId0a3fea624cfa58381-01
                                     NOTICE        arw.vserver.state: Anti-ransomware was changed to "disabled" on Vserver "svm" (UUID: "01acc9e5-3ee3-11ee-98e4-bd127086968e").
8/19/2023 22:50:09  FsxId0a3fea624cfa58381-01
                                     NOTICE        passwd.changed: passwd for user 'fsx-oncall' changed.
8/19/2023 22:47:06  FsxId0a3fea624cfa58381-01
                                     NOTICE        passwd.changed: passwd for user 'fsxadmin' changed.
8/19/2023 22:43:47  FsxId0a3fea624cfa58381-02
                                     NOTICE        scsiblade.online: This node has completed initialization of the SAN configuration cache. FCP and iSCSI traffic are enabled on this node.
8/19/2023 22:43:06  FsxId0a3fea624cfa58381-01
                                     NOTICE        scsiblade.online: This node has completed initialization of the SAN configuration cache. FCP and iSCSI traffic are enabled on this node.
8/19/2023 22:42:28  FsxId0a3fea624cfa58381-02
                                     NOTICE        passwd.changed: passwd for user 'admin' changed.
8/19/2023 22:42:27  FsxId0a3fea624cfa58381-01
                                     NOTICE        passwd.changed: passwd for user 'admin' changed.
17 entries were displayed.

::> event log show -message-name LUN.destroy -severity NOTICE -instance

                  Node: FsxId0a3fea624cfa58381-01
             Sequence#: 1941
                  Time: 8/20/2023 05:57:05
              Severity: NOTICE
                Source: VdomAsyncTh_01
          Message Name: LUN.destroy
                 Event: LUN.destroy: LUN /vol/vol1/lun, vol vol1 (DSID 1026) destroyed (UUID: 3450215e-bda5-4a8e-bf0a-747ce9aaa6dd).
     Corrective Action: (NONE)
           Description: This message occurs when a LUN is destroyed.

以下の記事でLUNを削除した時のイベントLUN.destroy: LUN /vol/vol1/lun, vol vol1 (DSID 1026) destroyedなどが記録されていますね。

以下AWS公式ドキュメントにもevent log showのオプションの解説があるので併せてご覧ください。

試しにボリュームがいっぱいになったイベントを記録させてみます。

ボリュームサイズを20MBにして、自動拡張を有効化します。

# 現在のボリュームサイズの確認
::> volume show -volume
    -volume                -volume-style          -volume-style-extended
FsxId0a3fea624cfa58381::> volume show -volume vol1
Vserver   Volume       Aggregate    State      Type       Size  Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
svm       vol1         aggr1        online     RW        300TB    908.3GB    0%

# ボリュームサイズを20MBに変更
::> volume modify -volume vol1 -size 20MB
Volume modify successful on volume vol1 of Vserver svm.

# ボリュームサイズの自動拡張を有効化
::> volume modify -volume vol1 -autosize-mode grow
Volume modify successful on volume vol1 of Vserver svm.

# ボリュームが20MBで自動拡張が有効になっていることを確認
::> volume show -volume vol1 -fields size, autosize-mode, autosize-grow-threshold-percent
vserver volume size autosize-grow-threshold-percent autosize-mode
------- ------ ---- ------------------------------- -------------
svm     vol1   20MB 85%                             grow

NFSクライアントからボリュームをマウントして、現在の20MB以上のデータを書き込みます。

# ボリュームをマウント
$ sudo mount -t nfs4 svm-082e4c3914fc50e98.fs-0a3fea624cfa58381.fsx.us-east-1.amazonaws.com:/vol1 /mnt/fsxn

# ボリュームがマウントされたことを確認
$ df -hT -t nfs4
Filesystem                                                                   Type  Size  Used Avail Use% Mounted on
svm-082e4c3914fc50e98.fs-0a3fea624cfa58381.fsx.us-east-1.amazonaws.com:/vol1 nfs4   19M  320K   19M   2% /mnt/fsxn

# 20MB以上のファイルの作成
$ sudo dd if=/dev/urandom of=/mnt/fsxn/test bs=4K count=6144
6144+0 records in
6144+0 records out
25165824 bytes (25 MB) copied, 0.32002 s, 78.6 MB/s

# ボリュームのサイズを確認
$ df -hT -t nfs4
Filesystem                                                                   Type  Size  Used Avail Use% Mounted on
svm-082e4c3914fc50e98.fs-0a3fea624cfa58381.fsx.us-east-1.amazonaws.com:/vol1 nfs4   30M   25M  5.4M  82% /mnt/fsxn

30MBまで拡張されました。

直近5分の全てのEMSイベントログを確認します。

::> event log show -severity <=DEBUG -time > 5m
Time                Node             Severity      Event
------------------- ---------------- ------------- ---------------------------
8/20/2023 08:56:06  FsxId0a3fea624cfa58381-01
                                     NOTICE        wafl.vol.autoSize.done: Volume autosize: Automatic grow of volume 'vol1@vserver:01acc9e5-3ee3-11ee-98e4-bd127086968e' by 6.18MBis complete.
8/20/2023 08:56:06  FsxId0a3fea624cfa58381-01
                                     NOTICE        wafl.vol.autoSize.done: Volume autosize: Automatic grow of volume 'vol1@vserver:01acc9e5-3ee3-11ee-98e4-bd127086968e' by 5.14MBis complete.
2 entries were displayed.

::> event catalog show -message-name wafl.vol.autoSize.done

     Message Name: wafl.vol.autoSize.done
         Severity: NOTICE
      Description: This message occurs when an autosize for a volume is successful. This can happen when the "autosize grow" option is on and the volume reaches the grow threshold percentage.
Corrective Action: NONE
   SNMP Trap Type: Built-in
    Is Deprecated: false

自動拡張によりボリュームサイズが拡張されたことが確かに記録されていますね。

障害発生時の状況把握に役立つぞ

Amazon FSx for NetApp ONTAPでEMSイベントログを確認できるようになったアップデートを紹介しました。

特に障害発生時の状況把握に役立ちそうですね。個人的には管理アクティビティとファイルアクセスの監査ログと共に、CloudWatch LogsとS3バケットへの出力ができるようになって欲しいです。

この記事が誰かの助けになれば幸いです。

以上、AWS事業本部 コンサルティング部の のんピ(@non____97)でした!