You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2013/08/21 10:04:23 UTC
git commit: updated refs/heads/master to 69adeec
Updated Branches:
refs/heads/master 534e0977c -> 69adeecc3
CLOUDSTACK-4414
Fixing detection of failure in cluster discovery before cleanup vsm device.
Signed-off-by: Sateesh Chodapuneedi <sa...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/69adeecc
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/69adeecc
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/69adeecc
Branch: refs/heads/master
Commit: 69adeecc39a0a2d090e115b67c81f97e7192d2d2
Parents: 534e097
Author: Sateesh Chodapuneedi <sa...@apache.org>
Authored: Wed Aug 21 07:58:13 2013 +0530
Committer: Sateesh Chodapuneedi <sa...@apache.org>
Committed: Wed Aug 21 08:03:52 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/69adeecc/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) {
}