mirror of https://github.com/apache/cloudstack.git
snapshot: fix listSnapshots for volume which got delete and whose storage pool got deleted
This fixes the case when the storage pool is removed as well the KVM host and the subsequent volumes on the host. When that happened, listing snapshots (for recovery purposes) cause NPE as the pool_id was null, but last_pool_id for the related destroyed volume wasn't null. This adds a fallback logic. Signed-off-by: Rohit Yadav <rohit@yadav.cloud>
This commit is contained in:
parent
b1f870ae83
commit
9dd8a4cc40
|
|
@ -951,7 +951,7 @@ public class StorageSystemSnapshotStrategy extends SnapshotStrategyBase {
|
|||
|
||||
VolumeVO volumeVO = volumeDao.findByIdIncludingRemoved(volumeId);
|
||||
|
||||
long volumeStoragePoolId = volumeVO.getPoolId();
|
||||
long volumeStoragePoolId = (volumeVO.getPoolId() != null ? volumeVO.getPoolId() : volumeVO.getLastPoolId());
|
||||
|
||||
if (SnapshotOperation.REVERT.equals(op)) {
|
||||
boolean baseVolumeExists = volumeVO.getRemoved() == null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue