Search in sources :

Example 6 with Method

use of com.emc.storageos.workflow.Workflow.Method in project coprhd-controller by CoprHD.

the class SRDFDeviceController method addRollbackStepsForRefreshSystems.

/**
 * Add rollback steps for refreshing the target providers.  Currently, for SRDF workflow steps
 * we always try to use the active source provider, so here we will filter only the target descriptors
 * in order to determine their provider, which most likely has gotten out of sync.
 *
 * @param workflow          The workflow instance.
 * @param waitFor           Step ID to wait on until complete.
 * @param srdfDescriptors   All SRDF descriptors.
 * @return                  Step ID.
 */
private String addRollbackStepsForRefreshSystems(Workflow workflow, String waitFor, List<VolumeDescriptor> srdfDescriptors) {
    List<VolumeDescriptor> targetDescriptors = VolumeDescriptor.filterByType(srdfDescriptors, VolumeDescriptor.Type.SRDF_TARGET);
    if (targetDescriptors.isEmpty()) {
        return waitFor;
    }
    URI targetSystem = targetDescriptors.get(0).getDeviceURI();
    StorageSystem tgt = dbClient.queryObject(StorageSystem.class, targetSystem);
    Workflow.Method refreshTargetSystemsMethod = new Method(REFRESH_SRDF_TARGET_SYSTEM, tgt, null);
    workflow.createStep(ROLLBACK_REFRESH_SYSTEM_STEP_GROUP, String.format(ROLLBACK_REFRESH_SYSTEM_STEP_DESC, tgt.getSerialNumber()), waitFor, tgt.getId(), tgt.getSystemType(), this.getClass(), rollbackMethodNullMethod(), refreshTargetSystemsMethod, null);
    return ROLLBACK_REFRESH_SYSTEM_STEP_GROUP;
}
Also used : Method(com.emc.storageos.workflow.Workflow.Method) VolumeDescriptor(com.emc.storageos.blockorchestrationcontroller.VolumeDescriptor) Workflow(com.emc.storageos.workflow.Workflow) Method(com.emc.storageos.workflow.Workflow.Method) NamedURI(com.emc.storageos.db.client.model.NamedURI) URI(java.net.URI) FCTN_STRING_TO_URI(com.emc.storageos.db.client.util.CommonTransformerFunctions.FCTN_STRING_TO_URI) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Example 7 with Method

use of com.emc.storageos.workflow.Workflow.Method in project coprhd-controller by CoprHD.

the class SRDFDeviceController method refreshVolumeProperties.

/**
 * This method creates step to refresh volume properties.
 *
 * @param volumeDescriptors List of volume descriptors
 * @param system reference to storage system
 * @param waitFor String waitFor of previous step, we wait on this to complete
 * @param workflow Reference to Workflow
 * @return stepId
 */
private String refreshVolumeProperties(List<VolumeDescriptor> volumeDescriptors, StorageSystem system, String waitFor, Workflow workflow) {
    List<URI> targetURIs = VolumeDescriptor.getVolumeURIs(volumeDescriptors);
    Method updateVolumePropertiesMethod = updateVolumePropertiesMethod(targetURIs, system.getId());
    Method rollbackMethod = rollbackMethodNullMethod();
    String stepId = workflow.createStep(REFRESH_VOLUME_PROPERTIES_STEP, REFRESH_VOLUME_PROPERTIES_STEP_DESC, waitFor, system.getId(), system.getSystemType(), getClass(), updateVolumePropertiesMethod, rollbackMethod, null);
    return stepId;
}
Also used : Method(com.emc.storageos.workflow.Workflow.Method) NamedURI(com.emc.storageos.db.client.model.NamedURI) URI(java.net.URI) FCTN_STRING_TO_URI(com.emc.storageos.db.client.util.CommonTransformerFunctions.FCTN_STRING_TO_URI)

Aggregations

NamedURI (com.emc.storageos.db.client.model.NamedURI)7 FCTN_STRING_TO_URI (com.emc.storageos.db.client.util.CommonTransformerFunctions.FCTN_STRING_TO_URI)7 Method (com.emc.storageos.workflow.Workflow.Method)7 URI (java.net.URI)7 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)6 Volume (com.emc.storageos.db.client.model.Volume)5 StringSet (com.emc.storageos.db.client.model.StringSet)4 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)4 ArrayList (java.util.ArrayList)4 Workflow (com.emc.storageos.workflow.Workflow)3 Mode (com.emc.storageos.volumecontroller.impl.smis.SRDFOperations.Mode)2 VolumeDescriptor (com.emc.storageos.blockorchestrationcontroller.VolumeDescriptor)1 RemoteDirectorGroup (com.emc.storageos.db.client.model.RemoteDirectorGroup)1