use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712.l2gateway.connections.attributes.L2gatewayConnections in project netvirt by opendaylight.
the class L2GwValidateCli method verifyL2GatewayConnections.
private void verifyL2GatewayConnections() {
boolean isValid = true;
for (L2gatewayConnection l2gatewayConnection : l2gatewayConnections) {
L2gateway l2gateway = uuidToL2Gateway.get(l2gatewayConnection.getL2gatewayId());
String logicalSwitchName = l2gatewayConnection.getNetworkId().getValue();
List<Devices> devices = l2gateway.getDevices();
for (Devices device : devices) {
L2GatewayDevice l2GatewayDevice = l2GatewayCache.get(device.getDeviceName());
isValid = verifyL2GatewayDevice(l2gateway, device, l2GatewayDevice);
if (!isValid) {
continue;
}
NodeId nodeId = new NodeId(l2GatewayDevice.getHwvtepNodeId());
InstanceIdentifier<Node> nodeIid = topoIid.child(Node.class, new NodeKey(nodeId));
isValid = verfiyLogicalSwitch(logicalSwitchName, nodeIid);
if (isValid) {
isValid = verifyMcastMac(logicalSwitchName, nodeIid);
verifyVlanBindings(nodeIid, logicalSwitchName, device, l2gatewayConnection.getSegmentId());
L2GatewayDevice elanL2gatewayDevice = ElanL2GwCacheUtils.getL2GatewayDeviceFromCache(logicalSwitchName, nodeId.getValue());
if (elanL2gatewayDevice == null) {
pw.println("Failed elan l2gateway device not found for network " + logicalSwitchName + " and device " + device.getDeviceName() + " " + l2GatewayDevice.getHwvtepNodeId() + " l2gw connection id " + l2gatewayConnection.getUuid());
}
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712.l2gateway.connections.attributes.L2gatewayConnections in project netvirt by opendaylight.
the class L2GwValidateCli method readNodes.
private void readNodes() throws ReadFailedException {
try (ReadOnlyTransaction tx = dataBroker.newReadOnlyTransaction()) {
InstanceIdentifier<Topology> topoId = HwvtepSouthboundUtils.createHwvtepTopologyInstanceIdentifier();
Optional<Topology> operationalTopoOptional = tx.read(LogicalDatastoreType.OPERATIONAL, topoId).checkedGet();
Optional<Topology> configTopoOptional = tx.read(LogicalDatastoreType.CONFIGURATION, topoId).checkedGet();
if (operationalTopoOptional.isPresent()) {
for (Node node : operationalTopoOptional.get().getNode()) {
InstanceIdentifier<Node> nodeIid = topoId.child(Node.class, node.getKey());
operationalNodes.put(nodeIid, node);
}
}
if (configTopoOptional.isPresent()) {
for (Node node : configTopoOptional.get().getNode()) {
InstanceIdentifier<Node> nodeIid = topoId.child(Node.class, node.getKey());
configNodes.put(nodeIid, node);
}
}
fillNodesData(operationalNodes, operationalNodesData);
fillNodesData(configNodes, configNodesData);
Optional<ElanInstances> elanInstancesOptional = tx.read(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.builder(ElanInstances.class).build()).checkedGet();
if (elanInstancesOptional.isPresent() && elanInstancesOptional.get().getElanInstance() != null) {
for (ElanInstance elanInstance : elanInstancesOptional.get().getElanInstance()) {
elanInstanceMap.put(elanInstance.getElanInstanceName(), elanInstance);
}
}
l2gatewayConnections = L2GatewayConnectionUtils.getAllL2gatewayConnections(dataBroker);
l2gateways = L2GatewayConnectionUtils.getL2gatewayList(dataBroker);
for (L2gateway l2gateway : l2gateways) {
uuidToL2Gateway.put(l2gateway.getUuid(), l2gateway);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712.l2gateway.connections.attributes.L2gatewayConnections in project netvirt by opendaylight.
the class L2gwServiceProvider method provisionItmAndL2gwConnection.
@Override
public void provisionItmAndL2gwConnection(L2GatewayDevice l2GwDevice, String psName, String hwvtepNodeId, IpAddress tunnelIpAddr) {
elanClusterUtils.runOnlyInOwnerNode(hwvtepNodeId, "Handling Physical Switch add create itm tunnels ", () -> {
ElanL2GatewayUtils.createItmTunnels(dataBroker, itmRpcService, hwvtepNodeId, psName, tunnelIpAddr);
return Collections.emptyList();
});
List<L2gatewayConnection> l2GwConns = L2GatewayConnectionUtils.getAssociatedL2GwConnections(dataBroker, l2GwDevice.getL2GatewayIds());
LOG.debug("L2GatewayConnections associated for {} physical switch", psName);
for (L2gatewayConnection l2GwConn : l2GwConns) {
LOG.trace("L2GatewayConnection {} changes executed on physical switch {}", l2GwConn.getL2gatewayId(), psName);
l2GatewayConnectionUtils.addL2GatewayConnection(l2GwConn, psName);
}
}
Aggregations