CLOUDSTACK-5967: GRE tunnel creation is failing

after network orchestrator refactor, only network elements providingg
services as defined by network offering, are invloved network design and
imlement phase. So OVS network element need to be enables as
'Connectivity' service provider to make GRE tunnels work. This fix
introduced 'Ovs' provider as Connectivity service provider.
This commit is contained in:
Murali Reddy 2014-02-05 17:12:58 +05:30
parent 09e27fd7bf
commit 2e004878b1
4 changed files with 22 additions and 3 deletions

View File

@ -130,6 +130,7 @@ public interface Network extends ControlledEntity, StateObject<Network.State>, I
public static final Provider NiciraNvp = new Provider("NiciraNvp", false);
public static final Provider InternalLbVm = new Provider("InternalLbVm", false);
public static final Provider CiscoVnmc = new Provider("CiscoVnmc", true);
public static final Provider Ovs = new Provider("Ovs", false);
private final String name;
private final boolean isExternal;

View File

@ -870,7 +870,12 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
dom0vif = VIF.create(conn, vifr);
}
// At this stage we surely have a VIF
dom0vif.plug(conn);
try {
dom0vif.plug(conn);
} catch (Exception e) {
// though wierd exception is thrown, VIF actually gets plugged-in to dom0, so just ignore exception
s_logger.info("Ignoring the benign error thrown while plugging VIF to dom0");
}
dom0vif.unplug(conn);
synchronized(_tmpDom0Vif) {
_tmpDom0Vif.add(dom0vif);

View File

@ -16,6 +16,7 @@
// under the License.
package com.cloud.network.element;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@ -53,12 +54,14 @@ public class OvsElement extends AdapterBase implements NetworkElement {
@Override
public Map<Service, Map<Capability, String>> getCapabilities() {
return null;
Map<Service, Map<Capability, String>> capabilities = new HashMap<Service, Map<Capability, String>>();
capabilities.put(Service.Connectivity, null);
return capabilities;
}
@Override
public Provider getProvider() {
return null;
return Network.Provider.Ovs;
}
@Override

View File

@ -2502,6 +2502,11 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
//Add Internal Load Balancer element as a default network service provider
addDefaultInternalLbProviderToPhysicalNetwork(pNetwork.getId());
// Add OVS provider as default network service provider
if (pNetwork.getIsolationMethods().contains("GRE")) {
addDefaultOvsToPhysicalNetwork(pNetwork.getId());
}
return pNetwork;
}
});
@ -3796,6 +3801,11 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
return null;
}
private PhysicalNetworkServiceProvider addDefaultOvsToPhysicalNetwork(long physicalNetworkId) {
PhysicalNetworkServiceProvider nsp = addProviderToPhysicalNetwork(physicalNetworkId, Network.Provider.Ovs.getName(), null, null);
return nsp;
}
protected boolean isNetworkSystem(Network network) {
NetworkOffering no = _networkOfferingDao.findByIdIncludingRemoved(network.getNetworkOfferingId());
if (no.isSystemOnly()) {