Search in sources :

Example 6 with DiscoveredSystemObject

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);
    }
}
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 7 with DiscoveredSystemObject

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;
    }
}
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 8 with DiscoveredSystemObject

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);
    }
}
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 9 with DiscoveredSystemObject

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);
    }
}
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 10 with DiscoveredSystemObject

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

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