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

 

 

はじめに

本記事は、NSO の commit のフラグのひとつ、no-overwrite について説明します。commit フラグ、no-overwrite はデバイスと NSO との間に差分があるとき、対象のコンフィグが同期していれば、NSOからのコンフィグの設定を許容します。

設定したいコンフィグが対立しないケース

通常、NSO とデバイス間に差分がある状態ではトランザクションを commit することはできません。但し、サービス開発の段階で複数のサービスが混在するケースや、デバイスで既に設定されたコンフィグある場合 (brown-field) においては NSO とデバイスに差分 (conflict) が常時、または高頻度にあることが想定されます。このようなケースでは、変更したい対象のコンフィグが in-sync の状態であれば、そのコンフィグを変更できるようになれば便利です。但し、no-out-of-sync-check 同様、last-transaction-id は unknown となるので、後で sync-from 等を実行し transaction-id を更新する必要があります。

ios0 は out-of-sync の状態です。

 

admin@ncs# devices device ios0 check-sync
result out-of-sync
info got: b664a18fd2bb2b230e8b991957743dec expected: d3b4dfca356db6cc12be6485baf862e8

admin@ncs# *** ALARM out-of-sync: got: b664a18fd2bb2b230e8b991957743dec expected: d3b4dfca356db6cc12be6485baf862e8

 

この状態で、description を変更します。

 

admin@ncs# show running-config devices device ios0 config interface Loopback 100
devices device ios0
 config
  interface Loopback100
   description write-from-device
   ip address 10.100.1.1 255.255.255.255
   no shutdown
  exit
 !
!

 

commit は out-of-sync のため失敗します。

 

admin@ncs(config)# devices device ios0 config interface Loopback 100                            
admin@ncs(config-if)# description write-from-NSO
admin@ncs(config-if)# commit dry-run
cli {
    local-node {
        data  devices {
                  device ios0 {
                      config {
                          interface {
                              Loopback 100 {
             -                    description write-from-device;
             +                    description write-from-NSO;
                              }
                          }
                      }
                  }
              }
    }
}
admin@ncs(config-if)# commit
Aborted: Network Element Driver: device ios0: out of sync

 

commit no-overwrite フラグでコミットします。

 

: device ios0: out of sync
admin@ncs(config-if)# commit no-overwrite 
Commit complete.
admin@ncs(config-if)# end
admin@ncs# show running-config devices device ios0 config interface Loopback 100
devices device ios0
 config
  interface Loopback100
   description write-from-NSO
   ip address 10.100.1.1 255.255.255.255
   no shutdown
  exit
 !
!
admin@ncs# 

 

 

 

設定したいコンフィグが対立する (out-of-sync) ケース

変更したいコンフィグが対立 ( out-of-sync ) の状態で試してみます。

 

admin@ncs# show running-config devices device ios0 config interface Loopback 100
devices device ios0
 config
  interface Loopback100
   description write-from-NSO
   ip address 10.100.1.1 255.255.255.255
   no shutdown
  exit
 !
!
admin@ncs# devices device ios0 compare-config                                   
diff 
 devices {
     device ios0 {
         config {
             interface {
                 Loopback 100 {
-                    description write-from-NSO;
+                    description write-from-device-again;
                 }
             }
         }
     }
 }

 

フラグを付けても commit は失敗します。

 

admin@ncs# config
Entering configuration mode terminal
admin@ncs(config)# devices device ios0 config interface Loopback 100
admin@ncs(config-if)# description write-from-NSO-again                 
admin@ncs(config-if)# commit
Aborted: Network Element Driver: device ios0: out of sync
admin@ncs(config-if)# commit no-overwrite
Aborted: Network Element Driver: device ios0: out of sync: for 'devices device ios0 config interface Loopback 100 description'
admin@ncs(config-if)# 

 

 

  

参考情報

https://developer.cisco.com/docs/nso/guides/#!life-cycle-operations-manipulating-existing-services-and-devices/commit-flags

Getting Started

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

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