cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anim...@apache.org
Subject [08/19] git commit: updated refs/heads/4.3 to c1af92f
Date Fri, 07 Feb 2014 22:10:57 GMT
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.
(cherry picked from commit 2e004878b1da0f7fb5ec12e77babbb626e96c1ef)

Signed-off-by: Animesh Chaturvedi <animesh@apache.org>


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

Branch: refs/heads/4.3
Commit: f93be7b2b609be540f86eb22a6da6f963014dfc5
Parents: f5b9fed
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Wed Feb 5 17:12:58 2014 +0530
Committer: Animesh Chaturvedi <animesh@apache.org>
Committed: Fri Feb 7 13:16:52 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f93be7b2/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 a7701da..b5e8173 100644
--- a/api/src/com/cloud/network/Network.java
+++ b/api/src/com/cloud/network/Network.java
@@ -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;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f93be7b2/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 48ccf70..ba47df4 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
@@ -881,7 +881,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/f93be7b2/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 0366143..6ebc070 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/f93be7b2/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 d4310d4..270ff7b 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -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()) {


Mime
View raw message