@Override
public List<ListenableFuture<Void>> call() {
LOG.trace("Adding Pod : {}", podInterface);
- String interfaceName = CoeUtils.buildInterfaceName(pods.getNetworkNS(), pods.getName());
+ String interfaceName = CoeUtils.buildInterfaceName(pods.getClusterId().getValue(), pods.getName());
List<ListenableFuture<Void>> futures = new ArrayList<>();
futures.add(txRunner.callWithNewReadWriteTransactionAndSubmit(CONFIGURATION, tx -> {
String nodeIp = pods.getHostIpAddress().stringValue();
ElanInstance elanInstance = CoeUtils.createElanInstanceForTheFirstPodInTheNetwork(
- pods.getNetworkNS(), nodeIp, podInterface, tx);
+ pods.getClusterId().getValue(), nodeIp, podInterface, tx);
LOG.info("interface creation for pod {}", interfaceName);
String portInterfaceName = CoeUtils.createOfPortInterface(interfaceName, tx);
LOG.debug("Creating ELAN Interface for pod {}", interfaceName);
elanInstance.getElanInstanceName(), tx);
LOG.debug("Creating VPN instance for namespace {}", pods.getNetworkNS());
List<String> rd = Arrays.asList("100:1");
- CoeUtils.createVpnInstance(pods.getNetworkNS(), rd, null, null,
+ CoeUtils.createVpnInstance(pods.getClusterId().getValue(), rd, null, null,
VpnInstance.Type.L3, 0, IpVersionChoice.IPV4, tx);
}));
if (podInterface.getIpAddress() != null) {
@Override
public List<ListenableFuture<Void>> call() {
List<ListenableFuture<Void>> futures = new ArrayList<>();
- String podInterfaceName = CoeUtils.buildInterfaceName(pods.getNetworkNS(), pods.getName());
+ String podInterfaceName = CoeUtils.buildInterfaceName(pods.getClusterId().getValue(), pods.getName());
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
LOG.trace("Deleting Pod : {}", podInterfaceName);
LOG.debug("Deleting VPN Interface for pod {}", podInterfaceName);
}
public static ElanInstance
- createElanInstanceForTheFirstPodInTheNetwork(String networkNS, String nodeIp,
+ createElanInstanceForTheFirstPodInTheNetwork(String clusterId, String nodeIp,
org.opendaylight.yang.gen.v1.urn.opendaylight.coe.northbound.pod
.rev170611.pod_attributes.Interface podInterface,
TypedReadWriteTransaction<Datastore.Configuration> wrtConfigTxn)
throws ExecutionException, InterruptedException {
- String elanInstanceName = buildElanInstanceName(nodeIp, networkNS);
+ String elanInstanceName = buildElanInstanceName(nodeIp, clusterId);
InstanceIdentifier<ElanInstance> id = createElanInstanceIdentifier(elanInstanceName);
ElanInstance existingElanInstance = wrtConfigTxn.read(id).get().orNull();
if (existingElanInstance != null) {