Search in sources :

Example 26 with DiscoveredSystemObject

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;
    }
}
Also used : DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) WorkflowException(com.emc.storageos.workflow.WorkflowException) ControllerException(com.emc.storageos.volumecontroller.ControllerException)

Example 27 with DiscoveredSystemObject

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);
}
Also used : Workflow(com.emc.storageos.workflow.Workflow) DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject)

Example 28 with DiscoveredSystemObject

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);
}
Also used : Workflow(com.emc.storageos.workflow.Workflow) DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject)

Example 29 with DiscoveredSystemObject

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);
}
Also used : Workflow(com.emc.storageos.workflow.Workflow) DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject)

Example 30 with DiscoveredSystemObject

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);
}
Also used : Workflow(com.emc.storageos.workflow.Workflow) DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject)

Aggregations

DiscoveredSystemObject (com.emc.storageos.db.client.model.DiscoveredSystemObject)43 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)15 ControllerException (com.emc.storageos.volumecontroller.ControllerException)14 WorkflowException (com.emc.storageos.workflow.WorkflowException)14 Workflow (com.emc.storageos.workflow.Workflow)13 ExportGroup (com.emc.storageos.db.client.model.ExportGroup)4 URI (java.net.URI)3 Controller (com.emc.storageos.Controller)2 BlockObject (com.emc.storageos.db.client.model.BlockObject)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 CompatibilityException (com.emc.storageos.computesystemcontroller.exceptions.CompatibilityException)1 StoragePortGroup (com.emc.storageos.db.client.model.StoragePortGroup)1 RetryableDatabaseException (com.emc.storageos.db.exceptions.RetryableDatabaseException)1 AbstractDiscoveredSystemController (com.emc.storageos.impl.AbstractDiscoveredSystemController)1 ProtectionExportController (com.emc.storageos.protectioncontroller.ProtectionExportController)1 RPController (com.emc.storageos.protectioncontroller.RPController)1 RPDeviceController (com.emc.storageos.protectioncontroller.impl.recoverpoint.RPDeviceController)1 WorkflowRestartedException (com.emc.storageos.workflow.WorkflowRestartedException)1 IOException (java.io.IOException)1