use of com.emc.storageos.volumecontroller.impl.hds.prov.job.HDSDeleteSnapshotJob in project coprhd-controller by CoprHD.
the class HDSProtectionOperations method deleteSecondaryVolumeSnapshot.
public void deleteSecondaryVolumeSnapshot(StorageSystem storageSystem, BlockSnapshot snapshotObj, TaskCompleter taskCompleter) throws Exception {
log.info("Snapshot deletion operation started");
String asyncTaskMessageId = null;
HDSApiClient hdsApiClient = HDSUtils.getHDSApiClient(hdsApiFactory, storageSystem);
String systemObjectID = HDSUtils.getSystemObjectID(storageSystem);
String logicalUnitObjId = HDSUtils.getLogicalUnitObjectId(snapshotObj.getNativeId(), storageSystem);
asyncTaskMessageId = hdsApiClient.deleteSnapshotVolume(systemObjectID, logicalUnitObjId, storageSystem.getModel());
if (null != asyncTaskMessageId) {
HDSJob deleteSnapshotJob = new HDSDeleteSnapshotJob(asyncTaskMessageId, snapshotObj.getStorageController(), taskCompleter);
hdsCommandHelper.waitForAsyncHDSJob(deleteSnapshotJob);
log.info("Snapshot deletion operation completed successfully");
} else {
// This path should never be taken as the HDS client should always return
// the asynchronous task id. If it does not, this will be treated as an
// error.
log.error("Unexpected null asynchronous task id from HDS client call to delete volume snapshot.");
ServiceCoded sc = DeviceControllerExceptions.hds.nullAsyncTaskIdForDeleteSnapshot(snapshotObj.forDisplay());
taskCompleter.error(dbClient, sc);
}
}
Aggregations