mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-9538: FIX failure in Deleting Snapshot From Primary Storage RBD Storage if vm has been removed
This commit is contained in:
parent
2ebf949285
commit
784c33585f
@ -268,7 +268,9 @@ public class XenserverSnapshotStrategy extends SnapshotStrategyBase {
|
|||||||
SnapshotDataStoreVO snapshotOnPrimary = snapshotStoreDao.findBySnapshot(snapshotId, DataStoreRole.Primary);
|
SnapshotDataStoreVO snapshotOnPrimary = snapshotStoreDao.findBySnapshot(snapshotId, DataStoreRole.Primary);
|
||||||
if (snapshotOnPrimary != null) {
|
if (snapshotOnPrimary != null) {
|
||||||
SnapshotInfo snapshotOnPrimaryInfo = snapshotDataFactory.getSnapshot(snapshotId, DataStoreRole.Primary);
|
SnapshotInfo snapshotOnPrimaryInfo = snapshotDataFactory.getSnapshot(snapshotId, DataStoreRole.Primary);
|
||||||
if (((PrimaryDataStoreImpl)snapshotOnPrimaryInfo.getDataStore()).getPoolType() == StoragePoolType.RBD) {
|
long volumeId = snapshotOnPrimary.getVolumeId();
|
||||||
|
VolumeVO volumeVO = volumeDao.findById(volumeId);
|
||||||
|
if (((PrimaryDataStoreImpl)snapshotOnPrimaryInfo.getDataStore()).getPoolType() == StoragePoolType.RBD && volumeVO != null) {
|
||||||
snapshotSvr.deleteSnapshot(snapshotOnPrimaryInfo);
|
snapshotSvr.deleteSnapshot(snapshotOnPrimaryInfo);
|
||||||
}
|
}
|
||||||
snapshotOnPrimary.setState(State.Destroyed);
|
snapshotOnPrimary.setState(State.Destroyed);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user