use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowEntryPoints method exportRemovePathsStep.
public void exportRemovePathsStep(URI storageURI, URI exportGroupURI, URI varray, URI exportMaskURI, Map<URI, List<URI>> adjustedPaths, Map<URI, List<URI>> removePaths, String token) throws ControllerException {
try {
WorkflowStepCompleter.stepExecuting(token);
final String workflowKey = "removePaths";
if (!WorkflowService.getInstance().hasWorkflowBeenCreated(token, workflowKey)) {
DiscoveredSystemObject storage = ExportWorkflowUtils.getStorageSystem(_dbClient, storageURI);
MaskingOrchestrator orchestrator = getOrchestrator(storage.getSystemType());
orchestrator.portRebalance(storageURI, exportGroupURI, varray, exportMaskURI, adjustedPaths, removePaths, false, token);
// Mark this workflow as created/executed so we don't do it again on retry/resume
WorkflowService.getInstance().markWorkflowBeenCreated(token, workflowKey);
} else {
_log.info("Sub-workflow for exportRemovePathsStep was already created");
}
} catch (Exception e) {
DeviceControllerException exception = DeviceControllerException.exceptions.exportGroupPortRebalanceError(e);
WorkflowStepCompleter.stepFailed(token, exception);
}
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowEntryPoints method exportAddInitiators.
public void exportAddInitiators(URI storageURI, URI exportGroupURI, List<URI> initiatorURIs, String token) throws ControllerException {
try {
WorkflowStepCompleter.stepExecuting(token);
final String workflowKey = "exportAddInitiators";
if (!WorkflowService.getInstance().hasWorkflowBeenCreated(token, workflowKey)) {
DiscoveredSystemObject storage = ExportWorkflowUtils.getStorageSystem(_dbClient, storageURI);
MaskingOrchestrator orchestrator = getOrchestrator(storage.getSystemType());
orchestrator.exportGroupAddInitiators(storageURI, exportGroupURI, initiatorURIs, token);
// Mark this workflow as created/executed so we don't do it again on retry/resume
WorkflowService.getInstance().markWorkflowBeenCreated(token, workflowKey);
}
} catch (Exception e) {
DeviceControllerException exception = DeviceControllerException.exceptions.exportAddInitiators(e);
WorkflowStepCompleter.stepFailed(token, exception);
throw exception;
}
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowEntryPoints method exportGroupChangePathParams.
/**
* Changes the PathParams (e.g. maxPaths, pathsPerInitiator) for a volume in all the
* ExportMasks containing that volume in an Export Group.
*
* @param storageURI
* -- URI of storage system containing the volume.
* @param exportGroupURI
* -- URI of Export Group to be processed.
* @param volumeURI
* -- URI of volume that is chaning VPool parameters for PathParams
* @param token
* -- String for completers.
* @throws ControllerException
*/
public void exportGroupChangePathParams(URI storageURI, URI exportGroupURI, URI volumeURI, String token) throws ControllerException {
try {
WorkflowStepCompleter.stepExecuting(token);
final String workflowKey = "exportChangeParams";
if (!WorkflowService.getInstance().hasWorkflowBeenCreated(token, workflowKey)) {
DiscoveredSystemObject storage = ExportWorkflowUtils.getStorageSystem(_dbClient, storageURI);
MaskingOrchestrator orchestrator = getOrchestrator(storage.getSystemType());
orchestrator.exportGroupChangePathParams(storageURI, exportGroupURI, volumeURI, token);
// Mark this workflow as created/executed so we don't do it again on retry/resume
WorkflowService.getInstance().markWorkflowBeenCreated(token, workflowKey);
}
} catch (Exception e) {
DeviceControllerException exception = DeviceControllerException.exceptions.exportGroupChangePathParams(e);
WorkflowStepCompleter.stepFailed(token, exception);
}
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowEntryPoints method exportChangePortGroup.
public void exportChangePortGroup(URI storageURI, URI exportGroupURI, URI portGroupURI, List<URI> exportMaskURIs, boolean waitForApproval, String token) {
try {
WorkflowStepCompleter.stepExecuting(token);
final String workflowKey = "exportChangePortGroup";
if (!WorkflowService.getInstance().hasWorkflowBeenCreated(token, workflowKey)) {
DiscoveredSystemObject storage = ExportWorkflowUtils.getStorageSystem(_dbClient, storageURI);
MaskingOrchestrator orchestrator = getOrchestrator(storage.getSystemType());
orchestrator.changePortGroup(storageURI, exportGroupURI, portGroupURI, exportMaskURIs, waitForApproval, token);
// Mark this workflow as created/executed so we don't do it again on retry/resume
WorkflowService.getInstance().markWorkflowBeenCreated(token, workflowKey);
} else {
_log.info("Workflow for exportChangePortGroup is already created");
}
} catch (Exception e) {
DeviceControllerException exception = DeviceControllerException.exceptions.exportGroupChangePortGroupError(e);
WorkflowStepCompleter.stepFailed(token, exception);
}
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowUtils method generateExportGroupAddVolumes.
public String generateExportGroupAddVolumes(Workflow workflow, String wfGroupId, String waitFor, URI storage, URI export, Map<URI, Integer> volumeMap) throws WorkflowException {
DiscoveredSystemObject storageSystem = getStorageSystem(_dbClient, storage);
Workflow.Method rollback = rollbackMethodNullMethod();
if (export != null) {
ExportGroup exportGroup = _dbClient.queryObject(ExportGroup.class, export);
// with RP+VPlex. This allows the RP orchestration sub-workflow to rollback correctly.
if (DiscoveredDataObject.Type.vplex.name().equals(storageSystem.getSystemType()) && exportGroup.checkInternalFlags(Flag.RECOVERPOINT)) {
List<URI> volumeList = new ArrayList<URI>();
volumeList.addAll(volumeMap.keySet());
rollback = ExportWorkflowEntryPoints.exportRemoveVolumesMethod(storage, export, volumeList);
}
}
Workflow.Method method = ExportWorkflowEntryPoints.exportAddVolumesMethod(storage, export, volumeMap);
return newWorkflowStep(workflow, wfGroupId, String.format("Adding volumes to export (%s) on storage array %s", export, storageSystem.getNativeGuid()), storageSystem, method, rollback, waitFor, null);
}
Aggregations