Manila/QoS
简介
https://blueprints.launchpad.net/manila/+spec/manila-support-qos
目标是添加一个接口,以便 Manila 管理员可以使用该接口设置共享 QoS 规范(IOPS、带宽、延迟、优先级和其他供应商指定的属性),这些规范可以在 Manila 后端强制执行;
QoS 的设计尚未完成。我们对该特性有一个愿景,并且正在定义细节。
问题描述
Manila 中 QoS 规范管理流程的当前实现对规范的键/值对没有验证。管理员无法获得响应,以确定他们刚刚创建的 QoS 规范键/值对是否有效。 键/值对的验证仅在共享创建过程中发生,而此时为时已晚。 在 QoS 规范创建或编辑过程中立即进行键/值对验证将显著提高此任务的可用性和用户体验。
方法 1
使用带有供应商范围键的 extra-specs 表。
如何确保用户需要使用 qos 创建共享?
1、在共享类型中添加 qos_support,以确保用户需要使用 qos 创建共享。
通用 qos
qos:max_iops qos:min_iops qos:max_bandwith qos:min_bandwith
max:前缀“Max_”表示最大值不能超过。
min:前缀“min_”表示最小值是一个软限制,使当前值尽可能大于最小值。
例如:share_type: qos_support='<is> True' 或 '<is> False'
qos:max_iops=100
netapp:max_test=100
driver update: qos_support=true
在通用 capabilities 中添加 qos_support。(https://github.com/openstack/manila/blob/master/doc/source/devref/capabilities_and_extra_specs.rst)
方法 2
添加一个接口,以便管理员可以使用该接口表达共享(特定后端)的 QoS 要求,这些要求将被后端驱动程序使用。
- 向 'types_extra_specs' API 扩展添加一个新的资源扩展,以允许列出/创建/更新/删除类型 QoS 规范。- 修改 'type_manage' API 扩展,使其能够接受 QoS 规范信息。
qos-associate Associates qos specs with specified share type. qos-create Creates a qos specs. qos-delete Deletes a specified qos specs. qos-disassociate Disassociates qos specs from specified share type. qos-disassociate-all Disassociates qos specs from all associations. qos-get-association Gets all associations for specified qos specs. qos-key Sets or unsets specifications for a qos spec. qos-list Lists qos specs. qos-show Shows a specified qos specs.
- 修改 share_types.create() 以接受 QoS 规范信息并进行检查。- 将 'qos_specs' 添加到共享创建请求的 request_specs 和 filter 属性中,并传递给驱动程序。- 要启用 Manila 驱动程序的 QoS,需要将 qos 规范绑定到共享类型。 以下所有
changes apply to the Manila driver code.
Create share: If QoS is enabled and specs is available as the QoS key, set the qos spec of the share
into the specified qos spec value.
Create snapshot: The QoS attributes will be copied to the snapshot.
Create share from snapshot: If QoS is enabled and IOThrottling is available as the QoS key, set the
qos spec of the share into the specified qos spec value.
数据库模式更改
- 将在 share_types 表中添加一个新的 qos_specs_id 布尔列。
- 将为特定的共享类型创建一个新的 quality_of_service_specs 表。 将有
one entry in quality_of_service_specs table for every share_type_id and specs_id combination. It will be a one-to-one relationship.
mysql> DESC quality_of_service_specs; +------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+-------+ | created_at | datetime | YES | | NULL | | | updated_at | datetime | YES | | NULL | | | deleted_at | datetime | YES | | NULL | | | deleted | tinyint(1) | YES | | NULL | | | id | varchar(36) | NO | PRI | NULL | | | specs_id | varchar(36) | YES | MUL | NULL | | | key | varchar(255) | YES | | NULL | | | value | varchar(255) | YES | | NULL | | +------------+--------------+------+-----+---------+-------+ 8 rows in set (0.00 sec)
mysql> DESC share_types; +--------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+--------------+------+-----+---------+-------+ | created_at | datetime | YES | | NULL | | | updated_at | datetime | YES | | NULL | | | deleted_at | datetime | YES | | NULL | | | deleted | tinyint(1) | YES | | NULL | | | id | varchar(36) | NO | PRI | NULL | | | name | varchar(255) | YES | | NULL | | | qos_specs_id | varchar(36) | YES | MUL | NULL | | | is_public | tinyint(1) | YES | | NULL | | +--------------+--------------+------+-----+---------+-------+ 8 rows in set (0.00 sec)
REST API 影响
- 扩展共享类型创建响应以包含 qos_specs_id 字段
- 扩展共享类型列表以包含 qos_specs_id 字段
- 扩展共享类型详细信息以包含 qos_specs_id 字段
- 添加创建/删除 qos 规范的能力
- 添加将 qos 规范与指定的共享类型关联/取消关联的能力
- 添加新扩展的策略
其他最终用户影响
- Manila-ui 应更新以支持此新扩展。
- python-manilaclient 应更新以允许使用此新扩展。
建议的 python-manilaclient shell 接口:
manila qos-associate <qos_specs> <share_type_id> Associates qos specs with specified share type.
manila qos-create <name> [--max_kbps <max_kbps>] [--min_kbps <min_kbps>] [--max_iops <max_iops>] [--min_iops <min_iops>] <key=value> [<key=value> ...] Creates a qos specs.
max:前缀“Max_”表示最大值不能超过。
min:前缀“min_”表示最小值是一个软限制,使当前值尽可能大于最小值。
manila qos-delete [--force <True|False>] <qos_specs> Deletes a specified qos specs.
manila qos-disassociate <qos_specs> <share_type_id> Disassociates qos specs from specified share type.
manila qos-disassociate-all <qos_specs> Disassociates qos specs from all associations.
manila qos-get-association <qos_specs> Gets all associations for specified qos specs.
manila qos-key <qos_specs> <action> key=value [key=value ...] Sets or unsets specifications for a qos spec.
manila qos-list Lists qos specs.
manila qos-show <qos_specs> Shows a specified qos specs.
问题
1.为什么 QoS 不能以相同的方式使用 - 带有可能性的 extra specs?
因为 QoS 是一个独立的资源和特殊功能。 QoS 需要一套完整的 API。
2.为什么只将 QoS 与共享类型关联? 为什么不与租户、用户或特定共享关联?
对于用户,只需要查看 share_type。 如果用户想使用 QoS,那么他们会将 QoS 与 share_type 关联。 如果我们提供更多的访问权限(例如:在创建共享时将 QoS 作为参数添加),用户会觉得更复杂。
Cinder QoS 与 Manila QoS
- Manila QoS 在 qos-create 命令中添加了一些通用的 capabilities。
- Cinder 支持前端 QoS 和后端 QoS,Manila 仅支持后端 QoS。
负责人
主要负责人
zhongjun (jun.zhongjun@huawei.com)
其他贡献者
zhaohua (zhaohua.zhao@huawei.com)
工作项
- 添加逻辑以协调调用每个驱动程序的“validate”函数
- 向基础 Manila 驱动程序添加“validate”函数
- 向 lvm 驱动程序添加“validate”函数
依赖项
所有更改文件的单元测试
文档影响
- Manila API 文档需要更新,以反映 API 可能会返回失败这一事实。