Fix vm.getPodId issue

This commit is contained in:
Frank 2011-06-01 19:04:27 -07:00
parent 6618440202
commit 741a19c944
2 changed files with 2 additions and 2 deletions

View File

@ -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

@ -1268,12 +1268,12 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
T rebootedVm = null;
DataCenter dc = _configMgr.getZone(vm.getDataCenterId());
HostPodVO pod = _configMgr.getPod(vm.getPodId());
Host host = _hostDao.findById(vm.getHostId());
Cluster cluster = null;
if (host != null) {
cluster = _configMgr.getCluster(host.getClusterId());
}
HostPodVO pod = _configMgr.getPod(host.getPodId());
DeployDestination dest = new DeployDestination(dc, pod, cluster, host);
try {