ESC は NETCONF を使用して、ネットワークとそのデバイスを設定および管理します。NETCONF は、ネットワークデバイスの設定をインストール、操作、処理、および削除するためのネットワーク管理プロトコルです。Cisco NSO は、オープンな
NETCONF プロトコルと YANG ベースのデータモデルを使用して ESC と通信します。ESC は仮想ネットワーク機能をデバイスレベルで管理し、NSO はネットワーク サービス ライフサイクル全体を管理します。これらを組み合わせることで、物理インフラストラクチャと仮想インフラストラクチャの両方にまたがる完全なオーケストレーション
ソリューションとなります。
(注) |
netconf CLI を使用した CRUD 操作の完全なパスを入力する必要はなく、esc_nc_cli --user <username> --password <password> command <file name> と入力するだけです。CLI の詳細については、Cisco Elastic Services Controller インストールおよびアップグレードガイド [英語] を参照してください。
|
NETCONF/YANG モデルは、NETCONF 通知とともに運用データも提供します。クエリを実行して、ESC のすべてのテナント、ネットワーク、および展開のリストなどの詳細を取得できます。
単一の NETCONF 要求を作成して、複数のアクションを実行できます。詳細については、「NETCONF 機能拡張要求」を参照してください。次に、2 つのテナントを同時に削除する NETCONF 要求を示します。
<esc_datamodel xmlns="http://www.cisco.com/esc/esc">
<tenants>
<tenant nc:operation="delete">
<name>abc-mix-tenant1</name>
</tenant>
<tenant nc:operation="delete">
<name>abc-mix-tenant2</name>
</tenant>
</tenants>
</esc_datamodel>
次に、NETCONF/YANG API の例を示します。
テナントを作成する NETCONF 要求
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<edit-config>
<source>
<running />
</source>
<config>
<esc_datamodel xmlns="http://www.cisco.com/esc/esc">
<tenants>
<tenant>
<name>mytenant</name>
</tenant>
</tenants>
</esc_datamodel>
</config>
</edit-config>
</rpc>
設定のアクティブ化が完了すると、ステータスが SUCCESS の CREATE_TENANT タイプの escEvent が NETCONF サブスクライバに送信されます。これは、アクティベーション ワークフローが完了し、設定リソースが VIM
で正常に作成されたことを示します。
テナントが正常に作成された後の NETCONF 通知:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<eventTime>2015-05-05T19:38:27.71+00:00</eventTime>
<escEvent xmlns="http://www.cisco.com/esc/esc">
<status>SUCCESS</status>
<status_message>Tenant successfully created</status_message>
<tenant>mytenant</tenant>
<vm_source />
<vm_target />
<event>
<type>CREATE_TENANT</type>
</event>
</escEvent>
</notification>
テナントの運用データ(Opdata)には、名前と tenant_id が表示されます。NETCONF 要求
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<get>
<filter select="esc_datamodel/opdata/tenants/tenant[name=’mytenant’]" type="xpath" />
</get>
</rpc>
NETCONF 応答
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<data>
<esc_datamodel xmlns="http://www.cisco.com/esc/esc">
<opdata>
<tenants>
<tenant>
<name>mytenant</name>
<tenant_id>dccd22a13cc64e388a4b8d39e6a8fa7f</tenant_id>
</tenant>
</tenants>
</esc_datamodel>
</data>
</rpc-reply>
一連の通知、イベント障害通知、および opdata の詳細については、Cisco Elastic Services Controller API ガイド [英語] を参照してください。
NETCONF API の設定と RPC コールが検証されます。有効でない要求は拒否されます。NETCONF API は、REST とは異なり、エラーコードを NB に送信しません(たとえば、REST は 404 Not Found エラーを送信します)。
サンプルエラーメッセージ(拒否された要求)は次のとおりです。
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<rpc-error>
<error-type>application</error-type>
<error-tag>operation-failed</error-tag>
<error-severity>error</error-severity>
<error-path xmlns:esc="http://www.cisco.com/esc/esc"
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">/nc:rpc/esc:filterLog</error-path>
<error-message xml:lang="en">Exception from action callback: Error when handling RPC
calls: You can only query up to 30 logs.</error-message>
<error-info>
<bad-element>filterLog</bad-element>
</error-info>
</rpc-error>
</rpc-reply>
no_gateway 属性を使用すると、ESC はゲートウェイを無効にした状態でサブネットを作成できます。
次に、no_gateway 属性を true に設定して、ゲートウェイなしでサブネットを作成する例を示します。
<networks>
<network>
<name>mgmt-net</name>
<subnet>
<name>mgmt-net-subnet</name>
<ipversion>ipv4</ipversion>
<dhcp>false</dhcp>
<address>10.0.0.0</address>
<no_gateway>true</no_gateway>
<!-- DISABLE GATEWAY -->
<gateway>10.0.0.1</gateway>
<netmask>255.255.255.0</netmask>
</subnet>
</network>
</networks>
ESC の [運用データ(Operational Data)] セクションに OpenStack と VMware vCenter のユーザ名が表示されます。
次の設定の詳細が [運用データ(Operational Data)] に表示されます。
Openstack
-
active_vim:値が OpenStack として表示されます。
-
os_auth_url:OpenStack 認証 URL が表示されます。
-
admin_role:OpenStack ユーザが管理者であるかどうかが表示されます。
-
os_tenant_name:テナントが表示されます。
-
os_username:OpenStack ユーザが表示されます。
-
member_role:OpenStack ユーザがメンバーであるかどうかが表示されます。
VMware vCenter
-
active_vim:値が VMware として表示されます。
-
vcenter_ip:vCenter IP アドレスが表示されます。
-
vcenter_port:vCenter ポートであるかどうかが表示されます。
-
vcenter_username:vCenter ユーザが表示されます。