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 362F410549 for ; Wed, 21 Aug 2013 08:00:15 +0000 (UTC) Received: (qmail 44708 invoked by uid 500); 21 Aug 2013 08:00:15 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 44692 invoked by uid 500); 21 Aug 2013 08:00:13 -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 44682 invoked by uid 99); 21 Aug 2013 08:00:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Aug 2013 08:00:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C3D0C8C15B8; Wed, 21 Aug 2013 08:00:11 +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: <1795a4be404446a8ab76143a1599e03b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.2 to 9d49fe8 Date: Wed, 21 Aug 2013 08:00:11 +0000 (UTC) Updated Branches: refs/heads/4.2 013f97461 -> 9d49fe8c0 CLOUDSTACK-4414 Fixing detection of failure in cluster discovery before cleanup vsm device. 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/9d49fe8c Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9d49fe8c Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9d49fe8c Branch: refs/heads/4.2 Commit: 9d49fe8c0fb12324d2f132301983105b4b3dd7bc Parents: 013f974 Author: Sateesh Chodapuneedi Authored: Wed Aug 21 07:58:13 2013 +0530 Committer: Sateesh Chodapuneedi Committed: Wed Aug 21 07:58:13 2013 +0530 ---------------------------------------------------------------------- .../cloud/hypervisor/vmware/VmwareServerDiscoverer.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9d49fe8c/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 8a405fb..fd7b3b4 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java @@ -136,7 +136,8 @@ public class VmwareServerDiscoverer extends DiscovererBase implements s_logger.info("No pod is assigned, assuming that it is not for vmware and skip it to next discoverer"); return null; } - + boolean failureInClusterDiscovery = true; + String vsmIp = ""; ClusterVO cluster = _clusterDao.findById(clusterId); if(cluster == null || cluster.getHypervisorType() != HypervisorType.VMware) { if(s_logger.isInfoEnabled()) @@ -308,7 +309,7 @@ public class VmwareServerDiscoverer extends DiscovererBase implements if (guestTrafficLabel != null) { s_logger.info("Detected guest network label : " + guestTrafficLabel); } - String vsmIp = _urlParams.get("vsmipaddress"); + vsmIp = _urlParams.get("vsmipaddress"); String vsmUser = _urlParams.get("vsmusername"); String vsmPassword = _urlParams.get("vsmpassword"); String clusterName = cluster.getName(); @@ -428,7 +429,8 @@ public class VmwareServerDiscoverer extends DiscovererBase implements cluster.setGuid(UUID.nameUUIDFromBytes( String.valueOf(clusterId).getBytes()).toString()); _clusterDao.update(clusterId, cluster); - + // Flag cluster discovery success + failureInClusterDiscovery = false; return resources; } catch (DiscoveredWithErrorException e) { throw e; @@ -439,8 +441,9 @@ public class VmwareServerDiscoverer extends DiscovererBase implements } finally { if (context != null) context.close(); - if (vsmInfo.first()) { + if (failureInClusterDiscovery && vsmInfo.first()) { try { + s_logger.debug("Deleting Nexus 1000v VSM " + vsmIp + " because cluster discovery and addition to zone has failed."); _nexusElement.deleteCiscoNexusVSM(vsmInfo.second().longValue()); } catch(Exception e) { }