From 117c8fe5b0e1b9f1045cbf65e3285fbf205770bf Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Thu, 12 Jun 2014 13:54:56 +0530 Subject: [PATCH] CLOUDSTACK-6897: when we try to attach the uploaded/allocated volume to a VM on zwps, then we were passing the podId of VM instead of storage pool to storage allocator. This resulting in use of Clusterscope storage allocator, allocating a storage pool for VM on zwps beacuse of pod id not null. This was resulting in scope conflict later (cherry picked from commit 2dc9e2c530b36efc4c4684e13ae0412103925d05) --- .../cloudstack/engine/orchestration/VolumeOrchestrator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index 064ffca6dbf..b6fecfb6e07 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -724,8 +724,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati public VolumeInfo createVolumeOnPrimaryStorage(VirtualMachine vm, Volume rootVolumeOfVm, VolumeInfo volume, HypervisorType rootDiskHyperType) throws NoTransitionException { VirtualMachineTemplate rootDiskTmplt = _entityMgr.findById(VirtualMachineTemplate.class, vm.getTemplateId()); DataCenter dcVO = _entityMgr.findById(DataCenter.class, vm.getDataCenterId()); - Pod pod = _entityMgr.findById(Pod.class, vm.getPodIdToDeployIn()); StoragePoolVO rootDiskPool = _storagePoolDao.findById(rootVolumeOfVm.getPoolId()); + Pod pod = _entityMgr.findById(Pod.class, rootDiskPool.getPodId()); ServiceOffering svo = _entityMgr.findById(ServiceOffering.class, vm.getServiceOfferingId()); DiskOffering diskVO = _entityMgr.findById(DiskOffering.class, volume.getDiskOfferingId()); Long clusterId = (rootDiskPool == null ? null : rootDiskPool.getClusterId());