Search in sources :

Example 6 with VNXeFSSnapshotTaskCompleter

use of com.emc.storageos.volumecontroller.impl.vnxe.job.VNXeFSSnapshotTaskCompleter in project coprhd-controller by CoprHD.

the class FileOrchestrationDeviceController method snapshotFS.

@Override
public void snapshotFS(URI storage, URI snapshot, URI fsURI, String opId) throws ControllerException {
    // Using VNXeFSSnapshotTaskCompleter as it will serve the purpose..
    VNXeFSSnapshotTaskCompleter completer = new VNXeFSSnapshotTaskCompleter(Snapshot.class, snapshot, opId);
    Workflow workflow = null;
    try {
        workflow = _workflowService.getNewWorkflow(this, CREATE_FILESYSTEM_SNAPSHOT_WF_NAME, false, opId, completer);
        String snapshotFSStep = workflow.createStepId();
        String stepDescription = String.format("Creating file system: %s snapshot : %s", fsURI, snapshot);
        Object[] args = new Object[] { storage, snapshot, fsURI };
        _fileDeviceController.createMethod(workflow, null, CREATE_FILESYSTEM_SNAPSHOT_METHOD, snapshotFSStep, stepDescription, storage, args);
        String successMessage = String.format("Creating file system: %s snapshot : %s finished successfully.", fsURI, snapshot);
        workflow.executePlan(completer, successMessage);
    } catch (Exception ex) {
        s_logger.error(String.format("Creating file system: %s snapshot : %s failed.", fsURI, snapshot), ex);
        String opName = ResourceOperationTypeEnum.CREATE_FILE_SYSTEM_SNAPSHOT.getName();
        ServiceError serviceError = DeviceControllerException.errors.createFileSystemSnapshotFailed(fsURI.toString(), opName, ex);
        completer.error(s_dbClient, _locker, serviceError);
    }
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) VNXeFSSnapshotTaskCompleter(com.emc.storageos.volumecontroller.impl.vnxe.job.VNXeFSSnapshotTaskCompleter) Workflow(com.emc.storageos.workflow.Workflow) FileObject(com.emc.storageos.db.client.model.FileObject) WorkflowException(com.emc.storageos.workflow.WorkflowException) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) ControllerException(com.emc.storageos.volumecontroller.ControllerException)

Aggregations

DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)6 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)6 ControllerException (com.emc.storageos.volumecontroller.ControllerException)6 VNXeFSSnapshotTaskCompleter (com.emc.storageos.volumecontroller.impl.vnxe.job.VNXeFSSnapshotTaskCompleter)6 Snapshot (com.emc.storageos.db.client.model.Snapshot)4 VNXeApiClient (com.emc.storageos.vnxe.VNXeApiClient)4 VNXeException (com.emc.storageos.vnxe.VNXeException)4 VNXeCommandJob (com.emc.storageos.vnxe.models.VNXeCommandJob)4 QueueJob (com.emc.storageos.volumecontroller.impl.job.QueueJob)4 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)2 FileObject (com.emc.storageos.db.client.model.FileObject)2 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)2 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)2 VNXeCreateFileSystemSnapshotJob (com.emc.storageos.volumecontroller.impl.vnxe.job.VNXeCreateFileSystemSnapshotJob)2 VNXeRestoreFileSystemSnapshotJob (com.emc.storageos.volumecontroller.impl.vnxe.job.VNXeRestoreFileSystemSnapshotJob)2 Workflow (com.emc.storageos.workflow.Workflow)2 WorkflowException (com.emc.storageos.workflow.WorkflowException)2