Search in sources :

Example 1 with Host

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host in project netvirt by opendaylight.

the class BgpRouter method reConnect.

private void reConnect(TTransportException tte) {
    Bgp bgpConfig = bgpConfigSupplier.get();
    if (bgpConfig != null) {
        LOG.error("Received TTransportException, while configuring qthriftd, goind for Disconnect/Connect " + " Host: {}, Port: {}", bgpConfig.getConfigServer().getHost().getValue(), bgpConfig.getConfigServer().getPort().intValue());
        disconnect();
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            LOG.error("Exception wile reconnecting ", e);
        }
        connect(bgpConfig.getConfigServer().getHost().getValue(), bgpConfig.getConfigServer().getPort().intValue());
    } else {
        LOG.error("Unable to send commands to thrift and fetch bgp configuration", tte);
    }
}
Also used : Bgp(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.Bgp)

Example 2 with Host

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host in project netvirt by opendaylight.

the class IfMgr method removePort.

public void removePort(Uuid portId) {
    VirtualPort intf = portId != null ? vintfs.remove(portId) : null;
    if (intf != null) {
        intf.removeSelf();
        Uuid networkID = intf.getNetworkID();
        if (intf.getDeviceOwner().equalsIgnoreCase(Ipv6Constants.NETWORK_ROUTER_INTERFACE)) {
            LOG.info("In removePort for router interface, portId {}", portId);
            if (networkID != null) {
                vrouterv6IntfMap.remove(networkID, intf);
            }
            /* Router port is deleted. Remove the corresponding icmpv6 punt flows on all
                the dpnIds which were hosting the VMs on the network.
                 */
            programIcmpv6RSPuntFlows(intf, Ipv6Constants.DEL_FLOW);
            for (Ipv6Address ipv6Address : intf.getIpv6Addresses()) {
                programIcmpv6NSPuntFlowForAddress(intf, ipv6Address, Ipv6Constants.DEL_FLOW);
            }
            transmitRouterAdvertisement(intf, Ipv6RtrAdvertType.CEASE_ADVERTISEMENT);
            timer.cancelPeriodicTransmissionTimeout(intf.getPeriodicTimeout());
            intf.resetPeriodicTimeout();
            LOG.debug("Reset the periodic RA Timer for intf {}", intf.getIntfUUID());
        } else {
            LOG.info("In removePort for host interface, portId {}", portId);
            // Remove the serviceBinding entry for the port.
            ipv6ServiceUtils.unbindIpv6Service(portId.getValue());
            // Remove the portId from the (network <--> List[dpnIds, List <ports>]) cache.
            VirtualNetwork vnet = getNetwork(networkID);
            if (null != vnet) {
                BigInteger dpId = intf.getDpId();
                vnet.updateDpnPortInfo(dpId, intf.getOfPort(), Ipv6Constants.DEL_ENTRY);
            }
        }
    }
}
Also used : IVirtualPort(org.opendaylight.netvirt.ipv6service.api.IVirtualPort) IVirtualNetwork(org.opendaylight.netvirt.ipv6service.api.IVirtualNetwork) Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid) BigInteger(java.math.BigInteger) Ipv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)

Example 3 with Host

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host in project netvirt by opendaylight.

the class NeutronPortChangeListener method addInterfaceInfo.

protected void addInterfaceInfo(Port port, FixedIps fixedip) {
    if (port.getDeviceOwner().equalsIgnoreCase(Ipv6Constants.NETWORK_ROUTER_INTERFACE)) {
        LOG.info("IPv6: addInterfaceInfo is invoked for a router interface {}, fixedIp: {}", port, fixedip);
        // Add router interface
        ifMgr.addRouterIntf(port.getUuid(), new Uuid(port.getDeviceId()), fixedip.getSubnetId(), port.getNetworkId(), fixedip.getIpAddress(), port.getMacAddress().getValue(), port.getDeviceOwner());
    } else {
        LOG.info("IPv6: addInterfaceInfo is invoked for a host interface {}, fixedIp: {}", port, fixedip);
        // Add host interface
        ifMgr.addHostIntf(port.getUuid(), fixedip.getSubnetId(), port.getNetworkId(), fixedip.getIpAddress(), port.getMacAddress().getValue(), port.getDeviceOwner());
    }
}
Also used : Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)

Example 4 with Host

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host in project netvirt by opendaylight.

the class NeutronHostConfigChangeListener method extractHostConfig.

private Map<String, String> extractHostConfig(Node node) {
    Map<String, String> config = new HashMap<>();
    OvsdbNodeAugmentation ovsdbNode = getOvsdbNodeAugmentation(node);
    if (ovsdbNode != null && ovsdbNode.getOpenvswitchExternalIds() != null) {
        for (OpenvswitchExternalIds openvswitchExternalIds : ovsdbNode.getOpenvswitchExternalIds()) {
            if (openvswitchExternalIds.getExternalIdKey() != null && openvswitchExternalIds.getExternalIdKey().startsWith(OS_HOST_CONFIG_CONFIG_KEY_PREFIX)) {
                // Extract the host type. Max 8 characters after
                // suffix OS_HOST_CONFIG_CONFIG_KEY_PREFIX.length()
                String hostType = openvswitchExternalIds.getExternalIdKey().substring(OS_HOST_CONFIG_CONFIG_KEY_PREFIX.length());
                if (hostType.length() > 0) {
                    if (hostType.length() > HOST_TYPE_STR_LEN) {
                        hostType = hostType.substring(0, HOST_TYPE_STR_LEN);
                    }
                    hostType = "ODL " + hostType.toUpperCase(Locale.getDefault());
                    if (null != openvswitchExternalIds.getExternalIdValue()) {
                        config.put(hostType, openvswitchExternalIds.getExternalIdValue());
                    }
                }
            }
        }
    }
    return config;
}
Also used : OpenvswitchExternalIds(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.OpenvswitchExternalIds) HashMap(java.util.HashMap) OvsdbNodeAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation)

Example 5 with Host

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host in project netvirt by opendaylight.

the class NeutronPortChangeListener method handleRouterInterfaceRemoved.

private void handleRouterInterfaceRemoved(Port routerPort) {
    if (routerPort.getDeviceId() != null) {
        Uuid routerId = new Uuid(routerPort.getDeviceId());
        Uuid infNetworkId = routerPort.getNetworkId();
        elanService.removeKnownL3DmacAddress(routerPort.getMacAddress().getValue(), infNetworkId.getValue());
        Uuid vpnId = neutronvpnUtils.getVpnForRouter(routerId, true);
        if (vpnId == null) {
            vpnId = routerId;
        }
        List<FixedIps> portIps = routerPort.getFixedIps();
        boolean vpnInstanceInternetIpVersionRemoved = false;
        Uuid vpnInstanceInternetUuid = null;
        for (FixedIps portIP : portIps) {
            // Internet VPN : flush InternetVPN first
            Uuid subnetId = portIP.getSubnetId();
            Subnetmap sn = neutronvpnUtils.getSubnetmap(subnetId);
            if (sn != null && sn.getInternetVpnId() != null) {
                if (neutronvpnUtils.shouldVpnHandleIpVersionChangeToRemove(sn, sn.getInternetVpnId())) {
                    vpnInstanceInternetIpVersionRemoved = true;
                    vpnInstanceInternetUuid = sn.getInternetVpnId();
                }
                nvpnManager.updateVpnInternetForSubnet(sn, sn.getInternetVpnId(), false);
            }
        }
        /* Remove ping responder for router interfaces
             *  A router interface reference in a VPN will have to be removed before the host interface references
             * for that subnet in the VPN are removed. This is to ensure that the FIB Entry of the router interface
             *  is not the last entry to be removed for that subnet in the VPN.
             *  If router interface FIB entry is the last to be removed for a subnet in a VPN , then all the host
             *  interface references in the vpn will already have been cleared, which will cause failures in
             *  cleanup of router interface flows*/
        nvpnManager.deleteVpnInterface(routerPort.getUuid().getValue(), null, /* vpn-id */
        null);
        // update RouterInterfaces map
        WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
        boolean vpnInstanceIpVersionRemoved = false;
        IpVersionChoice vpnInstanceIpVersionToRemove = IpVersionChoice.UNDEFINED;
        for (FixedIps portIP : portIps) {
            Subnetmap sn = neutronvpnUtils.getSubnetmap(portIP.getSubnetId());
            // router Port have either IPv4 or IPv6, never both
            if (neutronvpnUtils.shouldVpnHandleIpVersionChangeToRemove(sn, vpnId)) {
                vpnInstanceIpVersionRemoved = true;
                vpnInstanceIpVersionToRemove = neutronvpnUtils.getIpVersionFromString(sn.getSubnetIp());
            }
            String ipValue = String.valueOf(portIP.getIpAddress().getValue());
            neutronvpnUtils.removeVpnPortFixedIpToPort(vpnId.getValue(), ipValue, wrtConfigTxn);
            // NOTE:  Please donot change the order of calls to removeSubnetFromVpn and
            // and updateSubnetNodeWithFixedIP
            nvpnManager.removeSubnetFromVpn(vpnId, portIP.getSubnetId(), sn != null ? sn.getInternetVpnId() : null);
            nvpnManager.updateSubnetNodeWithFixedIp(portIP.getSubnetId(), null, null, null, null, null);
        }
        nvpnManager.removeFromNeutronRouterInterfacesMap(routerId, routerPort.getUuid().getValue());
        deleteElanInterface(routerPort.getUuid().getValue(), wrtConfigTxn);
        deleteOfPortInterface(routerPort, wrtConfigTxn);
        wrtConfigTxn.submit();
        nvpnNatManager.handleSubnetsForExternalRouter(routerId);
        if (vpnInstanceIpVersionRemoved) {
            neutronvpnUtils.updateVpnInstanceWithIpFamily(vpnId.getValue(), vpnInstanceIpVersionToRemove, false);
        }
        if (vpnInstanceInternetIpVersionRemoved) {
            neutronvpnUtils.updateVpnInstanceWithIpFamily(vpnInstanceInternetUuid.getValue(), IpVersionChoice.IPV6, false);
            neutronvpnUtils.updateVpnInstanceWithFallback(vpnInstanceInternetUuid.getValue(), false);
        }
    }
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid) Subnetmap(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.Subnetmap) FixedIps(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIps) IpVersionChoice(org.opendaylight.netvirt.neutronvpn.api.enums.IpVersionChoice)

Aggregations

InetAddress (java.net.InetAddress)6 UnknownHostException (java.net.UnknownHostException)6 Host (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Host)6 Server (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Server)6 Connector (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Connector)4 Engine (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Engine)4 Listener (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Listener)4 Service (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Service)4 Context (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context)3 ServerInstance (org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance)3 Ipv6Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)3 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)3 File (java.io.File)2 FileInputStream (java.io.FileInputStream)2 IOException (java.io.IOException)2 BigInteger (java.math.BigInteger)2 HashMap (java.util.HashMap)2 JarFile (java.util.jar.JarFile)2 IPath (org.eclipse.core.runtime.IPath)2 Factory (org.eclipse.jst.server.tomcat.core.internal.xml.Factory)2