Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D74F611625 for ; Mon, 18 Aug 2014 08:48:27 +0000 (UTC) Received: (qmail 24110 invoked by uid 500); 18 Aug 2014 08:48:27 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 24081 invoked by uid 500); 18 Aug 2014 08:48:27 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 24072 invoked by uid 99); 18 Aug 2014 08:48:27 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Aug 2014 08:48:27 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 578F39AC8A8; Mon, 18 Aug 2014 08:48:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sateesh@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to a1d0925 Date: Mon, 18 Aug 2014 08:48:27 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/master f099732be -> a1d0925f9 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 Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a1d0925f Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a1d0925f Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a1d0925f Branch: refs/heads/master Commit: a1d0925f902041b187f14413e91bc368f0708753 Parents: f099732 Author: Sateesh Chodapuneedi Authored: Mon Aug 18 07:18:13 2014 +0530 Committer: Sateesh Chodapuneedi Committed: Mon Aug 18 07:18:13 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/a1d0925f/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 0916813..d0d676f 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java @@ -299,15 +299,19 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer 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/a1d0925f/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 27975ee..35e275e 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 @@ -77,4 +77,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/a1d0925f/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 3fd1a9c..3121bfb 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 @@ -1218,4 +1218,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; + } + } }