From 0e266084584b774ba711a596c1d10a41c02eea5a Mon Sep 17 00:00:00 2001 From: Vijayendra Bhamidipati Date: Thu, 31 May 2012 23:45:40 -0700 Subject: [PATCH] CS-15173: Additional Cluster is allowed to add with the same VSM IPaddress as the previous cluster reviewed-by: Sateesh Description: Missed deletion of cluster record in case of failure in validation of vsm:cluster mapping restriction. --- server/src/com/cloud/resource/ResourceManagerImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java index 2c331fe0075..a147ddc2f94 100755 --- a/server/src/com/cloud/resource/ResourceManagerImpl.java +++ b/server/src/com/cloud/resource/ResourceManagerImpl.java @@ -445,6 +445,7 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma List clusterList = _clusterVSMDao.listByVSMId(vsm.getId()); if (clusterList != null && !clusterList.isEmpty()) { s_logger.error("Failed to add cluster: specified Nexus VSM is already associated with another cluster"); + _clusterDao.remove(clusterId); ResourceInUseException ex = new ResourceInUseException("Failed to add cluster: specified Nexus VSM is already associated with another cluster with specified Id"); ex.addProxyObject("cluster", clusterList.get(0).getClusterId(), "clusterId"); throw ex;