cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.3 to b9d9c2b
Date Mon, 01 Dec 2014 12:23:35 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3 e0ea8801f -> b9d9c2b7f


CLOUDSTACK-7360 [vmware] Add host to existing cluster fails if the cluster is using Nexus
1000v as backend for atleast one traffic type.

While adding host to existing cluster which is using Nexus 1000v as a network backend, skip
validation of Nexus VSM as it was already done while adding that cluster.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
(cherry picked from commit a1d0925f902041b187f14413e91bc368f0708753)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java


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

Branch: refs/heads/4.3
Commit: b9d9c2b7fad3fa1aacfe15687366f640dabde176
Parents: e0ea880
Author: Sateesh Chodapuneedi <sateesh@apache.org>
Authored: Mon Aug 18 07:18:13 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Dec 1 17:52:54 2014 +0530

----------------------------------------------------------------------
 .../vmware/VmwareServerDiscoverer.java          | 22 ++++++++++++--------
 .../vmware/manager/VmwareManager.java           |  2 ++
 .../vmware/manager/VmwareManagerImpl.java       | 15 +++++++++++++
 3 files changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b9d9c2b7/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
index 54e9815..c80696d 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
@@ -311,15 +311,19 @@ public class VmwareServerDiscoverer extends DiscovererBase implements
 			if (guestTrafficLabel != null) {
                 s_logger.info("Detected guest network label : " + guestTrafficLabel);
             }
-            vsmIp = _urlParams.get("vsmipaddress");
-            String vsmUser = _urlParams.get("vsmusername");
-            String vsmPassword = _urlParams.get("vsmpassword");
-            String clusterName = cluster.getName();
-            try {
-                vsmInfo = _nexusElement.validateAndAddVsm(vsmIp, vsmUser, vsmPassword, clusterId,
clusterName);
-            } catch(ResourceInUseException ex) {
-                DiscoveryException discEx = new DiscoveryException(ex.getLocalizedMessage()
+ ". The resource is " + ex.getResourceName());
-                throw discEx;
+            // Before proceeding with validation of Nexus 1000v VSM check if an instance
of Nexus 1000v VSM is already associated with this cluster.
+            boolean clusterHasVsm = _vmwareMgr.hasNexusVSM(clusterId);
+            if (!clusterHasVsm) {
+                vsmIp = _urlParams.get("vsmipaddress");
+                String vsmUser = _urlParams.get("vsmusername");
+                String vsmPassword = _urlParams.get("vsmpassword");
+                String clusterName = cluster.getName();
+                try {
+                    vsmInfo = _nexusElement.validateAndAddVsm(vsmIp, vsmUser, vsmPassword,
clusterId, clusterName);
+                } catch (ResourceInUseException ex) {
+                    DiscoveryException discEx = new DiscoveryException(ex.getLocalizedMessage()
+ ". The resource is " + ex.getResourceName());
+                    throw discEx;
+                }
             }
             vsmCredentials = _vmwareMgr.getNexusVSMCredentialsByClusterId(clusterId);
 		}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b9d9c2b7/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
index bc0c9a4..2d8ac3f 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java
@@ -72,4 +72,6 @@ public interface VmwareManager {
     public int getVcenterSessionTimeout();
 
     boolean isLegacyZone(long dcId);
+
+    boolean hasNexusVSM(Long clusterId);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b9d9c2b7/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
index ce794b1..048b6c7 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
@@ -1272,4 +1272,19 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager,
Vmw
         // Returning list of VmwareDatacenterVO objects, in-line with future requirements,
if any, like participation of multiple VMware DCs in a zone.
         return vmwareDcList;
     }
+
+    @Override
+    public boolean hasNexusVSM(Long clusterId) {
+        ClusterVSMMapVO vsmMapVo = null;
+
+        vsmMapVo = _vsmMapDao.findByClusterId(clusterId);
+        if (vsmMapVo == null) {
+            s_logger.info("There is no instance of Nexus 1000v VSM associated with this cluster
[Id:" + clusterId + "] yet.");
+            return false;
+        }
+        else {
+            s_logger.info("An instance of Nexus 1000v VSM [Id:" + vsmMapVo.getVsmId() + "]
associated with this cluster [Id:" + clusterId + "]");
+            return true;
+        }
+    }
 }


Mime
View raw message