01-09-2019 08:53 AM
I'm tring to create IPIP or GRE tunnel:
tunnel=native.interface.Tunnel()
tunnel.name=999
tunnel.description="test123"
tunnel.vrf.forwarding="Stateful"
tunnel.ip.address.primary.address="192.168.206.206"
tunnel.ip.address.primary.mask="255.255.255.252"
tunnel.ip.tcp.adjust_mss=1360
tunnel.tunnel.source="Loopback0"
destination=tunnel.Tunnel_.Destination()
destination.ipaddress_or_host="8.8.8.8"
tunnel.tunnel.destination=destination
tunnel.tunnel.mode.ipip=tunnel.tunnel.mode.Ipip()
native.interface.tunnel.append(tunnel)
crud.create(provider,tunnel)
And receive error like it:
2019-01-09 19:49:28,180 - ydk - INFO - Path where models are to be downloaded: /xxx/
2019-01-09 19:49:28,189 - ydk - INFO - Connected to x.x.x.x on port 830 using ssh with timeout of -1
2019-01-09 19:49:28,607 - ydk - INFO - Executing CRUD create operation on [Tunnel[name='999']]
2019-01-09 19:49:28,712 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Invalid value "" in "destination" element. Path: '/Cisco-IOS-XE-native:native/interface/Tunnel[name='999']/Cisco-IOS-XE-tunnel:tunnel/destination'
Traceback (most recent call last):
File "./createtunnel.py", line 66, in <module>
crud.create(provider,tunnel)
File "/usr/local/lib/python2.7/dist-packages/ydk/errors/error_handler.py", line 112, in helper
return func(self, provider, entity, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/ydk/services/crud_service.py", line 49, in create
return self._crud.create(provider, entity)
File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python2.7/dist-packages/ydk/errors/error_handler.py", line 82, in handle_runtime_error
_raise(_exc)
File "/usr/local/lib/python2.7/dist-packages/ydk/errors/error_handler.py", line 56, in _raise
raise exc
ydk.errors.YModelError: Invalid value "" in "destination" element. Path: /Cisco-IOS-XE-native:native/interface/Tunnel[name='999']/Cisco-IOS-XE-tunnel:tunnel/destination
Am I doing anything wrong or is it bug?
libyang=0.8.0
models for ios_xe=16.9.1
ios_xe=16.06.04
Solved! Go to Solution.
01-17-2019 10:43 AM
01-17-2019 10:43 AM
01-23-2019 12:34 PM
Thank you.
You was right.
After upgrade IOS on router problem has solved.
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