cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
718
Views
5
Helpful
2
Replies

Services that has many devices but has unique enteries

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

1 Accepted Solution

Accepted Solutions

Jan Lindblad
Cisco Employee
Cisco Employee

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.

 

View solution in original post

2 Replies 2

Dan.Sullivan
Cisco Employee
Cisco Employee

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;
}
}

Jan Lindblad
Cisco Employee
Cisco Employee

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.