Search in sources :

Example 1 with VplexMirrorDeactivateCompleter

use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.VplexMirrorDeactivateCompleter in project coprhd-controller by CoprHD.

the class VPlexDeviceController method deactivateMirror.

@Override
public void deactivateMirror(URI vplexURI, URI mirrorURI, List<VolumeDescriptor> volumeDescriptors, String taskId) throws InternalException {
    VplexMirrorDeactivateCompleter completer = new VplexMirrorDeactivateCompleter(mirrorURI, taskId);
    try {
        // Generate the Workflow.
        Workflow workflow = _workflowService.getNewWorkflow(this, DEACTIVATE_MIRROR_WF_NAME, true, taskId);
        // the wait for key returned by previous call
        String waitFor = null;
        // Add steps for detaching and deleting mirror
        waitFor = addStepsForDetachAndDeleteMirror(workflow, waitFor, vplexURI, mirrorURI, taskId);
        // Next, call the BlockDeviceController to add its methods.
        waitFor = _blockDeviceController.addStepsForDeleteVolumes(workflow, waitFor, volumeDescriptors, taskId);
        String successMessage = "Deactivate mirror successful for: " + mirrorURI;
        workflow.executePlan(completer, successMessage);
    } catch (Exception ex) {
        _log.error("Deactivate mirror failed for mirror " + mirrorURI, ex);
        ServiceError serviceError = VPlexApiException.errors.deactivateMirrorFailed(ex);
        failStep(completer, taskId, serviceError);
    }
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) Workflow(com.emc.storageos.workflow.Workflow) VplexMirrorDeactivateCompleter(com.emc.storageos.volumecontroller.impl.block.taskcompleter.VplexMirrorDeactivateCompleter) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) InternalServerErrorException(com.emc.storageos.svcs.errorhandling.resources.InternalServerErrorException) VPlexApiException(com.emc.storageos.vplex.api.VPlexApiException) ControllerException(com.emc.storageos.volumecontroller.ControllerException) IOException(java.io.IOException) URISyntaxException(java.net.URISyntaxException) WorkflowException(com.emc.storageos.workflow.WorkflowException) DatabaseException(com.emc.storageos.db.exceptions.DatabaseException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException)

Aggregations

DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)1 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)1 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)1 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)1 InternalServerErrorException (com.emc.storageos.svcs.errorhandling.resources.InternalServerErrorException)1 ControllerException (com.emc.storageos.volumecontroller.ControllerException)1 VplexMirrorDeactivateCompleter (com.emc.storageos.volumecontroller.impl.block.taskcompleter.VplexMirrorDeactivateCompleter)1 VPlexApiException (com.emc.storageos.vplex.api.VPlexApiException)1 Workflow (com.emc.storageos.workflow.Workflow)1 WorkflowException (com.emc.storageos.workflow.WorkflowException)1 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1