はじめに
ACIはカットスルースイッチングに従います。つまり、CRCを計算する前に、パケットはすでに転送されています。通常、これらのパケットはストンプされ、出力エラーとして転送されます。ACIはこれらのパケットをドロップしないため、同じパケットがパケットを通過し、ストンプCRCカウンタがパス上で増分されます。これは、CRCを参照するすべてのインターフェイスに障害があることを意味するわけではありません。したがって、問題のあるポート/SFP/ファイバを特定するには、適切なトリアージが必要です。Pythonスクリプトを使用してトリアージプロセスが自動化されたため、トラブルシューティングが容易になり、手作業が不要になりました。このドキュメントでは、自動化スクリプトの使用方法について説明します(添付を参照)。
スクリプトを手動で実行するための前提条件
スクリプトの実行元となるクライアントマシンは、次の要件を満たす必要があります
a. Python3がインストールされている必要があります
b. ACIドメインへのネットワークアクセス
c. ACI_CRC_requirements.txt (添付)をインストールします。このファイルはここにあります。
ファイル(ACI_CRC_requirements.txt)をクライアントマシンにダウンロードします
ターミナルを開き、コマンドpip3 install -r ACI_CRC_requirements.txtを実行します。
ABCD-M-G24X:downloads abcd$ pip3 install -r ACI_CRC_requirements.txt
Collecting bcrypt==3.2.0 (from -r ACI_CRC_requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/bf/6a/0afb1e04aebd4c3ceae630a87a55fbfbbd94dea4eaf01e53d36743c85f02/bcrypt-3.2.0-cp36-abi3-macosx_10_9_x86_64.whl
Collecting cffi==1.14.6 (from -r ACI_CRC_requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/ca/e1/015e2ae23230d9de8597e9ad8c0b81d5ac181f08f2e6e75774b7f5301677/cffi-1.14.6-cp38-cp38-macosx_10_9_x86_64.whl (176kB)
|████████████████████████████████| 184kB 1.4MB/s
**snip**
Successfully installed DateTime-4.3 Pillow-8.3.2 bcrypt-3.2.0 cffi-1.14.6 cryptography-3.4.8 cycler-0.10.0 kiwisolver-1.3.2
matplotlib-3.4.3 numpy-1.21.2 pandas-1.3.2 paramiko-2.7.2 pyparsing-2.4.7 python-dateutil-2.8.2 pytz-2021.1 six-1.16.0
stdiomask-0.0.5 tabulate-0.8.9 termcolor-1.1.0 zope.interface-5.4.0
コンテナからスクリプトを実行するための前提条件
コンテナは、上記のPythonパッケージがプリインストールされた状態で準備されます。
docker login docker.io
docker pull aci-stomper
docker run -d --name -p :80 aci-stomper (on your browser http://ContainerIP:someport)
docker ps
docker exec -it /bin/bash
root@6df99d5dbbad:/# cd /home/scripts/
root@6df99d5dbbad:/home/scripts# ls
ACI_CRC_Parser.py ACI_CRC_Poller.py
スクリプトを実行する手順
合計2つのPythonスクリプト(ACI_CRC_Poller.pyとACI_CRC_Parser.py)があることに注意してください。 これらのスクリプトは、次のURLを使用してCisco DevNet Code Exchangeからダウンロードできます。
https://developer.cisco.com/codeexchange/github/repo/CiscoDevNet/ACI-CRC-FCS-Checker
両方のスクリプトを実行するマシン/コンピュータにダウンロードします。
このドキュメントでは、script-1はACI_CRC_Poller.pyを指し、script-2はACI_CRC_Parser.pyを指します。
1. ACI_CRC_Poller.pyは、最大で7日間、5分ごとにファイルのCRCおよびFCSエラーデータを収集します。
ターミナルからscript-1 (ACI_CRC_Poller.py)を実行します。 特定のクラスタ内のいずれかのAPICのOOB IPアドレスとそのクレデンシャルを入力してください。
ABCD-M-G24X:downloads abcd$ python3 ACI_CRC_Poller.py
Enter the IP address or DNS Name of APIC: 10.197.204.184
__________________________________________________________
Enter the username: admin
___________________________________________________________
Enter the password: **********
Trying to connect to APIC
Connection established to the APIC
___________________________________________________________
2. Script-1は、レコードを保存するローカルマシン/コンピュータ上の場所/パスを要求します。 有効なパスを入力してください。パスを入力しないと、スクリプトは実行されません。
Please enter the folder where files have to be stored
_____________________________________________________________
VALID folder format:
EXAMPLE:
Windows-> C:\Users\Admin\Desktop\ACI\
MAC -> /User/admin/Desktop/ACI/
---------------------------------------------------------------------------------------------------
PLEASE NOTE that data collection and script execution might get impacted if folder format is not as below
--------------------------------------------------------------------------------------------------------
Enter the absolute path of the folder where the files have to be stored:/Users/abcd/Downloads/FCS_Checker/ <<<<<<<<<<<<<<
3. スクリプトが実行の終了時刻を要求するようになります。
yyyy-mm-dd hh:mm(ファブリックのローカルタイムゾーンごとに)形式で、最小5分、最大7日の時間を入力してください。
この時点で、script-1は5分ごとに(ユーザによって事前に指定された終了時刻まで)ファブリックからFCS/CRCエラーの収集を開始し、以前の入力で指定されたパスでファイルにデータを保存します。
----------------------------------------------------------------
Enter the End Time until which the script runs(in the format of yyyy-mm-dd hh:mm, current time:2021-09-27 11:27.... maximum upto 2021-10-04 11:27): 2021-09-27 11:32 <<<<<
___________________________________________________________
The script is executing ........................
The script is executing ........................
ABCD-M-G24X:downloads abcd$
4. 最初のスクリプトが正常に実行されると、ステップ2でユーザーが指定した場所にRAWデータファイルが格納されます。
次の例に示すように、同じことを確認します。
ABCD-M-G24X:FCS_Checker kbosu$ pwd
/Users/abcd/Downloads/FCS_Checker
ls -l
total 16
-rw-r--r--@ 1 kbosu staff 1419 Sep 27 11:28 CRC_FCS_20210927_1128.txt
-rw-r--r--@ 1 kbosu staff 1419 Sep 27 11:33 CRC_FCS_20210927_1133.txt
ABCD-M-G24X:FCS_Checker abcd$
5. 次に、2番目のスクリプト(ACI_CRC_Parser.py)を実行します。
Script-2は、script-1で作成されたこれらのファイルを使用して、さらに作業を行います。
特定のクラスタ内のいずれかのAPICのOOB IPアドレスとそのクレデンシャルを入力してください。
また、最初のスクリプトの実行中にステップ2で入力したファイルの場所と同じ場所を入力します。
ABCD-M-G24X:downloads abcd$ python3 ACI_CRC_Parser.py
Enter the IP address or DNS Name of APIC: 10.197.204.184
__________________________________________________________
Enter the username: admin
___________________________________________________________
Enter the password: **********
Trying to connect to APIC
Connection established to the APIC
_____________________________________________________________
Please enter the folder where files are stored
Please make sure we have at least two files exists in the directory where you have saved data
_____________________________________________________________
--------------------------------------------------------------------------------------------------------
Enter the absolute path of the folder where the files are stored:/Users/abcd/Downloads/FCS_Checker/
___________________________________________________________
You have CRC and FCS for the below date range
1.2021-09-27
Fetching first and last file of the same date 20210927
CRC_FCS_20210927_1128.txt
CRC_FCS_20210927_1133.txt
__________________________________________________________
The script is executing.....
__________________________________________________________
The script execution has completed
6. Script-2では、次の例に示すように表形式でデータが印刷されます。
主に、ユーザが指定した時間間隔で、ゼロ以外のCRCおよびFCSエラーが発生したノードインターフェイスを、それらのCRC/FCSカウンタの差とともにリストします。LLDPを使用して、スクリプトは特定のインターフェイスにフックされたネイバーデバイスも判別します。最も重要な点は、ファブリックの観点から見たエラーの原因となっているノード/インターフェイスと、ストンプによってCRCが発生しているノード/インターフェイスを示します。
FCSのトラブルシューティングの観点からは、「赤」で強調表示され、「ローカル」とマークされている箇所に、さらに詳しいトラブルシューティングを行う必要があります。
これは、不良または破損したパケットがファブリックに入り込み、CRCがファブリック内でフラッディングされるインターフェイスである可能性があります。
+--------+---------+--------------------+-----------+-----------+---------------+---------------+---------------+---------------+-------------------------------------------------------------------------------------+--------------+
| POD_ID | NODE_ID | NODE_NAME | NODE_ROLE | INTERFACE | 20210927_1128 | 20210927_1133 | 20210927_1128 | 20210927_1133 | NEIGHBOR | ERROR SOURCE |
+--------+---------+--------------------+-----------+-----------+-----CRC-------+----CRC Diff---+----FCS--------+---FCS Diff----+-------------------------------------------------------------------------------------+--------------+
| 1 | 302 | bgl-aci06-t2-leaf2 | leaf | eth1/44 | 5002806823759 | 127841888 | 5002806823759 | 127841888 | No LLDP /CDP neighbours found please check physically where this interface connects | Local |
| 1 | 101 | bgl-aci06-spine1 | spine | eth1/1 | 2981200154 | 132103050 | 0 | 0 | System:bgl-aci06-t1-leaf1.cisco.com,Interface:Eth1/49 | Stomp |
| 1 | 101 | bgl-aci06-spine1 | spine | eth1/2 | 968286 | 0 | 0 | 0 | | Historic |
| 1 | 201 | bgl-aci06-t1-leaf1 | leaf | eth1/1 | 12 | 0 | 0 | 0 | | Historic |
| 1 | 201 | bgl-aci06-t1-leaf1 | leaf | eth1/51 | 4999243774529 | 0 | 0 | 0 | | Historic |
| 1 | 201 | bgl-aci06-t1-leaf1 | leaf | eth1/52 | 5002807353809 | 127841212 | 0 | 0 | System:bgl-aci06-t2-leaf2.cisco.com,Interface:Eth1/49 | Stomp |
| 1 | 202 | bgl-aci06-t1-leaf2 | leaf | eth1/51 | 968286 | 0 | 0 | 0 | | Historic |
| 1 | 301 | bgl-aci06-t2-leaf1 | leaf | eth1/44 | 4999245287405 | 0 | 4999245287405 | 0 | | Historic |
| 1 | 301 | bgl-aci06-t2-leaf1 | leaf | eth1/49 | 4999823953891 | 0 | 0 | 0 | | Historic |
| 1 | 302 | bgl-aci06-t2-leaf2 | leaf | eth1/49 | 4999243774529 | 0 | 0 | 0 | | Historic |
+--------+---------+--------------------+-----------+-----------+---------------+---------------+---------------+---------------+-------------------------------------------------------------------------------------+--------------+
7. さらに、このスクリプトは、script-1および2で収集された詳細なデータを並べ替えて表示するための次のオプションをユーザに提供します。
ユーザは、選択肢として数字の1 ~ 3を選択できます。下の例を参照してください。
1.Sort the data further
2.View the granular data of an interface
3.Exit
Input the number:
次の例では、任意のインターフェイスの詳細なデータを表示できるオプション2を使用します。
このスクリプトでは、上に表示された表からそれぞれのPOD番号(ステップ6)、ノードID、およびインターフェイスIDを入力するようユーザに求めます。
この例では、1-302-eth1/44(POD IDは1、ノードIDは302、インターフェイスIDはeth1/44)を使用しています。これはインターフェイスです
ステップ6に示すように、スクリプトによってローカルFCSが報告された場所。
Input the number:2
---------------------------------------------------------------------------
Enter an interface for which you need granular data(POD_ID-NODE_ID-INTERFACE Example:1-101-eth1/5): 1-302-eth1/44
----------------------------------------------------------------------
You have CRC and FCS data in the below date range
1.2021-09-27
Enter the date for which you need granular data(any number from the above list range(1-1)):
この例では、1日の数分のデータのみを収集したため、日付が9月27日の1つのオプションのみが表示されます。
したがって、入力は「1」になります。
Enter the date for which you need granular data(any number from the above list range(1-1)): 1
+-------+---------------+---------------+
| Time | CRC | FCS |
+-------+---------------+---------------+
| 11:28 | 5002806823759 | 5002806823759 |
| 11:33 | 5002934665647 | 5002934665647 |
+-------+---------------+---------------+
----------------------------------------------------------------
Do you want to continue viewing the granular data(0/1), 1-yes, 0-no:0
--------------------------------------------------------------------------------
Please select any number below to sort the data further or to view granular data of an interface
1.Sort the data further
2.View the granular data of an interface
3.Exit
Input the number:3
ABCD-M-G24X:downloads abcd$