Skip to content

Commit cb170d6

Browse files
committed
CLOUDSTACK-4627: fix NPE in vm migration
1 parent 37c87a8 commit cb170d6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎server/src/com/cloud/storage/VolumeManagerImpl.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2657,7 +2657,8 @@ private boolean stateTransitTo(Volume vol, Volume.Event event)
26572657
public boolean canVmRestartOnAnotherServer(long vmId) {
26582658
List<VolumeVO> vols = _volsDao.findCreatedByInstance(vmId);
26592659
for (VolumeVO vol : vols) {
2660-
if (!vol.isRecreatable() && !vol.getPoolType().isShared()) {
2660+
StoragePoolVO storagePoolVO = _storagePoolDao.findById(vol.getPoolId());
2661+
if (!vol.isRecreatable() && storagePoolVO != null && storagePoolVO.getPoolType() != null && !(storagePoolVO.getPoolType().isShared())) {
26612662
return false;
26622663
}
26632664
}

0 commit comments

Comments
 (0)