use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowEntryPoints method exportAddVolumes.
public void exportAddVolumes(URI storageURI, URI exportGroupURI, Map<URI, Integer> volumeMap, String token) throws ControllerException {
try {
WorkflowStepCompleter.stepExecuting(token);
final String workflowKey = "exportAddVolumes";
if (!WorkflowService.getInstance().hasWorkflowBeenCreated(token, workflowKey)) {
DiscoveredSystemObject storage = ExportWorkflowUtils.getStorageSystem(_dbClient, storageURI);
MaskingOrchestrator orchestrator = getOrchestrator(storage.getSystemType());
orchestrator.exportGroupAddVolumes(storageURI, exportGroupURI, volumeMap, 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.exportAddVolumes(e);
WorkflowStepCompleter.stepFailed(token, exception);
throw exception;
}
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowUtils method generateExportGroupRemoveInitiators.
public String generateExportGroupRemoveInitiators(Workflow workflow, String wfGroupId, String waitFor, URI export, URI storage, List<URI> initiatorURIs) throws WorkflowException {
DiscoveredSystemObject storageSystem = getStorageSystem(_dbClient, storage);
Workflow.Method method = ExportWorkflowEntryPoints.exportRemoveInitiatorsMethod(storage, export, initiatorURIs);
return newWorkflowStep(workflow, wfGroupId, String.format("Removing initiators from export (%s) on storage array %s", export, storageSystem.getNativeGuid()), storageSystem, method, null, waitFor, null);
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowUtils method generateExportAddPathsWorkflow.
/**
* Generates a Workflow Step to add paths in a storage system for a specific Export Mask.
*
* @param workflow - Workflow in which to add the step
* @param wfGroupId - String pointing to the group id of the step
* @param waitFor - Wait on this step/group to complete in the workflow before execution
* @param storageURI - Storage system URI
* @param exportGroupURI - Export group URI
* @param varray - URI of virtual array
* @param exportMask -- The Export Mask
* @param addedPaths - Paths going to be added or retained
* @param removedPath - Paths going to be removed
* @return - Step id
* @throws ControllerException
*/
public String generateExportAddPathsWorkflow(Workflow workflow, String wfGroupId, String waitFor, URI storageURI, URI exportGroupURI, URI varray, ExportMask exportMask, Map<URI, List<URI>> adjustedPaths, Map<URI, List<URI>> removedPaths) throws ControllerException {
DiscoveredSystemObject storageSystem = getStorageSystem(_dbClient, storageURI);
Workflow.Method method = ExportWorkflowEntryPoints.exportAddPathsMethod(storageURI, exportGroupURI, varray, exportMask.getId(), adjustedPaths, removedPaths);
String stepDescription = String.format("Export add paths mask %s hosts %s", exportMask.getMaskName(), ExportMaskUtils.getHostNamesInMask(exportMask, _dbClient));
return newWorkflowStep(workflow, wfGroupId, stepDescription, storageSystem, method, null, waitFor);
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowUtils method generateExportGroupAddInitiators.
public String generateExportGroupAddInitiators(Workflow workflow, String wfGroupId, String waitFor, URI export, URI storage, List<URI> initiatorURIs) throws WorkflowException {
DiscoveredSystemObject storageSystem = getStorageSystem(_dbClient, storage);
Workflow.Method method = ExportWorkflowEntryPoints.exportAddInitiatorsMethod(storage, export, initiatorURIs);
return newWorkflowStep(workflow, wfGroupId, String.format("Adding initiators from export (%s) on storage array %s", export, storageSystem.getNativeGuid()), storageSystem, method, rollbackMethodNullMethod(), waitFor, null);
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowUtils method generateExportRemovePathsWorkflow.
/**
* Generate workflow step for remove path masking in a storage system for a specific export mask.
*
* @param workflow - The workflow
* @param wfGroupId - Workflow group Id
* @param waitFor - Previous step
* @param storageURI - Storage system URI
* @param exportGroupURI - Export group URI
* @param varray - Virtual Array URI
* @param exportMask - Export Mask
* @param adjustedpaths - Adjusted Paths
* @param removePaths - Paths to be removed
* @return The created step
* @throws ControllerException
*/
public String generateExportRemovePathsWorkflow(Workflow workflow, String wfGroupId, String waitFor, URI storageURI, URI exportGroupURI, URI varray, ExportMask exportMask, Map<URI, List<URI>> adjustedPaths, Map<URI, List<URI>> removePaths) throws ControllerException {
DiscoveredSystemObject storageSystem = getStorageSystem(_dbClient, storageURI);
Workflow.Method method = ExportWorkflowEntryPoints.exportRemovePathsMethod(storageURI, exportGroupURI, varray, exportMask.getId(), adjustedPaths, removePaths);
String stepDescription = String.format("Export remove paths mask %s hosts %s", exportMask.getMaskName(), ExportMaskUtils.getHostNamesInMask(exportMask, _dbClient));
return newWorkflowStep(workflow, wfGroupId, stepDescription, storageSystem, method, null, waitFor);
}
Aggregations