Skip to content

Commit b66ee30

Browse files
Prachi Damlechipchilders
authored andcommitted
CLOUDSTACK-1706 Failed to deploy VM with error "cannot find DeployPlannerSelector"
Changes: - Regular plugin/adapter components should usually be loaded at run level RUNLEVEL_COMPONENT(5) - HypervisorVmPlannerSelector was at level 0, while configurationServer at level 2 - causing config to be not loaded for the HypervisorVmPlannerSelector
1 parent 67d8798 commit b66ee30

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎server/src/com/cloud/deploy/HypervisorVmPlannerSelector.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818

1919
import javax.ejb.Local;
2020

21+
import org.apache.log4j.Logger;
22+
2123
import com.cloud.deploy.DeploymentPlanner.AllocationAlgorithm;
2224
import com.cloud.hypervisor.Hypervisor.HypervisorType;
2325
import com.cloud.vm.UserVmVO;
2426

2527
@Local(value = {DeployPlannerSelector.class})
2628
public class HypervisorVmPlannerSelector extends AbstractDeployPlannerSelector {
29+
private static final Logger s_logger = Logger.getLogger(HypervisorVmPlannerSelector.class);
30+
2731
@Override
2832
public String selectPlanner(UserVmVO vm) {
2933
if (vm.getHypervisorType() != HypervisorType.BareMetal) {
@@ -38,6 +42,10 @@ public String selectPlanner(UserVmVO vm) {
3842
|| _allocationAlgorithm.equals(AllocationAlgorithm.userconcentratedpod_firstfit.toString())) {
3943
return "UserConcentratedPodPlanner";
4044
}
45+
} else {
46+
if (s_logger.isDebugEnabled()) {
47+
s_logger.debug("The allocation algorithm is null, cannot select the planner");
48+
}
4149
}
4250
}
4351

‎utils/src/com/cloud/utils/component/AdapterBase.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
public class AdapterBase extends ComponentLifecycleBase implements Adapter {
2323

2424
public AdapterBase() {
25+
// set default run level for adapter components
26+
setRunLevel(ComponentLifecycle.RUN_LEVEL_COMPONENT);
2527
}
26-
28+
2729
public static <T extends Adapter> T getAdapterByName(List<T> adapters, String name) {
2830
for(T adapter : adapters) {
2931
if(adapter.getName() != null && adapter.getName().equalsIgnoreCase(name))

0 commit comments

Comments
 (0)