fabric-testbed / InformationModel

FABRIC Information Model library
MIT License
7 stars 1 forks source link

Allow same facility port more than once in a slice #193

Closed ibaldin closed 8 months ago

ibaldin commented 10 months ago

Example from CloudLab stitching where one slice may need to have a link from CL Utah to CL Wisc and CL Utah to CL Clem - Information Model name uniqueness checks prevent this from happening.

ibaldin commented 8 months ago

Code with de698b7 that starts from rel1.6 allows to define multiple interfaces for a facility using an optional interfaces parameter, which is a List of Tuples (interface_name, interface_labels, intertface_capacities), so you either use the old way:

# this uses the 'old way' with kwargs being used for a single interface
        fac1 = self.topo.add_facility(name='RENCI-DTN', site='RENC', capacities=f.Capacities(bw=10),
                                      labels=f.Labels(vlan='100'))
# this uses a new way where  interface labels and capacities (and names) are passed in explicitly
# in this case kwargs are ignored
        fac1 = self.topo.add_facility(name='RENCI-DTN', site='RENC',
                                      interfaces=[('to_mass', f.Labels(vlan='100'), f.Capacities(bw=10)),
                                                          ('to_renc', f.Labels(vlan='101'), f.Capacities(bw=1))])