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);
}
}
Aggregations