bug 9615: Part of the HA cleanup

This commit is contained in:
Alex Huang 2011-05-03 16:34:11 -07:00
parent dfd5d943cc
commit fba1c95512
5 changed files with 14 additions and 9 deletions

View File

@ -101,7 +101,6 @@ public class Commands implements Iterable<Command> {
}
public void setAnswers(Answer[] answers) {
assert answers.length == _cmds.size() : "We didn't get back the same number of answers as commands sent";
_answers = answers;
}

View File

@ -151,7 +151,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
Pair<Host, Map<Volume, StoragePool>> potentialResources = findPotentialDeploymentResources(suitableHosts, suitableVolumeStoragePools);
if(potentialResources != null){
Pod pod = _podDao.findById(vm.getPodId());
Pod pod = _podDao.findById(host.getPodId());
Cluster cluster = _clusterDao.findById(host.getClusterId());
Map<Volume, StoragePool> storageVolMap = potentialResources.second();
// remove the reused vol<->pool from destination, since we don't have to prepare this volume.
@ -192,7 +192,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
Pair<Host, Map<Volume, StoragePool>> potentialResources = findPotentialDeploymentResources(suitableHosts, suitableVolumeStoragePools);
if(potentialResources != null){
Pod pod = _podDao.findById(vm.getPodId());
Pod pod = _podDao.findById(host.getPodId());
Cluster cluster = _clusterDao.findById(host.getClusterId());
Map<Volume, StoragePool> storageVolMap = potentialResources.second();
// remove the reused vol<->pool from destination, since we don't have to prepare this volume.

View File

@ -1439,7 +1439,10 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
// Check if all networks are implemented for the domR; if not - implement them
DataCenter dc = _dcDao.findById(router.getDataCenterId());
HostPodVO pod = _podDao.findById(router.getPodId());
HostPodVO pod = null;
if (router.getPodId() != null) {
pod = _podDao.findById(router.getPodId());
}
DeployDestination dest = new DeployDestination(dc, pod, null, null);
ReservationContext context = new ReservationContextImpl(null, null, caller, owner);

View File

@ -648,7 +648,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
cmds.addCommand(new StartCommand(vmTO));
vmGuru.finalizeDeployment(cmds, vmProfile, dest, ctx);
// vm.setPodId(dest.getPod().getId());
vm.setPodId(dest.getPod().getId());
work = _workDao.findById(work.getId());
if (work == null || work.getStep() != Step.Prepare) {

View File

@ -736,10 +736,13 @@ public class ComponentLocator implements ComponentLocatorMBean {
Map<String, String> env = System.getenv();
String configFile = env.get("cloud-stack-components-specification");
if (configFile == null || PropertiesUtil.findConfigFile(configFile) == null) {
configFile = "components-premium.xml";
if (PropertiesUtil.findConfigFile(configFile) == null){
configFile = "components.xml";
}
configFile = env.get("cloud_stack_components_specification");
if (configFile == null || PropertiesUtil.findConfigFile(configFile) == null) {
configFile = "components-premium.xml";
if (PropertiesUtil.findConfigFile(configFile) == null){
configFile = "components.xml";
}
}
}
return getLocatorInternal(server, true, configFile, "log4j-cloud");
}