From 2e8b8928afdbe1acb349aa0d4e769a3e80634fa8 Mon Sep 17 00:00:00 2001 From: henko holtzhausen Date: Thu, 1 Feb 2018 13:12:45 +0200 Subject: [PATCH] CLOUDSTACK-10147 Disabled Xenserver Cluster can still deploy VM's. Added code to skip disabled clusters when selecting a host --- .../java/com/cloud/deploy/DeploymentPlanningManagerImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java index cc244ce41ba8..5d8ad0a7051e 100644 --- a/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java +++ b/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java @@ -1040,6 +1040,11 @@ private DeployDestination checkClustersforDestination(List clusterList, Vi for (Long clusterId : clusterList) { ClusterVO clusterVO = _clusterDao.findById(clusterId); + if (clusterVO.getAllocationState() == Grouping.AllocationState.Disabled) { + s_logger.debug("Cannot deploy in disabled cluster " + clusterId + ", skipping this cluster"); + avoid.addCluster(clusterVO.getId()); + } + if (clusterVO.getHypervisorType() != vmProfile.getHypervisorType()) { s_logger.debug("Cluster: " + clusterId + " has HyperVisorType that does not match the VM, skipping this cluster"); avoid.addCluster(clusterVO.getId());