Knowledge Search


×
 

[NFX] How to specify Netconf command to stop/start a virtual network function

  [KB34957] Show Article Properties


Summary:

Some customers use orchestration tools that communicate via netconf to manage virtual-network-function (VNF's) on NFX device. 

This article explains how to determine what netconf xml rpc tags to use, to stop or start a VNF.

Symptoms:

Need to configure netconf command, that would stop or start a VNF.

Solution:

To issue JUNOS commands via netconf, first determine the xml tag needed from the netconf interface.  The following shows you how to stop VNF vsrx.

First, SSH to the device. Then issue the command with display xml rpc:

root@jdm> request virtual-network-functions vsrx stop | display xml rpc
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/18.4R1/junos">
    <rpc>
        <request-virtual-network-functions>
                <vnf-name>vsrx</vnf-name>
                <stop/>
        </request-virtual-network-functions>
    </rpc>
    <cli>
        <banner>{master:0}</banner>
    </cli>
</rpc-reply>

When you actually apply the netconf command, specify the following tags:

<request-virtual-network-functions>
<vnf-name>vsrx</vnf-name>
<stop/>
</request-virtual-network-functions>

After applying this from SSH client:

localhost:/mnt/c/Users/rng/Documents/2018$ ssh root@10.1.1.1 -s netconf
root@10.85.242.29's password:
<!-- No zombies were killed during the creation of this user interface -->
<!-- user root, class (root) -->
<nc:hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
   <nc:capabilities>
    <nc:capability>urn:ietf:params:netconf:base:1.0</nc:capability>
    <nc:capability>urn:ietf:params:netconf:capability:candidate:1.0</nc:capability>
    <nc:capability>urn:ietf:params:netconf:capability:confirmed-commit:1.0</nc:capability>
    <nc:capability>urn:ietf:params:netconf:capability:validate:1.0</nc:capability>
    <nc:capability>urn:ietf:params:netconf:capability:url:1.0?protocol=http,ftp,file</nc:capability>
    <nc:capability>urn:ietf:params:xml:ns:netconf:base:1.0?module=ietf-netconf&amp;revision=2011-06-01</nc:capability>
    <nc:capability>urn:ietf:params:xml:ns:netconf:capability:candidate:1.0</nc:capability>
    <nc:capability>urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0</nc:capability>
    <nc:capability>urn:ietf:params:xml:ns:netconf:capability:validate:1.0</nc:capability>
    <nc:capability>urn:ietf:params:xml:ns:netconf:capability:url:1.0?protocol=http,ftp,file</nc:capability>
    <nc:capability>urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&amp;revision=2013-07-15</nc:capability>
    <nc:capability>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring</nc:capability>
  </nc:capabilities>
  <nc:session-id>2740</nc:session-id>
</nc:hello>
]]>]]>

At this point, paste the tag as follows:

<rpc>
        <request-virtual-network-functions>
                <vnf-name>vsrx</vnf-name>
                <stop/>
        <<nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/18.4R1/junos">
/request-virtual-network-functions>
    </rpc>
<request-vnf-information>
<message-string>vsrx stopped</message-string>
</request-vnf-information>
</nc:rpc-reply>
]]>]]>

To close the netconf connection, apply the tags:

<rpc> <close-session/> </rpc>
<rpc><close-session/></rpc>
<nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/18.4R1/junos">
<nc:ok/>
</nc:rpc-reply>
]]>]]>
<!-- session end at 2019-08-23 22:48:19 UTC -->

To start the VNF vsrx, SSH to the device. Then issue the command with display xml rpc:

root@jdm> request virtual-network-functions start vsrx | display xml rpc   
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/18.4R1/junos">
    <rpc>
        <request-virtual-network-functions>
                <vnf-name>vsrx</vnf-name>
                <start/>
        </request-virtual-network-functions>
    </rpc>
    <cli>
        <banner>{master:0}</banner>
    </cli>
</rpc-reply>

The tags below can be applied to the netconf command to start the VNF vsrx. The same procedure can be followed, which was done to stop the VNF vsrx.

<request-virtual-network-functions>
<vnf-name>vsrx</vnf-name>
<start/>
</request-virtual-network-functions>

For more information, refer to NETCONF XML Management Protocol Developer Guide

Related Links: