Skip to content

Commit 40f698f

Browse files
author
Vijayendra Bhamidipati
committed
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.
1 parent b91b378 commit 40f698f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

server/src/com/cloud/resource/ResourceManagerImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ public List<? extends Cluster> discoverCluster(AddClusterCmd cmd) throws Illegal
461461
List<ClusterVSMMapVO> clusterList = _clusterVSMDao.listByVSMId(vsm.getId());
462462
if (clusterList != null && !clusterList.isEmpty()) {
463463
s_logger.error("Failed to add cluster: specified Nexus VSM is already associated with another cluster");
464+
_clusterDao.remove(clusterId);
464465
ResourceInUseException ex = new ResourceInUseException("Failed to add cluster: specified Nexus VSM is already associated with another cluster with specified Id");
465466
ex.addProxyObject("cluster", clusterList.get(0).getClusterId(), "clusterId");
466467
throw ex;

0 commit comments

Comments
 (0)