[
https://issues.apache.org/jira/browse/CLOUDSTACK-9297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15176027#comment-15176027
]
Mike Tutkowski commented on CLOUDSTACK-9297:
--------------------------------------------
This is what I think we should change the code to (starting in 4.6 and going
through 4.9).
Context reminder: This SnapshotStrategy is only intended to be used with volume
snapshots that reside on primary storage (not our traditional volume snapshots).
This SnapshotStrategy should not handle any reverts.
We should try to get the storage pool ID from the cloud.snapshot_store_ref
table using the ID of the snapshot and the store_role of "PRIMARY".
In the situation of this issue, null would be assigned to snapshotStore and we
would defer deletion to another SnapshotStrategy.
@Override
public StrategyPriority canHandle(Snapshot snapshot, SnapshotOperation op) {
if (SnapshotOperation.REVERT.equals(op)) {
return StrategyPriority.CANT_HANDLE;
}
final long storagePoolId;
SnapshotDataStoreVO snapshotStore =
_snapshotStoreDao.findBySnapshot(snapshot.getId(), DataStoreRole.Primary);
if (snapshotStore != null) {
storagePoolId = snapshotStore.getDataStoreId();
}
else {
return StrategyPriority.CANT_HANDLE;
}
DataStore dataStore = _dataStoreMgr.getDataStore(storagePoolId,
DataStoreRole.Primary);
Map<String, String> mapCapabilities =
dataStore.getDriver().getCapabilities();
if (mapCapabilities != null) {
String value =
mapCapabilities.get(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString());
Boolean supportsStorageSystemSnapshots = new Boolean(value);
if (supportsStorageSystemSnapshots) {
return StrategyPriority.HIGHEST;
}
}
return StrategyPriority.CANT_HANDLE;
}
> delete snapshot without id is failing with Unable to determine the storage
> pool of the snapshot
> -----------------------------------------------------------------------------------------------
>
> Key: CLOUDSTACK-9297
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9297
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: API
> Affects Versions: 4.8.0
> Environment: Ubuntu 14.04.3 management + kvm
> Reporter: Özhan Rüzgar Karaman
> Assignee: Mike Tutkowski
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)