diff --git a/server/src/com/cloud/deploy/FirstFitPlanner.java b/server/src/com/cloud/deploy/FirstFitPlanner.java index e37673d91f3..88c2bed0160 100644 --- a/server/src/com/cloud/deploy/FirstFitPlanner.java +++ b/server/src/com/cloud/deploy/FirstFitPlanner.java @@ -192,7 +192,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner { Pair> 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 storageVolMap = potentialResources.second(); // remove the reused vol<->pool from destination, since we don't have to prepare this volume. diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java index a9a5a3e0ea7..f3946e6856c 100755 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -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 {