use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.BlockSnapshotEstablishGroupTaskCompleter in project coprhd-controller by CoprHD.
the class BlockDeviceController method establishVolumeSnapshotGroupRelation.
public void establishVolumeSnapshotGroupRelation(URI storage, URI sourceVolume, URI snapshot, String opId) throws ControllerException {
try {
WorkflowStepCompleter.stepExecuting(opId);
StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
TaskCompleter completer = new BlockSnapshotEstablishGroupTaskCompleter(snapshot, opId);
getDevice(storageObj.getSystemType()).doEstablishVolumeSnapshotGroupRelation(storageObj, sourceVolume, snapshot, completer);
} catch (Exception e) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
WorkflowStepCompleter.stepFailed(opId, serviceError);
}
}
use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.BlockSnapshotEstablishGroupTaskCompleter in project coprhd-controller by CoprHD.
the class BlockDeviceController method establishVolumeAndSnapshotGroupRelation.
@Override
public void establishVolumeAndSnapshotGroupRelation(URI storage, URI sourceVolume, URI snapshot, String opId) throws ControllerException {
_log.info("START establishVolumeAndSnapshotGroupRelation workflow");
Workflow workflow = _workflowService.getNewWorkflow(this, ESTABLISH_VOLUME_SNAPSHOT_GROUP_WF_NAME, false, opId);
TaskCompleter taskCompleter = null;
StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
try {
workflow.createStep("establishStep", "create group relation between Volume group and Snapshot group", null, storage, storageObj.getSystemType(), this.getClass(), establishVolumeAndSnapshotGroupRelationMethod(storage, sourceVolume, snapshot), null, null);
taskCompleter = new BlockSnapshotEstablishGroupTaskCompleter(snapshot, opId);
workflow.executePlan(taskCompleter, "Successfully created group relation between Volume group and Snapshot group");
} catch (Exception e) {
String msg = String.format("Failed to create group relation between Volume group and Snapshot group." + "Source volume: %s, Snapshot: %s", sourceVolume, snapshot);
_log.error(msg, e);
if (taskCompleter != null) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
taskCompleter.error(_dbClient, serviceError);
}
}
}
Aggregations