use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.BlockMirrorTaskCompleter in project coprhd-controller by CoprHD.
the class BlockDeviceController method establishVolumeNativeContinuousCopyGroupRelation.
public void establishVolumeNativeContinuousCopyGroupRelation(URI storage, URI sourceVolume, URI mirror, String opId) throws ControllerException {
try {
WorkflowStepCompleter.stepExecuting(opId);
StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
TaskCompleter completer = new BlockMirrorTaskCompleter(BlockMirror.class, mirror, opId);
getDevice(storageObj.getSystemType()).doEstablishVolumeNativeContinuousCopyGroupRelation(storageObj, sourceVolume, mirror, completer);
} catch (Exception e) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
WorkflowStepCompleter.stepFailed(opId, serviceError);
}
}
use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.BlockMirrorTaskCompleter in project coprhd-controller by CoprHD.
the class BlockDeviceController method detachNativeContinuousCopies.
@Override
public void detachNativeContinuousCopies(URI storage, List<URI> mirrors, List<URI> promotees, String opId) throws ControllerException {
_log.info("START detach continuous copies workflow");
Workflow workflow = _workflowService.getNewWorkflow(this, DETACH_MIRRORS_WF_NAME, false, opId);
TaskCompleter taskCompleter = null;
try {
addStepsForPromoteMirrors(workflow, null, mirrors, promotees);
// There is a task for the source volume, as well as for each newly promoted volume
List<URI> volumesWithTasks = new ArrayList<URI>(promotees);
volumesWithTasks.addAll(getSourceVolumesFromURIs(mirrors));
taskCompleter = new BlockMirrorTaskCompleter(Volume.class, volumesWithTasks, opId);
ControllerUtils.checkMirrorConsistencyGroup(mirrors, _dbClient, taskCompleter);
workflow.executePlan(taskCompleter, "Successfully detached continuous copies");
} catch (Exception e) {
List<Volume> promotedVolumes = _dbClient.queryObject(Volume.class, promotees);
for (Volume promotedVolume : promotedVolumes) {
promotedVolume.setInactive(true);
}
_dbClient.updateObject(promotedVolumes);
String msg = String.format("Failed to execute detach continuous copies workflow for mirrors: %s", mirrors);
_log.error(msg, e);
}
}
Aggregations