Skip to content

Commit c59c736

Browse files
committed
CLOUDSTACK-3545: NPE in listStoragePoolsForMigration api. The volume table no longer holds
the pod id, the column is null now. Made a change to get the pod id from the storage pool on which the volume resides.
1 parent 2f85c80 commit c59c736

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎server/src/com/cloud/server/ManagementServerImpl.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,11 +1254,10 @@ public Pair<List<? extends StoragePool>, List<? extends StoragePool>> listStorag
12541254
// Get all the pools available. Only shared pools are considered because only a volume on a shared pools
12551255
// can be live migrated while the virtual machine stays on the same host.
12561256
List<StoragePoolVO> storagePools = null;
1257-
12581257
if (srcVolumePool.getClusterId() == null) {
12591258
storagePools = _poolDao.findZoneWideStoragePoolsByTags(volume.getDataCenterId(), null);
12601259
} else {
1261-
storagePools = _poolDao.findPoolsByTags(volume.getDataCenterId(), volume.getPodId(), srcVolumePool.getClusterId(), null);
1260+
storagePools = _poolDao.findPoolsByTags(volume.getDataCenterId(), srcVolumePool.getPodId(), srcVolumePool.getClusterId(), null);
12621261
}
12631262

12641263
storagePools.remove(srcVolumePool);
@@ -1274,7 +1273,7 @@ public Pair<List<? extends StoragePool>, List<? extends StoragePool>> listStorag
12741273
avoid.addPool(srcVolumePool.getId());
12751274

12761275
// Volume stays in the same cluster after migration.
1277-
DataCenterDeployment plan = new DataCenterDeployment(volume.getDataCenterId(), volume.getPodId(),
1276+
DataCenterDeployment plan = new DataCenterDeployment(volume.getDataCenterId(), srcVolumePool.getPodId(),
12781277
srcVolumePool.getClusterId(), null, null, null);
12791278
VirtualMachineProfile<VMInstanceVO> profile = new VirtualMachineProfileImpl<VMInstanceVO>(vm);
12801279

0 commit comments

Comments
 (0)