cinder的qos限速

16 篇文章 0 订阅
13 篇文章 0 订阅

作者 吴业亮

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 ~]# 

参考:
https://docs.openstack.org/cinder/latest/admin/blockstorage-capacity-based-qos.html
这里写图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Cinder是一个开源项目,它提供了一个用于管理和提供持久块存储的服务。在分布式环境中,Cinder可以通过将存储资源分解为多个存储节点来提供更高的可靠性和可扩展性。 在Cinder的分布式架构中,存储资源可以由不同的存储节点提供。每个存储节点可以是物理存储设备、存储服务器或存储阵列等。这些存储节点通过网络连接在一起,形成一个分布式存储系统。 Cinder使用了一些关键的技术来实现分布式存储。其中一个关键技术是数据复制和数据迁移。当存储节点故障或发生网络故障时,Cinder能够将数据从故障的节点复制到其他可用节点,从而确保数据的可用性。另外,当存储需求增加或发生负载不平衡时,Cinder能够自动迁移数据到其他节点上,以实现负载均衡。 另一个关键技术是数据块的映射和路由。Cinder通过数据映射和路由来确定应该将数据存储在哪个节点上,并在需要访问数据时将请求路由到正确的节点上。这样可以提高数据的访问速度和响应性能。 在使用Cinder分布式存储时,用户可以通过Cinder API访问和管理存储资源。用户可以创建、删除和扩展存储卷,将卷附加到虚拟机上并进行数据操作。Cinder还提供了诸如快照、克隆和迁移等高级功能,以满足不同的存储需求。 总之,Cinder分布式存储提供了一个可靠、高性能和可扩展的块存储服务。它通过将存储资源分解为多个存储节点,并使用数据复制、数据迁移和数据映射等技术来提高存储系统的可用性和性能。用户可以通过Cinder API方便地管理存储资源,并满足不同的存储需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值