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);
}
}
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);
}
}
}
}
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());
}
}
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;
}
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);
}
}
}
Aggregations