mirror of https://github.com/apache/cloudstack.git
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.
This commit is contained in:
parent
26945718e7
commit
0e26608458
|
|
@ -445,6 +445,7 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
|
|||
List<ClusterVSMMapVO> 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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue