cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralire...@apache.org
Subject git commit: updated refs/heads/4.2 to 9a3adc9
Date Wed, 05 Feb 2014 12:07:16 GMT
Updated Branches:
  refs/heads/4.2 efc79beec -> 9a3adc97c


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.

Conflicts:
	server/src/com/cloud/network/NetworkServiceImpl.java


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9a3adc97
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9a3adc97
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9a3adc97

Branch: refs/heads/4.2
Commit: 9a3adc97ca11c8044296f65ac00ff7f581e4fde6
Parents: efc79be
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Wed Feb 5 17:12:58 2014 +0530
Committer: Murali Reddy <muralimmreddy@gmail.com>
Committed: Wed Feb 5 17:20:35 2014 +0530

----------------------------------------------------------------------
 api/src/com/cloud/network/Network.java                   |  1 +
 .../hypervisor/xen/resource/CitrixResourceBase.java      |  7 ++++++-
 .../ovs/src/com/cloud/network/element/OvsElement.java    |  7 +++++--
 server/src/com/cloud/network/NetworkServiceImpl.java     | 11 +++++++++++
 4 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a3adc97/api/src/com/cloud/network/Network.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java
index 9be6171..59a8656 100644
--- a/api/src/com/cloud/network/Network.java
+++ b/api/src/com/cloud/network/Network.java
@@ -127,6 +127,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 String name;
         private boolean isExternal;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a3adc97/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 0a8e409..267bd38 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -895,7 +895,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);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a3adc97/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
index 40be5ff..29f63ec 100644
--- a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
+++ b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java
@@ -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

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a3adc97/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index 4169d42..a85f78d 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -2472,8 +2472,14 @@ 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());
+            }
+
             txn.commit();
             return pNetwork;
+
         } catch (Exception ex) {
             s_logger.warn("Exception: ", ex);
             throw new CloudRuntimeException("Fail to create a physical network");
@@ -3740,6 +3746,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()) {


Mime
View raw message