12-19-2018 01:08 AM - edited 03-01-2019 04:15 AM
Hi all,
could some one pls point me in the right direction.
just getting started and would like to have a service that adds a VRF to all devices in the network and configures the RD
i have made the services and its does deploy the VRF to all the devices, but how can i set a unique RD for each device and still have them part of that one services
<vrf xmlns="http://example.com/vrf" xmlns:vrf="http://example.com/vrf">
<name>TEST-VRF</name>
<modified>
<devices>C6880</devices>
<devices>XRv-1</devices>
</modified>
<directly-modified>
<devices>C6880</devices>
<devices>XRv-1</devices>
</directly-modified>
<device-list>C6880</device-list>
<device-list>XRv-1</device-list>
<device>C6880</device>
<device>XRv-1</device>
<description>TEST-VRF</description>
<asn>65000</asn>
<rd>11</rd> - how do u make this unique for each device
</vrf>
Thanks
Regards
Yale
Solved! Go to Solution.
12-19-2018 07:06 AM
You would need to write some code that allocates unique IDs from a pool or ID server. In theory you might be able to handle this using some smart XPath expressions in your template too, but I would certainly recommend the code approach. If you'd like to see some examples of services that allocate unique values for devices, you can have a look at the resource manager packages are used in examples.ncs/service-provider/virtual-mpls-vpn.
12-19-2018 07:05 AM
Hi,
You can simply build a service in which each device has a separate rd value. For example, the following YANG model actually does something similar. A single VRF service instance that spans multiple devices
list vrf {
description "VRF Service";
key name;
leaf name {
tailf:info "Unique service id";
tailf:cli-allow-range;
type string;
}
uses ncs:service-data;
ncs:servicepoint vrf-servicepoint;
leaf description {
type string;
}
list devices {
key name;
leaf name {
type leafref {
path "/svrf:vrf-devices/devices/svrf:name";
}
}
leaf route-distinguisher {
type string;
}
list import-route-target {
key name;
leaf name {
type string;
}
}
list export-route-target {
key name;
leaf name {
type string;
}
}
leaf import-route-policy {
type string;
}
leaf export-route-policy {
type string;
}
leaf max-prefix-limit {
type uint16;
}
leaf max-prefix-threshold {
type uint16;
}
}
12-19-2018 07:06 AM
You would need to write some code that allocates unique IDs from a pool or ID server. In theory you might be able to handle this using some smart XPath expressions in your template too, but I would certainly recommend the code approach. If you'd like to see some examples of services that allocate unique values for devices, you can have a look at the resource manager packages are used in examples.ncs/service-provider/virtual-mpls-vpn.
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