mirror of https://github.com/apache/cloudstack.git
snapshot: fix listSnapshots for volume which got delete and whose storage pool got deleted (#12433)
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
000919d6e5
commit
315cd52fd1
|
|
@ -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