'Create the qos class on the backend.'

def _create_qos_class(self, perf_class_name, specs):

    try:
        _type = self._get_type_from_perf_class_name(perf_class_name)
        if _type:
            self._call_xiv_xcli('perf_class_create', perf_class=perf_class_name, type=_type)
        else:
            self._call_xiv_xcli('perf_class_create', perf_class=perf_class_name)
    except errors.XCLIError as e:
        details = self._get_code_and_status_or_message(e)
        msg = (PERF_CLASS_ERROR % {'details': details})
        LOG.error(msg)
        raise self.meta['exception'].VolumeBackendAPIException(data=msg)
    try:
        args = self._qos_create_kwargs_for_xcli(specs)
        self._call_xiv_xcli('perf_class_set_rate', perf_class=perf_class_name, **args)
        return perf_class_name
    except errors.XCLIError as e:
        details = self._get_code_and_status_or_message(e)
        self._call_xiv_xcli('perf_class_delete', perf_class=perf_class_name)
        msg = (PERF_CLASS_ERROR % {'details': details})
        LOG.error(msg)
        raise self.meta['exception'].VolumeBackendAPIException(data=msg)
