11-06-2021 09:45 PM
Hi All,
Can someone help me please.
I have generated and used the python script generated from Yang Suite but with some modifications (please see "ospf_add_interface_v15.txt") to add Loopback100 interface under the OSPF100 process in area 0.
The file "output_add_interface_ospf.txt" showed the 2 RPCs (1 is edit-config and 2 is commit) were successfully accepted by my node IOS-XRv 9000 6.5.1.
However, looking at the CLI output the Loopback100 still does not exists in the router ospf configuration, please see "CLI_Ouput.txt".
Not sure if I am doing something wrong but I doubt it because anything other than edit-config like get or get-config there are no issues at all.
As a proof I changed the payload to:
payload = [
'''
<get-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<source>
<running/>
</source>
<filter>
<ospf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-ospf-cfg">
<processes>
<process>
<process-name>OSPF100</process-name>
</process>
</processes>
</ospf>
</filter>
</get-config>
''',
]
and got the following response:
project_ydk) cmendoza@ubuntu:~/Documents/project_ydk$ python ospf_add_interfacev001.py -a 11.11.11.11 -u cmendoza -p cmendoza
SENDING REQUEST
<get-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<source>
<running/>
</source>
<filter>
<ospf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-ospf-cfg">
<processes>
<process>
<process-name>OSPF100</process-name>
</process>
</processes>
</ospf>
</filter>
</get-config>
RESPONSE RECEIVED
<?xml version="1.0"?>
<rpc-reply message-id="urn:uuid:5cb260e8-5930-40ac-b479-2cf5b8417ba8" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<data>
<ospf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-ospf-cfg">
<processes>
<process>
<process-name>OSPF100</process-name>
<default-vrf>
<router-id>11.11.11.11</router-id>
<af>
<af-name>ipv4</af-name>
<saf-name>unicast</saf-name>
</af>
<area-addresses>
<area-area-id>
<area-id>0</area-id>
<running></running>
<name-scopes>
<name-scope>
<interface-name>Loopback0</interface-name>
<running></running>
</name-scope>
<name-scope>
<interface-name>GigabitEthernet0/0/0/0</interface-name>
<running></running>
</name-scope>
<name-scope>
<interface-name>GigabitEthernet0/0/0/1</interface-name>
<running></running>
</name-scope>
<name-scope>
<interface-name>GigabitEthernet0/0/0/3</interface-name>
<running></running>
</name-scope>
</name-scopes>
</area-area-id>
</area-addresses>
</default-vrf>
<start></start>
</process>
</processes>
</ospf>
</data>
</rpc-reply>
(project_ydk) cmendoza@ubuntu:~/Documents/project_ydk$
It looks like edit-config does not work? Or is there another approach/way to change the config?
Thanks in advance.
Solved! Go to Solution.
12-13-2021 03:11 PM
The XML you have created is well-formed and the device accepts it into the candidate datastore without error. The "commit" is issued which should move changes from the candidate datastore into the running datastore also is accepted without error. Your example using YANG Suite is also correct and accepted without error. You are doing everything correct. The device is not. I suggest you contact XR support for answers.
12-14-2021 08:26 AM - edited 12-14-2021 08:27 AM
The "RPC generated" is coming from yangsuite and is based on the model definitions. The rpc-reply is the response from the device. Yangsuite does not generate the reply, it only prints out the log of what was received from the device. Later releases of XR images have clearer model definitions. If possible, you should see about updating the XR image you are running.
11-06-2021 10:08 PM
11-10-2021 10:29 AM
Here's what I can offer:
Hope this helps!
11-12-2021 01:37 AM
@Alexander Stevenson , can you help me find that space you are talking about? Cant seem to search it, please see attached screenshot.
12-01-2021 04:26 PM
Hello @Christopher Mark Mendoza,
Sorry I took so long to reply. I wasn't notified. I must adjust those settings I see. You can join the YANG Suite space by following this link:
11-25-2021 04:57 PM
I think I figured out what is going on....
Generating the RPC for "edit-config" from Yang Suite gives the below...
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<edit-config>
<target>
<candidate/>
</target>
<config>
<ospf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-ospf-cfg">
<processes>
<process>
<process-name>100</process-name>
<default-vrf>
<af>
<af-name>ipv4</af-name>
<saf-name>unicast</saf-name>
</af>
<router-id>11.11.11.11</router-id>
<area-addresses>
<area-area-id>
<area-id>0</area-id>
<name-scopes>
<name-scope>
<interface-name>Loopback0</interface-name>
</name-scope>
</name-scopes>
</area-area-id>
</area-addresses>
</default-vrf>
</process>
</processes>
</ospf>
</config>
</edit-config>
</rpc>
Doing a get-config, we will notice that the tags in bold below are missing in the RPC request for the edit-config above. I decided to run the edit-config again with the inclusion of the missing tags and it worked perfectly. Could this be a bug in the RPC generation?
<?xml version="1.0" ?>
<rpc-reply message-id="urn:uuid:a4e99ab9-26a7-4a9a-9ea0-fea16abd202d" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
<data>
<ospf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-ospf-cfg">
<processes>
<process>
<process-name>100</process-name>
<default-vrf>
<router-id>11.11.11.11</router-id>
<af>
<af-name>ipv4</af-name>
<saf-name>unicast</saf-name>
</af>
<area-addresses>
<area-area-id>
<area-id>0</area-id>
<running/>
<name-scopes>
<name-scope>
<interface-name>Loopback0</interface-name>
<running/>
</name-scope>
</name-scopes>
</area-area-id>
</area-addresses>
</default-vrf>
<start/>
</process>
</processes>
</ospf>
</data>
</rpc-reply>
12-01-2021 04:33 PM
I've consulted my colleagues regarding issue, as well as your best course of action. I will update you soon.
12-03-2021 08:35 AM
Hello @Christopher Mark Mendoza,
Please raise a GitHub Issue for this bug with the team that maintains YANG Suite here:
https://github.com/CiscoDevNet/yangsuite/issues
12-08-2021 07:17 PM
Raised an issue in Github...https://github.com/CiscoDevNet/yangsuite/issues/38
12-13-2021 03:11 PM
The XML you have created is well-formed and the device accepts it into the candidate datastore without error. The "commit" is issued which should move changes from the candidate datastore into the running datastore also is accepted without error. Your example using YANG Suite is also correct and accepted without error. You are doing everything correct. The device is not. I suggest you contact XR support for answers.
12-14-2021 03:46 AM
Thanks for the response but can you comment on the discrepancy in the RPC generated between edit-config and get-config, specifically for the tags <running/> and <start/>.
12-14-2021 08:26 AM - edited 12-14-2021 08:27 AM
The "RPC generated" is coming from yangsuite and is based on the model definitions. The rpc-reply is the response from the device. Yangsuite does not generate the reply, it only prints out the log of what was received from the device. Later releases of XR images have clearer model definitions. If possible, you should see about updating the XR image you are running.
12-25-2021 01:57 PM
So I tried this on 7.2.1 and looks like the 6.3.1 is the issue, I did not see the extra tags on 7.2.1 when I do Get-Config additionally the Edit-config + Commit worked perfectly well.
This was the request
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101"> <edit-config> <target> <candidate/> </target> <config> <ospf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-ospf-cfg"> <processes> <process> <process-name>100</process-name> <default-vrf> <af> <af-name>ipv4</af-name> <saf-name>unicast</saf-name> </af> <area-addresses> <area-area-id> <area-id>0</area-id> <name-scopes> <name-scope> <interface-name>GigabitEthernet0/0/0/1</interface-name> </name-scope> </name-scopes> </area-area-id> </area-addresses> </default-vrf> </process> </processes> </ospf> </config> </edit-config> </rpc> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="102"> <commit/> </rpc>
and here is the verification
RP/0/RP0/CPU0:XRv_R5#sho run router ospf Sat Dec 25 21:57:03.542 UTC router ospf 100 router-id 55.55.55.55 address-family ipv4 unicast area 0 interface Loopback0 ! interface GigabitEthernet0/0/0/0 ! interface GigabitEthernet0/0/0/1 ! ! !
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide