cinder 的 qos 限速

Cinder 支持 front-end 端和 back-end 端设置 QoS,其中 front-end 表示 hypervisor 端,即在宿主机上设置虚拟机的 QoS,通常使用 cgroup 或者 qemu-iothrottling;back-end 端指在存储设备上设置 QoS,该功能需要存储设备的支持。

Ceph RBD 不支持 QoS,故数据盘的 QoS 需要采用 qemu io throttling 在 front-end 端设置。以 Ceph-RBD 的存储为例,设置数据盘的 QoS 步骤如下:


参数解释:


total_bytes_sec: the total allowed bandwidth for the guest per second

read_bytes_sec: sequential read limitation

write_bytes_sec: sequential write limitation

total_iops_sec: the total allowed IOPS for the guest per second

read_iops_sec: random read limitation

write_iops_sec: random write limitation

设置qos


[root@node1 ~]# cinder qos-create ceph-ssd-qos consumer=front-end read_bytes_sec=50000000 write_bytes_sec=50000000 read_iops_sec=400 write_iops_sec=400

+----------+--------------------------------------+

| Property | Value                                |

+----------+--------------------------------------+

| consumer | front-end                            |

| id      | fc315a12-d450-4a47-91fa-57792bb80932 |

| name    | ceph-ssd-qos                        |

| specs    | read_bytes_sec : 50000000            |

|          | read_iops_sec : 400                  |

|          | write_bytes_sec : 50000000          |

|          | write_iops_sec : 400                |

+----------+--------------------------------------+

创建存储类型


[root@node1 ~]# cinder type-create ceph-storage

+--------------------------------------+--------------+-------------+-----------+

| ID                                  | Name        | Description | Is_Public |

+--------------------------------------+--------------+-------------+-----------+

| 4c9c7c5a-a15c-41ab-98c5-45cdea8c91cd | ceph-storage | -          | True      |

+--------------------------------------+--------------+-------------+-----------+

将存储类型和后端存储绑定


# cinder --os-username admin --os-tenant-name admin type-key ceph-storage set volume_backend_name=ceph

注意:后端存储类型名称查看


[root@node1 ~]# cat /etc/cinder/cinder.conf | grep volume_backend_name | grep -v ^#

volume_backend_name = ceph

查看卷类型


[root@node1 ~]# cinder type-list

+--------------------------------------+--------------+-------------+-----------+

| ID                                  | Name        | Description | Is_Public |

+--------------------------------------+--------------+-------------+-----------+

| 4c9c7c5a-a15c-41ab-98c5-45cdea8c91cd | ceph-storage | -          | True      |

+--------------------------------------+--------------+-------------+-----------+

查看qos


[root@node1 ~]# cinder qos-list

+--------------------------------------+--------------+-----------+----------------------------------------------------------------------------------------------------------------+

| ID                                  | Name        | Consumer  | specs                                                                                                          |

+--------------------------------------+--------------+-----------+----------------------------------------------------------------------------------------------------------------+

| fc315a12-d450-4a47-91fa-57792bb80932 | ceph-ssd-qos | front-end | {'read_bytes_sec': '50000000', 'write_iops_sec': '400', 'write_bytes_sec': '50000000', 'read_iops_sec': '400'} |

+--------------------------------------+--------------+-----------+----------------------------------------------------------------------------------------------------------------+

[root@node1 ~]#

将卷类型和qos绑定


格式: cinder qos-associate QOS_ID  TYPE_ID


[root@node1 ~]# cinder qos-associate fc315a12-d450-4a47-91fa-57792bb80932  4c9c7c5a-a15c-41ab-98c5-45cdea8c91cd

验证


创建卷并将卷绑定到虚拟机上


[root@node1 ~]# virsh dumpxml 3 | grep sec

        <secret type='ceph' uuid='47fd1361-7286-44b4-863f-1445b8aafe04'/>

        <secret type='ceph' uuid='47fd1361-7286-44b4-863f-1445b8aafe04'/>

        <read_bytes_sec>50000000</read_bytes_sec>

        <write_bytes_sec>50000000</write_bytes_sec>

        <read_iops_sec>400</read_iops_sec>

        <write_iops_sec>400</write_iops_sec>

  <seclabel type='none' model='none'/>

  <seclabel type='dynamic' model='dac' relabel='yes'>

  </seclabel>

[root@node1 ~]#

文章摘自网络,如有侵权请联系删除

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 系统环境: centos73.10.0-514.26.2.el7.x86_64 机器数量:五台 硬盘:四块一块为系...
    think_lonely阅读 4,836评论 0 5
  • 节点分布 10.1.1.1 controller10.1.1.2 compute10.1.1.3 middlewa...
    羽煊阅读 682评论 0 0
  • 背景 由于Ceph存储和Nova计算节点是混合部署的,而且虚拟机的数据卷是共用Ceph的Volume存储池。难免会...
    魔哈Moha阅读 5,497评论 0 1
  • 硬着头皮看梁漱溟的《孔孟之道》之孔子,123页,翻来覆去看了三遍,勉强看完。 《小词大雅》前面部分并不难,张惠言的...
    石默默阅读 161评论 0 0
  • 每天七点多就要奔波在城市中间, 夜晚十一点才收拾好一切, 每天穿行在拥挤的人群之间,来来回回, 却怎么也找不到心的...
    Air_疯子阅读 405评论 0 0