Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Ceph/RBD snapshot delete #3615

Merged
merged 1 commit into from Dec 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -56,9 +56,18 @@ public StrategyPriority canHandle(Snapshot snapshot, SnapshotOperation op) {
return StrategyPriority.CANT_HANDLE;
}

if (SnapshotOperation.REVERT.equals(op) && isSnapshotStoredOnRbdStoragePool(snapshot)) {
if (!isSnapshotStoredOnRbdStoragePool(snapshot)) {
return StrategyPriority.CANT_HANDLE;
}

if (SnapshotOperation.REVERT.equals(op)) {
return StrategyPriority.HIGHEST;
}

if (SnapshotOperation.DELETE.equals(op)) {
return StrategyPriority.HIGHEST;
}

return StrategyPriority.CANT_HANDLE;
}

Expand Down
Expand Up @@ -87,6 +87,8 @@ private void configureAndVerifyCanHandle(Date removed, boolean isSnapshotStoredO
StrategyPriority strategyPriority = cephSnapshotStrategy.canHandle(snapshot, snapshotOps[i]);
if (snapshotOps[i] == SnapshotOperation.REVERT && isSnapshotStoredOnRbdStoragePool) {
Assert.assertEquals(StrategyPriority.HIGHEST, strategyPriority);
} else if (snapshotOps[i] == SnapshotOperation.DELETE && isSnapshotStoredOnRbdStoragePool) {
Assert.assertEquals(StrategyPriority.HIGHEST, strategyPriority);
} else {
Assert.assertEquals(StrategyPriority.CANT_HANDLE, strategyPriority);
}
Expand Down
Expand Up @@ -82,7 +82,7 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
@Override
public Map<String, String> getCapabilities() {
Map<String, String> caps = new HashMap<String, String>();
caps.put(DataStoreCapabilities.VOLUME_SNAPSHOT_QUIESCEVM.toString(), "false");
caps.put(DataStoreCapabilities.VOLUME_SNAPSHOT_QUIESCEVM.toString(), Boolean.FALSE.toString());
return caps;
}

Expand Down