キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 
cancel
2521
閲覧回数
1
いいね!
0
コメント
yushimaz
Cisco Employee
Cisco Employee

 

はじめに

 

APIC の GUI 表示に問題がある場合、Browser が受け取っている情報そのものがおかしい場合と、受け取った情報の出力に問題がある場合のどちらかになります。

Browser が受け取っている情報がおかしいかどうかを確認するための Tool としては、API Inspector があり、この Tool については既に API Inspector の活用 で紹介しています。 そのため、ここでは受け取った情報をどのように出力しているかを調べる方法について紹介します。

※ ACI Version 6.0(2h) での確認結果をもとに掲載しております。

 

 

1. 問題

 

スクリーンショット 2023-10-23 21.49.34.jpg

今回は、例として上記 Leaf Switch の Management port がなぜ orange になっているのかを調べていきます。

mgmt0 の Properties を見ると、Admin State, Oper State どちらも up になっているし、色も green になっているにも関わらず、左側の mgmt0 icon では orange 出力になっているので、その理由が気になります。 そこで、どのような条件で色付けをしているのか Browser に実装されている Tool を用いて調べていくことにします。

 

 

2. Google Chrome Developer Tools


スクリーンショット 2023-10-23 21.40.51.jpg

右上の設定 icon から Developer Tool を起動できます。 今回は Google Chrome を使用していますが、他 Browser でも同様に起動できると思います。

 

スクリーンショット 2023-10-23 21.42.25.jpg

 

port を orange 表示させる時にどのような処理が行われているのかを確認するため、Developer Tool の Console を表示させた状態で、Management Interfaces を click して見ると、上のように大量の console message が出力されます。 その中に Pannel.js という気になる出力があるので、この file を開いて書かれている内容を調べてみます。

 

スクリーンショット 2023-10-23 21.42.25.jpg

javascript の内容を確認すると port の色を取得していると思われる関数 getPortStatusColor を呼び出しているので、その関数が書かれているところを検索し file を開きます。

 

スクリーンショット 2023-10-23 21.45.31.jpg

スクリーンショット 2023-10-23 21.46.24.jpg

スクリーンショット 2023-10-23 21.46.57.jpg

スクリーンショット 2023-10-23 21.48.30.jpg

その file の最初の comment 欄に、各状態と色の対応が書かれています。

下記に書かれている通り、switchingSt というのが disabled になっていると orange になることがわかります。

 

/**

 * Users: Catalin Dumitru & Fabio Ingrao

 * Copyright 2012-2018 Insieme Networks, Inc.

 */




/*

 *

 interface.adminSt  ethpm.operSt           interface.switchingSt  color           port.adminSt

 ----------------   ------------------     --------------------   ----------      -------------

 up                 -                       -                     white            portDisabled

 up                 up                      enabled               green            portEnabled

 up                 up                      disabled              orange           portDisabledSwitching

 up                 link-up                 -                      yellow           portDisabledLink

 up                 down                    -                     red              portEnabledError

 *

 */







Ext.define('insieme.stromboli.topology.PortInfo', {

     alternateClassName: 'insieme.PortInfo',

     singleton: true,

    colorToStatus: {

        white: 'portDisabled',

        green: 'portEnabled',

        orange: 'portDisabledSwitching',

        yellow: 'portDisabledLink',

        red: 'portEnabledError'

    },

     // colorConsts keeps track between the status of an interface and the status mark's color

     colorConsts: {

         portDisabled: "white",

         portEnabled: "green",

         portDisabledSwitching: "orange",

         portDisabledLink: "yellow",

         portEnabledError: "red"

     },

     // statusConts keeps track of all the status options

     statusConsts: {

         enabled: "enabled",

         disabled: "disabled",

         up: "up",

         down: "down",

         linkUp: "link-up",

         trunking: "trunking"

     },

     // paramConst keeps track of all the params needed in order to apply a state;

     paramConst: {

         operSt: "operSt",

         adminSt: "adminSt",

         switchingSt: "switchingSt",




     },




    determineColor: function(interfaceMo) {

        // this method is used in order to determine the color of the status mark for Interfaces and Interface related objects

        // rules used are described in the table present at the beginning of this file

        var statusConsts = this.statusConsts;

        var colorConsts = this.colorConsts;

        var adminSt = interfaceMo.adminSt;

        var operSt, className, switchingSt;




        if (adminSt === statusConsts.down || adminSt === statusConsts.disabled) {

            return colorConsts.portDisabled;

        }




        operSt = interfaceMo.operSt;

        className = interfaceMo.className;

        switchingSt = interfaceMo.switchingSt;




        if (operSt && adminSt) {

            if (operSt === statusConsts.up && adminSt === statusConsts.up) {

                if (switchingSt === statusConsts.enabled || className === 'insieme.stromboli.model.def.l1FcPhysIf') {

                    return colorConsts.portEnabled;

                } else if (switchingSt === statusConsts.disabled) {

                    return colorConsts.portDisabledSwitching;

                }

                return colorConsts.portDisabledLink;

            }

            else if (operSt === statusConsts.down && adminSt === statusConsts.up) {

                return colorConsts.portEnabledError;

            }

        }




        if (operSt === statusConsts.linkUp){

            return colorConsts.portDisabledLink;

        }




        // for FEX ports where FEX-to-leaf is disabled

        if (className === "insieme.stromboli.model.def.l1PhysIf" && !operSt) {

            return colorConsts.portDisabled;

        }

    },




     buildMoFromL1PhysAndEthpmPhys: function(interfaceObj, ethpmObj) {

         // this method builds an object containing the required params in order to determine a status color

         var interfaceMo = {

              className: interfaceObj.$className,

              adminSt: "",

              operSt: "",

              switchingSt: ""

         };




         interfaceMo.adminSt = interfaceObj.get(this.paramConst.adminSt) ? interfaceObj.get(this.paramConst.adminSt) : null;

        

         if (ethpmObj) {

              interfaceMo.operSt = ethpmObj.get(this.paramConst.operSt) ? ethpmObj.get(this.paramConst.operSt) : null;

              // for some objects I was unable to find the swState, so I will set it if undefined or null as true until further updates

              // for those objects we will check the operSt and adminSt

              interfaceMo.switchingSt = ethpmObj.get(this.paramConst.switchingSt) ? ethpmObj.get(this.paramConst.switchingSt) : interfaceObj.get(this.paramConst.switchingSt);

         } else {

              interfaceMo.operSt = interfaceObj.get(this.paramConst.operSt);

              interfaceMo.switchingSt = interfaceObj.get(this.paramConst.switchingSt);

         }

         if (!interfaceMo.switchingSt || interfaceMo.switchingSt === true) {

              interfaceMo.switchingSt = this.statusConsts.enabled;

         }

         if (interfaceMo.operSt === this.statusConsts.trunking) {

              interfaceMo.operSt = this.statusConsts.up;

         }

         return interfaceMo;




     },




    getPortStatusColor: function(interfaceObj, ethpmObj) {

         // this method returns the status color for the provided interface

         var state;

         state = this.determineColor(this.buildMoFromL1PhysAndEthpmPhys(interfaceObj, ethpmObj));

        return state;

     }

});

 

 

3. 結論

 

上記 code から switchingSt が disabled になっている場合、orange になることがわかりました。

実際に mgmt0 が持っている mo 情報を Object Store Browser を用いて確認してみます。

 

スクリーンショット 2023-10-23 21.48.59.jpg

スクリーンショット 2023-10-23 21.49.19.jpg

Object Store Browser (Visore) で確認すると、switchingSt が disabled になっていることが確認できます。 つまり、mgmt0 が orange になっているのは code 上は期待通りに動作していると言えます。

ちなみに、switchingSt は、port に対して policy が適用されると up になりますが、management port の場合、常に disabled になります。 そのため、mgmt0 は正常時は orange で、link down 等なんらかの問題がある場合は red になります。

GUI で management port を確認すると Switching State が disabled になっていることが確認できます。

 

スクリーンショット 2023-10-23 21.49.34.jpg

APIC の表示部分の Troubleshooting は今回の例のように、ある程度細かい条件まで自分で調査することが可能です。

ACI の Troubleshooting は一般的な linux command や汎用の Tool を使って切り分け可能なことが多く、cisco.com 内に document はなく、検索 engine 等ですぐに見つかることも多々あります。 そのため、Troubleshooting を行う前に、自分が確認したいことは、ACI 固有の知識を必要とするのか、それ以外の知識を必要とするのかを切り分けた上で最適な方法で検索することをお勧めします。

 

Getting Started

検索バーにキーワード、フレーズ、または質問を入力し、お探しのものを見つけましょう

シスコ コミュニティをいち早く使いこなしていただけるよう役立つリンクをまとめました。みなさんのジャーニーがより良いものとなるようお手伝いします