use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.CloneTaskCompleter in project coprhd-controller by CoprHD.
the class BlockDeviceController method establishVolumeFullCopyGroupRelation.
public void establishVolumeFullCopyGroupRelation(URI storage, URI sourceVolume, URI fullCopy, String opId) throws ControllerException {
try {
WorkflowStepCompleter.stepExecuting(opId);
StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
TaskCompleter completer = new CloneTaskCompleter(fullCopy, opId);
getDevice(storageObj.getSystemType()).doEstablishVolumeFullCopyGroupRelation(storageObj, sourceVolume, fullCopy, completer);
} catch (Exception e) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
WorkflowStepCompleter.stepFailed(opId, serviceError);
}
}
use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.CloneTaskCompleter in project coprhd-controller by CoprHD.
the class VPlexDeviceController method establishVolumeAndFullCopyGroupRelation.
@Override
public void establishVolumeAndFullCopyGroupRelation(URI storage, URI sourceVolume, URI fullCopy, String opId) throws InternalException {
try {
// Generate the Workflow.
Workflow workflow = _workflowService.getNewWorkflow(this, VOLUME_FULLCOPY_GROUP_RELATION_WF, false, opId);
_log.info("Created establish volume and full copy group relation workflow with operation id {}", opId);
// Get the VPLEX and backend full copy volumes.
Volume fullCopyVolume = getDataObject(Volume.class, fullCopy, _dbClient);
Volume nativeFullCopyVolume = VPlexUtil.getVPLEXBackendVolume(fullCopyVolume, true, _dbClient);
URI nativeSourceVolumeURI = nativeFullCopyVolume.getAssociatedSourceVolume();
URI nativeSystemURI = nativeFullCopyVolume.getStorageController();
StorageSystem nativeSystem = getDataObject(StorageSystem.class, nativeSystemURI, _dbClient);
Workflow.Method establishRelationMethod = new Workflow.Method(VOLUME_FULLCOPY_RELATION_METHOD, nativeSystemURI, nativeSourceVolumeURI, nativeFullCopyVolume.getId());
workflow.createStep(VOLUME_FULLCOPY_GROUP_RELATION_STEP, "create group relation between Volume group and Full copy group", null, nativeSystemURI, nativeSystem.getSystemType(), BlockDeviceController.class, establishRelationMethod, rollbackMethodNullMethod(), null);
TaskCompleter completer = new CloneTaskCompleter(fullCopy, opId);
String successMsg = String.format("Establish volume and full copy %s group relation completed successfully", fullCopy);
FullCopyOperationCompleteCallback wfCompleteCB = new FullCopyOperationCompleteCallback();
workflow.executePlan(completer, successMsg, wfCompleteCB, new Object[] { Arrays.asList(fullCopy) }, null, null);
_log.info("Workflow plan executing");
} catch (Exception e) {
String failMsg = String.format("Establish volume and full copy %s group relation failed", fullCopy);
_log.error(failMsg, e);
TaskCompleter completer = new CloneTaskCompleter(fullCopy, opId);
ServiceCoded sc = VPlexApiException.exceptions.establishVolumeFullCopyGroupRelationFailed(fullCopy.toString(), e);
failStep(completer, opId, sc);
}
}
use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.CloneTaskCompleter in project coprhd-controller by CoprHD.
the class BlockDeviceController method establishVolumeAndFullCopyGroupRelation.
@Override
public void establishVolumeAndFullCopyGroupRelation(URI storage, URI sourceVolume, URI fullCopy, String opId) throws ControllerException {
_log.info("START establishVolumeAndFullCopyGroupRelation workflow");
Workflow workflow = _workflowService.getNewWorkflow(this, ESTABLISH_VOLUME_FULL_COPY_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 Full copy group", null, storage, storageObj.getSystemType(), this.getClass(), establishVolumeAndFullCopyGroupRelationMethod(storage, sourceVolume, fullCopy), null, null);
taskCompleter = new CloneTaskCompleter(fullCopy, opId);
workflow.executePlan(taskCompleter, "Successfully created group relation between Volume group and Full copy group");
} catch (Exception e) {
String msg = String.format("Failed to create group relation between Volume group and Full copy group." + "Source volume: %s, Full copy: %s", sourceVolume, fullCopy);
_log.error(msg, e);
if (taskCompleter != null) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
taskCompleter.error(_dbClient, serviceError);
}
}
}
Aggregations