def createVlanPool(name, startVlan, endVlan, allocMode='static'):
    infraInfra = aciInfra.Infra(aciPol.Uni(''))
    fvnsVlanInstP = aciFvns.VlanInstP(infraInfra, name="{}_vlans".format(name),
                                      allocMode=allocMode)
    aciFvns.EncapBlk(fvnsVlanInstP, to="vlan-{}".format(endVlan),
                     from_="vlan-{}".format(startVlan), name='encap')
    return fvnsVlanInstP
Exemple #2
0
def create_vlan_pool_policies(policies):
    infraInfra = aciInfra.Infra(aciPol.Uni(''))

    for policy in policies:
        fvnsVlanInstP = aciFvns.VlanInstP(infraInfra,
                                          name=policy['name'],
                                          allocMode=policy['allocMode'])

        aciFvns.EncapBlk(fvnsVlanInstP,
                         name='encap',
                         role=policy['role'],
                         from_="vlan-{}".format(policy['start']),
                         to="vlan-{}".format(policy['end']))

    return fvnsVlanInstP
def addVlanBlockToPool(vlanPool, name, startVlan, endVlan, allocMode='static'):
    aciFvns.EncapBlk(vlanPool, to="vlan-{}".format(endVlan),
                     from_="vlan-{}".format(startVlan),
                     name='encap', allocMode=allocMode)
    return vlanPool
                                 provMatchT='AtleastOne')
    vzRsSubjFiltAtt = cobra.model.vz.RsSubjFiltAtt(
        vzSubj,
        tRn='flt-any-any',
        tDn='uni/tn-common/flt-any-any',
        forceResolve='yes',
        tnVzFilterName='any-any')

    # OSPF Area
    #ospf.ExtP(l3outMo, areaCtrl='redistribute,summary', areaType='regular', areaCost='1', areaId='backbone')

    ## Create VlanPool
    vlanPoolMo = fvns.VlanInstP('uni/infra',
                                allocMode='static',
                                name=l3outPoolName)
    vlanEncapBlkMo = fvns.EncapBlk(vlanPoolMo, vlanfield, vlanfield)

    ## Create l3OutDomain
    l3outDomMo = l3ext.DomP(topMo, name=l3outDomainName)
    l3OutVlansMo = infra.RsVlanNs(
        l3outDomMo, tDn='uni/infra/vlanns-[{}]-static'.format(l3outPoolName))

    ##Build AAEP And associate it to l3outdom
    # I only needed to do this once... and we will not need to do it again until we expand to a different set of physical ports/leaf nodes
    #aaepMo=infra.AttEntityP('uni/infra',name=aaEPName)
    #infra.RsDomP(aaepMo,tDn=l3outtDn)
    #aaepmoCfg=request.ConfigRequest()
    #aaepMo.delete()
    #aaepmoCfg.addMo(aaepMo)
    #moDir.commit(aaepmoCfg)