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
This commit is contained in:
Prachi Damle 2013-03-18 12:03:57 -07:00
parent 2b05f546b7
commit d9b85e397d
2 changed files with 11 additions and 1 deletions

View File

@ -18,12 +18,16 @@ package com.cloud.deploy;
import javax.ejb.Local;
import org.apache.log4j.Logger;
import com.cloud.deploy.DeploymentPlanner.AllocationAlgorithm;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.vm.UserVmVO;
@Local(value = {DeployPlannerSelector.class})
public class HypervisorVmPlannerSelector extends AbstractDeployPlannerSelector {
private static final Logger s_logger = Logger.getLogger(HypervisorVmPlannerSelector.class);
@Override
public String selectPlanner(UserVmVO vm) {
if (vm.getHypervisorType() != HypervisorType.BareMetal) {
@ -38,6 +42,10 @@ public class HypervisorVmPlannerSelector extends AbstractDeployPlannerSelector {
|| _allocationAlgorithm.equals(AllocationAlgorithm.userconcentratedpod_firstfit.toString())) {
return "UserConcentratedPodPlanner";
}
} else {
if (s_logger.isDebugEnabled()) {
s_logger.debug("The allocation algorithm is null, cannot select the planner");
}
}
}

View File

@ -22,8 +22,10 @@ import java.util.List;
public class AdapterBase extends ComponentLifecycleBase implements Adapter {
public AdapterBase() {
// set default run level for adapter components
setRunLevel(ComponentLifecycle.RUN_LEVEL_COMPONENT);
}
public static <T extends Adapter> T getAdapterByName(List<T> adapters, String name) {
for(T adapter : adapters) {
if(adapter.getName() != null && adapter.getName().equalsIgnoreCase(name))