use of com.emc.storageos.svcs.errorhandling.model.ServiceError in project coprhd-controller by CoprHD.
the class BlockDeviceController method detachFullCopy.
@Override
public void detachFullCopy(URI storage, List<URI> fullCopyVolumes, String taskId) throws ControllerException {
_log.info("START detachFullCopy: {}", fullCopyVolumes);
TaskCompleter taskCompleter = new CloneWorkflowCompleter(fullCopyVolumes, taskId);
try {
StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
Workflow workflow = _workflowService.getNewWorkflow(this, DETACH_CLONE_WF_NAME, true, taskId);
_log.info("Created new detach workflow with operation id {}", taskId);
// add CG to taskCompleter
checkCloneConsistencyGroup(fullCopyVolumes.get(0), _dbClient, taskCompleter);
Workflow.Method detachMethod = detachFullCopyMethod(storage, fullCopyVolumes);
workflow.createStep(FULL_COPY_DETACH_STEP_GROUP, "Detaching full copy", null, storage, storageSystem.getSystemType(), getClass(), detachMethod, rollbackMethodNullMethod(), null);
String msg = String.format("Detach %s completed successfully", fullCopyVolumes.get(0));
workflow.executePlan(taskCompleter, msg);
} catch (Exception e) {
String msg = String.format("Could not detach the clone %s", fullCopyVolumes.get(0));
_log.error(msg, e);
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
taskCompleter.error(_dbClient, serviceError);
}
}
use of com.emc.storageos.svcs.errorhandling.model.ServiceError in project coprhd-controller by CoprHD.
the class BlockDeviceController method createStoragePortGroup.
@Override
public void createStoragePortGroup(URI systemURI, URI portGroupURI, String opId) {
TaskCompleter completer = new StoragePortGroupCreateCompleter(portGroupURI, opId);
try {
StorageSystem system = _dbClient.queryObject(StorageSystem.class, systemURI);
WorkflowStepCompleter.stepExecuting(opId);
getDevice(system.getSystemType()).doCreateStoragePortGroup(system, portGroupURI, completer);
} catch (Exception e) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
completer.error(_dbClient, serviceError);
}
}
use of com.emc.storageos.svcs.errorhandling.model.ServiceError in project coprhd-controller by CoprHD.
the class BlockDeviceController method deleteListMirror.
public void deleteListMirror(URI storage, List<URI> mirrorList, String opId) throws ControllerException {
TaskCompleter completer = null;
try {
WorkflowStepCompleter.stepExecuting(opId);
StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
completer = new BlockMirrorDeleteCompleter(mirrorList, opId);
getDevice(storageObj.getSystemType()).doDeleteListReplica(storageObj, mirrorList, completer);
} catch (Exception e) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
if (completer != null) {
completer.error(_dbClient, serviceError);
}
WorkflowStepCompleter.stepFailed(opId, serviceError);
}
}
use of com.emc.storageos.svcs.errorhandling.model.ServiceError in project coprhd-controller by CoprHD.
the class BlockDeviceController method resyncSnapshot.
@Override
public void resyncSnapshot(URI storage, URI volume, URI snapshot, Boolean updateOpStatus, String opId) throws ControllerException {
TaskCompleter completer = null;
try {
StorageSystem storageDevice = _dbClient.queryObject(StorageSystem.class, storage);
BlockSnapshot snapObj = _dbClient.queryObject(BlockSnapshot.class, snapshot);
completer = new BlockSnapshotResyncCompleter(snapObj, opId, updateOpStatus);
getDevice(storageDevice.getSystemType()).doResyncSnapshot(storageDevice, volume, snapshot, completer);
} catch (Exception e) {
_log.error(String.format("resync snapshot failed - storage: %s, volume: %s, snapshot: %s", storage.toString(), volume.toString(), snapshot.toString()));
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
completer.error(_dbClient, serviceError);
doFailTask(BlockSnapshot.class, snapshot, opId, serviceError);
WorkflowStepCompleter.stepFailed(opId, serviceError);
}
}
use of com.emc.storageos.svcs.errorhandling.model.ServiceError in project coprhd-controller by CoprHD.
the class BlockDeviceController method deleteMirror.
/**
* {@inheritDoc} NOTE NOTE: The signature here MUST match the Workflow.Method deleteMirrorMethod just above (except
* opId).
*/
@Override
public void deleteMirror(URI storage, List<URI> mirrorList, Boolean isCG, String opId) throws ControllerException {
TaskCompleter completer = null;
try {
WorkflowStepCompleter.stepExecuting(opId);
StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
completer = new BlockMirrorDeleteCompleter(mirrorList, opId);
if (!isCG) {
getDevice(storageObj.getSystemType()).doDeleteMirror(storageObj, mirrorList.get(0), completer);
} else {
getDevice(storageObj.getSystemType()).doDeleteGroupMirrors(storageObj, mirrorList, completer);
}
} catch (Exception e) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
if (completer != null) {
completer.error(_dbClient, serviceError);
}
WorkflowStepCompleter.stepFailed(opId, serviceError);
}
}
Aggregations