Search in sources :

Example 1 with HDSDeleteSnapshotJob

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);
    }
}
Also used : HDSApiClient(com.emc.storageos.hds.api.HDSApiClient) HDSJob(com.emc.storageos.volumecontroller.impl.hds.prov.job.HDSJob) HDSDeleteSnapshotJob(com.emc.storageos.volumecontroller.impl.hds.prov.job.HDSDeleteSnapshotJob) ServiceCoded(com.emc.storageos.svcs.errorhandling.model.ServiceCoded)

Aggregations

HDSApiClient (com.emc.storageos.hds.api.HDSApiClient)1 ServiceCoded (com.emc.storageos.svcs.errorhandling.model.ServiceCoded)1 HDSDeleteSnapshotJob (com.emc.storageos.volumecontroller.impl.hds.prov.job.HDSDeleteSnapshotJob)1 HDSJob (com.emc.storageos.volumecontroller.impl.hds.prov.job.HDSJob)1