Search in sources :

Example 1 with HDSBlockCreateSnapshotJob

use of com.emc.storageos.volumecontroller.impl.hds.prov.job.HDSBlockCreateSnapshotJob in project coprhd-controller by CoprHD.

the class HDSProtectionOperations method createSecondaryVolumeForSnapshot.

/**
 * Creates Snapshot Volume
 *
 * @param storageSystem
 * @param sourceVolume
 * @param snapshotObj
 * @throws Exception
 */
public void createSecondaryVolumeForSnapshot(StorageSystem storageSystem, Volume sourceVolume, BlockSnapshot snapshotObj) throws Exception {
    log.info("SecondaryVolume for snapshot creation operation started");
    String taskId = UUID.randomUUID().toString();
    TaskCompleter taskCompleter = new BlockSnapshotCreateCompleter(Arrays.asList(snapshotObj.getId()), taskId);
    String asyncTaskMessageId = null;
    HDSApiClient hdsApiClient = HDSUtils.getHDSApiClient(hdsApiFactory, storageSystem);
    String systemObjectID = HDSUtils.getSystemObjectID(storageSystem);
    asyncTaskMessageId = hdsApiClient.createSnapshotVolume(systemObjectID, sourceVolume.getCapacity(), storageSystem.getModel());
    if (asyncTaskMessageId != null) {
        HDSJob createHDSJob = new HDSBlockCreateSnapshotJob(asyncTaskMessageId, snapshotObj.getStorageController(), taskCompleter);
        hdsCommandHelper.waitForAsyncHDSJob(createHDSJob);
    } else {
        throw HDSException.exceptions.asyncTaskFailed("Unable to get async taskId from HiCommand Device Manager for the create snapshot volume call");
    }
    log.info("SecondaryVolume for snapshot creation operation completed successfully");
}
Also used : HDSApiClient(com.emc.storageos.hds.api.HDSApiClient) HDSBlockCreateSnapshotJob(com.emc.storageos.volumecontroller.impl.hds.prov.job.HDSBlockCreateSnapshotJob) HDSJob(com.emc.storageos.volumecontroller.impl.hds.prov.job.HDSJob) TaskCompleter(com.emc.storageos.volumecontroller.TaskCompleter) BlockSnapshotCreateCompleter(com.emc.storageos.volumecontroller.impl.block.taskcompleter.BlockSnapshotCreateCompleter)

Aggregations

HDSApiClient (com.emc.storageos.hds.api.HDSApiClient)1 TaskCompleter (com.emc.storageos.volumecontroller.TaskCompleter)1 BlockSnapshotCreateCompleter (com.emc.storageos.volumecontroller.impl.block.taskcompleter.BlockSnapshotCreateCompleter)1 HDSBlockCreateSnapshotJob (com.emc.storageos.volumecontroller.impl.hds.prov.job.HDSBlockCreateSnapshotJob)1 HDSJob (com.emc.storageos.volumecontroller.impl.hds.prov.job.HDSJob)1