@Override public void update(Port port) { // TODO Port IP and port's host ip is stored by Lisp Neutron Service. If // there is change to these fields, the update needs to be processed. LOG.info("Neutron Port updated: Port name: " + port.getName() + " Port Fixed IP: " + (port.getFixedIps() != null ? port.getFixedIps().get(0) : "No Fixed IP assigned")); LOG.debug("Neutron Port Updated : " + port.toString()); }
private String getSubnetIPFromPort(Port port) throws Exception { FixedIps ip = port.getFixedIps().get(0); if (ip == null) { LOG.error("No fixed ip for port " + port.getName()); throw new Exception("No fixed ip for port" + port.getName()); } Uuid subnetId = ip.getSubnetId(); Subnetmap subnetmap = nvManager.updateSubnetmapNodeWithPorts(subnetId, port.getUuid(), null); String subnetIp = subnetmap.getSubnetIp(); return subnetIp; }
+ port.getName() + " Port Fixed IP: " + (port.getFixedIps() != null ? port.getFixedIps().get(0)
private boolean checkIfVxlanNetwork(Port port) { InstanceIdentifier<Network> networkPath = InstanceIdentifier.create(Neutron.class) .child(Networks.class).child(Network.class, new NetworkKey(port.getNetworkId())); Network network = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, networkPath); if (network == null || !NeutronvpnUtils.isNetworkOfType(network, NetworkTypeVxlan.class)) { LOG.debug("port in non-VXLAN network " + port.getName()); return false; } return true; }
@Override protected void remove(InstanceIdentifier<Port> identifier, Port input) { if (LOG.isTraceEnabled()) { LOG.trace("Removing Port : key: " + identifier + ", value=" + input); } Network network = NeutronvpnUtils.getNeutronNetwork(dataBroker, input.getNetworkId()); if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) { //FIXME: This should be removed when support for VLAN and GRE network types is added LOG.error("neutron vpn doesn't support vlan/gre network provider type for the port {} which is part of " + "network {}.", input.getName(), network); return; } NeutronvpnUtils.removeFromPortCache(input); if ((input.getDeviceOwner() != null) && (input.getDeviceId() != null)) { if (input.getDeviceOwner().equals(NeutronConstants.DEVICE_OWNER_ROUTER_INF)) { handleRouterInterfaceRemoved(input); /* nothing else to do here */ return; } } if (input.getFixedIps() != null && !input.getFixedIps().isEmpty()) { handleNeutronPortDeleted(input); } }
@Override protected void add(InstanceIdentifier<Port> identifier, Port input) { if (LOG.isTraceEnabled()) { LOG.trace("Adding Port : key: " + identifier + ", value=" + input); } Network network = NeutronvpnUtils.getNeutronNetwork(dataBroker, input.getNetworkId()); if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) { //FIXME: This should be removed when support for VLAN and GRE network types is added LOG.error("neutron vpn doesn't support vlan/gre network provider type for the port {} " + "which is part of network {}.", input.getName(), network); return; } NeutronvpnUtils.addToPortCache(input); /* check if router interface has been created */ if ((input.getDeviceOwner() != null) && (input.getDeviceId() != null)) { if (input.getDeviceOwner().equals(NeutronConstants.DEVICE_OWNER_ROUTER_INF)) { handleRouterInterfaceAdded(input); /* nothing else to do here */ return; } if (NeutronConstants.DEVICE_OWNER_GATEWAY_INF.equals(input.getDeviceOwner())) { handleRouterGatewayUpdated(input); } } if (input.getFixedIps() != null && !input.getFixedIps().isEmpty()) { handleNeutronPortCreated(input); } }
+ port.getName() + " Port Fixed IP: " + (port.getFixedIps() != null ? port.getFixedIps().get(0)
/** * Create a new vBridge interface associated with the given port. * * @param port A {@link Port} instance. */ private void createPort(Port port) { if (port == null) { LOG.warn("Null neutron port has been created."); } else { recordLog(LOG, "Neutron port has been created", port); UpdateVinterfaceInput input = new UpdateVinterfaceInputBuilder(). setTenantName(getTenantId(port)). setBridgeName(getBridgeId(port)). setInterfaceName(getInterfaceId(port)). setDescription(port.getName()). setEnabled(port.isAdminStateUp()). setUpdateMode(VnodeUpdateMode.CREATE). build(); int result = vtnManager.updateInterface(input); if (result != HTTP_OK) { LOG.error("Failed to create vBridge interface: port={}", port); } } }
if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) { LOG.error("neutron vpn doesn't support vlan/gre network provider type for the port {} which is part of network {}." + " Skipping the processing of Port update DCN", update.getName(), network); return;
result.setName(port.getName()); result.setNetworkUUID(String.valueOf(port.getNetworkId().getValue())); if (port.getSecurityGroups() != null) {
result.setName(port.getName()); result.setNetworkUUID(String.valueOf(port.getNetworkId().getValue())); if (port.getSecurityGroups() != null) {
result.setName(port.getName()); result.setNetworkUUID(String.valueOf(port.getNetworkId().getValue())); if (port.getSecurityGroups() != null) {
result.setName(port.getName()); result.setNetworkUUID(String.valueOf(port.getNetworkId().getValue())); if (port.getSecurityGroups() != null) {
result.setName(port.getName()); result.setNetworkUUID(String.valueOf(port.getNetworkId().getValue())); if (port.getSecurityGroups() != null) {