Search in sources :

Example 11 with DiscoveredSystemObject

use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.

the class ExportWorkflowUtils method generateChangeAutoTieringPolicy.

/**
 * Generate a Workflow Step to change the Auto-tiering policy for the volumes
 * in a specific Export Mask.
 *
 * @param workflow the workflow
 * @param wfGroupId - Workflow group for the Step
 * @param waitFor - Wait on this step/group to complete in the workflow before execution
 * @param storageURI the storage system uri
 * @param volumeURIs the volume uris
 * @param newVpoolURI the new vpool uri
 * @param oldVpoolURI the old vpool uri *
 * @return stepId for the generated workflow Step
 * @throws ControllerException the controller exception
 */
public String generateChangeAutoTieringPolicy(Workflow workflow, String wfGroupId, String waitFor, URI storageURI, List<URI> volumeURIs, URI newVpoolURI, URI oldVpoolURI) throws ControllerException {
    DiscoveredSystemObject storageSystem = getStorageSystem(_dbClient, storageURI);
    Workflow.Method method = ExportWorkflowEntryPoints.changeAutoTieringPolicyMethod(storageURI, volumeURIs, newVpoolURI, false);
    // same method is called as a roll back step by passing old vPool.
    // boolean is passed to differentiate it.
    Workflow.Method rollback = ExportWorkflowEntryPoints.changeAutoTieringPolicyMethod(storageURI, volumeURIs, oldVpoolURI, true);
    return newWorkflowStep(workflow, wfGroupId, String.format("Updating Auto-tiering Policy on storage array %s (%s, args) for volumes %s", storageSystem.getNativeGuid(), storageURI, Joiner.on("\t").join(volumeURIs)), storageSystem, method, rollback, waitFor, null);
}
Also used : Workflow(com.emc.storageos.workflow.Workflow) DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject)

Example 12 with DiscoveredSystemObject

use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.

the class ExportWorkflowUtils method generateExportGroupChangePortWorkflow.

/**
 * Generate step for change port group
 *
 * @param workflow - Workflow
 * @param wfGroupId - Workflow group Id
 * @param exportGroupURI - Export group URI
 * @param portGroupURI - New port group URI
 * @param exportMaskURIs - The URI list of affected export masks in the export group
 * @param waitForApproval - If wait until approval
 * @return - The generated step
 * @throws ControllerException
 */
public String generateExportGroupChangePortWorkflow(Workflow workflow, String wfGroupId, URI exportGroupURI, URI portGroupURI, List<URI> exportMaskURIs, boolean waitForApproval) throws ControllerException {
    Workflow.Method rollbackMethod = rollbackMethodNullMethod();
    ExportGroup exportGroup = _dbClient.queryObject(ExportGroup.class, exportGroupURI);
    StoragePortGroup portGroup = _dbClient.queryObject(StoragePortGroup.class, portGroupURI);
    DiscoveredSystemObject system = _dbClient.queryObject(StorageSystem.class, portGroup.getStorageDevice());
    Workflow.Method method = ExportWorkflowEntryPoints.exportChangePortGroupMethod(system.getId(), exportGroupURI, portGroupURI, exportMaskURIs, waitForApproval);
    String stepDescription = String.format("Change port group to %s for the export group %s", portGroup.getNativeGuid(), exportGroup.getLabel());
    return newWorkflowStep(workflow, wfGroupId, stepDescription, system, method, rollbackMethod, null);
}
Also used : StoragePortGroup(com.emc.storageos.db.client.model.StoragePortGroup) ExportGroup(com.emc.storageos.db.client.model.ExportGroup) Workflow(com.emc.storageos.workflow.Workflow) DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject)

Example 13 with DiscoveredSystemObject

use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.

the class ExportWorkflowUtils method generateExportChangePolicyAndLimits.

/**
 * Generate a Workflow Step to change the Auto-tiering policy for the volumes
 * in a specific Export Mask.
 *
 * @param workflow the workflow
 * @param wfGroupId - Workflow group for the Step
 * @param waitFor - Wait on this step/group to complete in the workflow before execution
 * @param storageURI the storage system uri
 * @param exportMaskURI the export mask uri
 * @param volumeURIs the volume uris
 * @param exportGroupURI
 * @param newVpoolURI the new vpool uri
 * @return stepId for the generated workflow Step
 * @throws ControllerException the controller exception
 */
public String generateExportChangePolicyAndLimits(Workflow workflow, String wfGroupId, String waitFor, URI storageURI, URI exportMaskURI, URI exportGroupURI, List<URI> volumeURIs, URI newVpoolURI, URI oldVpoolURI) throws ControllerException {
    DiscoveredSystemObject storageSystem = getStorageSystem(_dbClient, storageURI);
    Workflow.Method method = ExportWorkflowEntryPoints.exportChangePolicyAndLimitsMethod(storageURI, exportMaskURI, exportGroupURI, volumeURIs, newVpoolURI, false);
    // same method is called as a roll back step by passing old vPool.
    // boolean is passed to differentiate it.
    Workflow.Method rollback = ExportWorkflowEntryPoints.exportChangePolicyAndLimitsMethod(storageURI, exportMaskURI, exportGroupURI, volumeURIs, oldVpoolURI, true);
    return newWorkflowStep(workflow, wfGroupId, String.format("Updating Auto-tiering Policy on storage array %s (%s, args) for volumes %s", storageSystem.getNativeGuid(), storageURI, Joiner.on("\t").join(volumeURIs)), storageSystem, method, rollback, waitFor, null);
}
Also used : Workflow(com.emc.storageos.workflow.Workflow) DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject)

Example 14 with DiscoveredSystemObject

use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.

the class ExportWorkflowUtils method generateExportGroupCreateWorkflow.

public String generateExportGroupCreateWorkflow(Workflow workflow, String wfGroupId, String waitFor, URI storage, URI export, Map<URI, Integer> volumeMap, List<URI> initiatorURIs) throws WorkflowException {
    DiscoveredSystemObject storageSystem = getStorageSystem(_dbClient, storage);
    // Filter the addedInitiators for non VPLEX system by the Export Group varray.
    ExportGroup exportGroup = _dbClient.queryObject(ExportGroup.class, export);
    initiatorURIs = ExportUtils.filterNonVplexInitiatorsByExportGroupVarray(exportGroup, initiatorURIs, storage, _dbClient);
    Workflow.Method method = ExportWorkflowEntryPoints.exportGroupCreateMethod(storage, export, volumeMap, initiatorURIs);
    Workflow.Method rollback = ExportWorkflowEntryPoints.exportGroupDeleteMethod(storage, export);
    return newWorkflowStep(workflow, wfGroupId, String.format("Creating export (%s) on storage array %s", export, storageSystem.getNativeGuid()), storageSystem, method, rollback, waitFor, null);
}
Also used : ExportGroup(com.emc.storageos.db.client.model.ExportGroup) Workflow(com.emc.storageos.workflow.Workflow) DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject)

Example 15 with DiscoveredSystemObject

use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.

the class ExportWorkflowUtils method generateExportGroupDeleteWorkflow.

public String generateExportGroupDeleteWorkflow(Workflow workflow, String wfGroupId, String waitFor, URI storage, URI export) throws WorkflowException {
    DiscoveredSystemObject storageSystem = getStorageSystem(_dbClient, storage);
    Workflow.Method method = ExportWorkflowEntryPoints.exportGroupDeleteMethod(storage, export);
    return newWorkflowStep(workflow, wfGroupId, String.format("Deleting 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)

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