Search in sources :

Example 11 with ItmConfig

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.ItmConfig in project genius by opendaylight.

the class ItmTepInstanceRecoveryHandler method recoverTep.

private void recoverTep(String entityId) throws InterruptedException {
    List<DPNTEPsInfo> tepsToRecover = new ArrayList<>();
    DPNTEPsInfo dpnTepsToRecover = extractDPNTepsInfo(entityId);
    if (dpnTepsToRecover == null) {
        LOG.error("Please Enter appropriate arguments for Tep Recovery.");
        return;
    } else {
        tepsToRecover.add(dpnTepsToRecover);
        // Delete the transportZone and re create it
        // Get the transport zone from the transport zone name
        TransportZone oldTz = ItmUtils.getTransportZoneFromConfigDS(tzName, dataBroker);
        if (oldTz != null) {
            ItmTepRemoveWorker tepRemoveWorker = new ItmTepRemoveWorker(tepsToRecover, null, oldTz, dataBroker, imdsalApiManager, itmInternalTunnelDeleteWorker, dpntePsInfoCache);
            LOG.trace("Deleting transportzone {}", tzName);
            jobCoordinator.enqueueJob(tzName, tepRemoveWorker);
            ItmTepAddWorker tepAddWorker = new ItmTepAddWorker(tepsToRecover, null, dataBroker, imdsalApiManager, itmConfig, itmInternalTunnelAddWorker, itmExternalTunnelAddWorker, dpntePsInfoCache);
            LOG.trace("Re-creating transportzone {}", tzName);
            jobCoordinator.enqueueJob(tzName, tepAddWorker);
        }
    }
}
Also used : ItmTepRemoveWorker(org.opendaylight.genius.itm.confighelpers.ItmTepRemoveWorker) ArrayList(java.util.ArrayList) DPNTEPsInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo) TransportZone(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZone) ItmTepAddWorker(org.opendaylight.genius.itm.confighelpers.ItmTepAddWorker)

Example 12 with ItmConfig

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.ItmConfig in project genius by opendaylight.

the class ItmTunnelAggregationHelper method initTunnelAggregationConfig.

private void initTunnelAggregationConfig(ItmConfig itmConfig) {
    // Load balancing of VxLAN feature is guarded by a global configuration option in the ITM,
    // only when the feature is enabled, the logical tunnel interfaces should be created.
    boolean tunnelAggregationConfigEnabled = false;
    List<TunnelAggregation> tunnelsConfig = itmConfig != null ? itmConfig.getTunnelAggregation() : null;
    if (tunnelsConfig != null) {
        for (TunnelAggregation tnlCfg : tunnelsConfig) {
            Class<? extends TunnelTypeBase> tunType = ItmUtils.getTunnelType(tnlCfg.getKey().getTunnelType());
            if (tunType.isAssignableFrom(TunnelTypeVxlan.class)) {
                tunnelAggregationConfigEnabled = tnlCfg.isEnabled();
                LOG.info("MULTIPLE_VxLAN_TUNNELS: tunnelAggregationEnabled {}", tunnelAggregationConfigEnabled);
                break;
            }
        }
    }
    tunnelAggregationEnabled = tunnelAggregationConfigEnabled;
}
Also used : TunnelAggregation(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.itm.config.TunnelAggregation)

Example 13 with ItmConfig

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.ItmConfig in project genius by opendaylight.

the class TransportZoneListener method add.

@Override
public void add(@Nonnull TransportZone transportZone) {
    LOG.debug("Received Transport Zone Add Event: {}", transportZone);
    List<DPNTEPsInfo> opDpnList = createDPNTepInfo(transportZone);
    List<HwVtep> hwVtepList = createhWVteps(transportZone);
    opDpnList.addAll(getDPNTepInfoFromNotHosted(transportZone));
    LOG.trace("Add: Operational dpnTepInfo - Before invoking ItmManager {}", opDpnList);
    if (!opDpnList.isEmpty() || !hwVtepList.isEmpty()) {
        LOG.trace("Add: Invoking ItmManager with DPN List {} ", opDpnList);
        LOG.trace("Add: Invoking ItmManager with hwVtep List {} ", hwVtepList);
        jobCoordinator.enqueueJob(transportZone.getZoneName(), new ItmTepAddWorker(opDpnList, hwVtepList, dataBroker, mdsalManager, itmConfig, itmInternalTunnelAddWorker, externalTunnelAddWorker, dpnTEPsInfoCache));
    }
}
Also used : HwVtep(org.opendaylight.genius.itm.confighelpers.HwVtep) DPNTEPsInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo) ItmTepAddWorker(org.opendaylight.genius.itm.confighelpers.ItmTepAddWorker)

Example 14 with ItmConfig

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.ItmConfig in project genius by opendaylight.

the class TransportZoneListener method update.

@Override
public void update(@Nonnull TransportZone originalTransportZone, @Nonnull TransportZone updatedTransportZone) {
    LOG.debug("Received Transport Zone Update Event: Old - {}, Updated - {}", originalTransportZone, updatedTransportZone);
    List<DPNTEPsInfo> oldDpnTepsList = createDPNTepInfo(originalTransportZone);
    List<DPNTEPsInfo> newDpnTepsList = createDPNTepInfo(updatedTransportZone);
    List<DPNTEPsInfo> oldDpnTepsListcopy = new ArrayList<>();
    oldDpnTepsListcopy.addAll(oldDpnTepsList);
    LOG.trace("oldcopy0 {}", oldDpnTepsListcopy);
    List<DPNTEPsInfo> newDpnTepsListcopy = new ArrayList<>();
    newDpnTepsListcopy.addAll(newDpnTepsList);
    LOG.trace("newcopy0 {}", newDpnTepsListcopy);
    oldDpnTepsList.removeAll(newDpnTepsListcopy);
    newDpnTepsList.removeAll(oldDpnTepsListcopy);
    LOG.trace("oldDpnTepsList {}", oldDpnTepsList);
    LOG.trace("newDpnTepsList {}", newDpnTepsList);
    LOG.trace("oldcopy {}", oldDpnTepsListcopy);
    LOG.trace("newcopy {}", newDpnTepsListcopy);
    LOG.trace("oldcopy Size {}", oldDpnTepsList.size());
    LOG.trace("newcopy Size {}", newDpnTepsList.size());
    if (!newDpnTepsList.isEmpty()) {
        LOG.trace("Adding TEPs ");
        jobCoordinator.enqueueJob(updatedTransportZone.getZoneName(), new ItmTepAddWorker(newDpnTepsList, Collections.emptyList(), dataBroker, mdsalManager, itmConfig, itmInternalTunnelAddWorker, externalTunnelAddWorker, dpnTEPsInfoCache));
    }
    if (!oldDpnTepsList.isEmpty()) {
        LOG.trace("Removing TEPs ");
        jobCoordinator.enqueueJob(updatedTransportZone.getZoneName(), new ItmTepRemoveWorker(oldDpnTepsList, Collections.emptyList(), originalTransportZone, dataBroker, mdsalManager, itmInternalTunnelDeleteWorker, dpnTEPsInfoCache));
    }
    List<HwVtep> oldHwList = createhWVteps(originalTransportZone);
    List<HwVtep> newHwList = createhWVteps(updatedTransportZone);
    List<HwVtep> oldHwListcopy = new ArrayList<>();
    oldHwListcopy.addAll(oldHwList);
    LOG.trace("oldHwListcopy0 {}", oldHwListcopy);
    List<HwVtep> newHwListcopy = new ArrayList<>();
    newHwListcopy.addAll(newHwList);
    LOG.trace("newHwListcopy0 {}", newHwListcopy);
    oldHwList.removeAll(newHwListcopy);
    newHwList.removeAll(oldHwListcopy);
    LOG.trace("oldHwList {}", oldHwList);
    LOG.trace("newHwList {}", newHwList);
    LOG.trace("oldHwListcopy {}", oldHwListcopy);
    LOG.trace("newHwListcopy {}", newHwListcopy);
    if (!newHwList.isEmpty()) {
        LOG.trace("Adding HW TEPs ");
        jobCoordinator.enqueueJob(updatedTransportZone.getZoneName(), new ItmTepAddWorker(Collections.emptyList(), newHwList, dataBroker, mdsalManager, itmConfig, itmInternalTunnelAddWorker, externalTunnelAddWorker, dpnTEPsInfoCache));
    }
    if (!oldHwList.isEmpty()) {
        LOG.trace("Removing HW TEPs ");
        jobCoordinator.enqueueJob(updatedTransportZone.getZoneName(), new ItmTepRemoveWorker(Collections.emptyList(), oldHwList, originalTransportZone, dataBroker, mdsalManager, itmInternalTunnelDeleteWorker, dpnTEPsInfoCache));
    }
}
Also used : ItmTepRemoveWorker(org.opendaylight.genius.itm.confighelpers.ItmTepRemoveWorker) ArrayList(java.util.ArrayList) HwVtep(org.opendaylight.genius.itm.confighelpers.HwVtep) DPNTEPsInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo) ItmTepAddWorker(org.opendaylight.genius.itm.confighelpers.ItmTepAddWorker)

Aggregations

ItmConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.ItmConfig)6 ItmConfigBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.ItmConfigBuilder)6 ArrayList (java.util.ArrayList)5 TepCommandHelper (org.opendaylight.genius.itm.cli.TepCommandHelper)5 TransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZone)5 Test (org.junit.Test)4 DPNTEPsInfo (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo)4 TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)3 ItmTepAddWorker (org.opendaylight.genius.itm.confighelpers.ItmTepAddWorker)3 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)3 TepsInNotHostedTransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZone)3 BigInteger (java.math.BigInteger)2 TepException (org.opendaylight.genius.itm.cli.TepException)2 HwVtep (org.opendaylight.genius.itm.confighelpers.HwVtep)2 ItmTepRemoveWorker (org.opendaylight.genius.itm.confighelpers.ItmTepRemoveWorker)2 TunnelOptions (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.tunnel.optional.params.TunnelOptions)2 Vteps (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.subnets.Vteps)2 SubnetUtils (org.apache.commons.net.util.SubnetUtils)1 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)1 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)1