use of com.emc.storageos.volumecontroller.ControllerException 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.volumecontroller.ControllerException in project coprhd-controller by CoprHD.
the class BlockDeviceController method activateSnapshot.
@Override
public void activateSnapshot(URI storage, List<URI> snapshotList, String opId) throws ControllerException {
TaskCompleter completer = null;
try {
StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
completer = new BlockSnapshotActivateCompleter(snapshotList, opId);
getDevice(storageObj.getSystemType()).doActivateSnapshot(storageObj, snapshotList, completer);
} catch (Exception e) {
if (completer != null) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
completer.error(_dbClient, serviceError);
} else {
throw DeviceControllerException.exceptions.activateVolumeSnapshotFailed(e);
}
}
}
use of com.emc.storageos.volumecontroller.ControllerException in project coprhd-controller by CoprHD.
the class BlockDeviceController method resumeNativeContinuousCopies.
@Override
public void resumeNativeContinuousCopies(URI storage, List<URI> mirrors, String opId) throws ControllerException {
_log.info("START resume continuous copies workflow");
Workflow workflow = _workflowService.getNewWorkflow(this, RESUME_MIRRORS_WF_NAME, false, opId);
TaskCompleter taskCompleter = null;
List<BlockMirror> mirrorList = _dbClient.queryObject(BlockMirror.class, mirrors);
StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
List<URI> sourceVolumes = getSourceVolumes(mirrorList);
try {
taskCompleter = new BlockMirrorTaskCompleter(Volume.class, sourceVolumes, opId);
boolean isCG = ControllerUtils.checkMirrorConsistencyGroup(mirrors, _dbClient, taskCompleter);
if (!isCG) {
for (BlockMirror blockMirror : mirrorList) {
if (SynchronizationState.FRACTURED.toString().equals(blockMirror.getSyncState())) {
workflow.createStep("resumeStep", "resume", null, storage, storageObj.getSystemType(), this.getClass(), resumeNativeContinuousCopyMethod(storage, asList(blockMirror.getId()), isCG), null, null);
}
}
} else {
if (hasFracturedState(mirrorList)) {
workflow.createStep("resumeStep", "resume", null, storage, storageObj.getSystemType(), this.getClass(), resumeNativeContinuousCopyMethod(storage, mirrors, isCG), null, null);
}
}
workflow.executePlan(taskCompleter, "Successfully resumed continuous copies");
} catch (Exception e) {
String msg = String.format("Failed to execute resume continuous copies workflow for volume %s", Joiner.on("\t").join(sourceVolumes));
_log.error(msg, e);
if (taskCompleter != null) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
taskCompleter.error(_dbClient, serviceError);
}
}
}
use of com.emc.storageos.volumecontroller.ControllerException in project coprhd-controller by CoprHD.
the class MaskingWorkflowEntryPoints method doExportMaskZoningMapUpdate.
/**
* Zoning map update entry point
*/
public void doExportMaskZoningMapUpdate(URI exportGroupURI, URI storageURI, String token) throws ControllerException {
_log.info("START - doExportMaskZoningMapUpdate");
WorkflowStepCompleter.stepExecuting(token);
try {
ExportGroup eg = _dbClient.queryObject(ExportGroup.class, exportGroupURI);
List<ExportMask> exportMasks = ExportMaskUtils.getExportMasks(_dbClient, eg);
// so fetch the 0th URI
if (!exportMasks.isEmpty()) {
ExportMask mask = exportMasks.get(0);
_blockScheduler.updateZoningMap(mask, eg.getVirtualArray(), exportGroupURI);
}
WorkflowStepCompleter.stepSucceded(token);
} catch (final InternalException e) {
_log.error("Encountered an exception", e);
WorkflowStepCompleter.stepFailed(token, e);
} catch (final Exception e) {
_log.error("Encountered an exception", e);
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
WorkflowStepCompleter.stepFailed(token, serviceError);
}
_log.info("END - doExportMaskZoningMapUpdate");
}
use of com.emc.storageos.volumecontroller.ControllerException in project coprhd-controller by CoprHD.
the class MaskingWorkflowEntryPoints method doExportGroupRemoveVolumes.
public void doExportGroupRemoveVolumes(URI storageURI, URI exportGroupURI, URI exportMaskURI, List<URI> volumeURIs, List<URI> initiatorURIs, TaskCompleter taskCompleter, String token) throws ControllerException {
String call = String.format("doExportGroupRemoveVolumes(%s, %s, %s, [%s], [%s], %s)", storageURI.toString(), exportGroupURI.toString(), exportMaskURI.toString(), volumeURIs != null ? Joiner.on(',').join(volumeURIs) : "No Volumes", initiatorURIs != null ? Joiner.on(',').join(initiatorURIs) : "No Initiators", taskCompleter.getOpId());
try {
WorkflowStepCompleter.stepExecuting(token);
ExportMask exportMask = _dbClient.queryObject(ExportMask.class, exportMaskURI);
StorageSystem storage = _dbClient.queryObject(StorageSystem.class, storageURI);
List<Initiator> initiators = new ArrayList<>();
if (initiatorURIs != null && !initiatorURIs.isEmpty()) {
initiators = _dbClient.queryObject(Initiator.class, initiatorURIs);
}
// Test mechanism to invoke a failure. No-op on production systems.
InvokeTestFailure.internalOnlyInvokeTestFailure(InvokeTestFailure.ARTIFICIAL_FAILURE_017);
getDevice(storage).doExportRemoveVolumes(storage, exportMask, volumeURIs, initiators, taskCompleter);
_log.info(String.format("%s end", call));
} catch (final InternalException e) {
_log.info(call + " Encountered an exception", e);
taskCompleter.error(_dbClient, e);
} catch (final Exception e) {
_log.info(call + " Encountered an exception", e);
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
taskCompleter.error(_dbClient, serviceError);
}
}
Aggregations