Cinder 支持 front-end 端和 back-end 端設(shè)置 QoS锤躁,其中 front-end 表示 hypervisor 端,即在宿主機(jī)上設(shè)置虛擬機(jī)的 QoS狼讨,通常使用 cgroup 或者 qemu-iothrottling贝淤;back-end 端指在存儲(chǔ)設(shè)備上設(shè)置 QoS,該功能需要存儲(chǔ)設(shè)備的支持政供。
Ceph RBD 不支持 QoS播聪,故數(shù)據(jù)盤的 QoS 需要采用 qemu io throttling 在 front-end 端設(shè)置。以 Ceph-RBD 的存儲(chǔ)為例布隔,設(shè)置數(shù)據(jù)盤的 QoS 步驟如下:
參數(shù)解釋:
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
設(shè)置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? ? ? ? ? ? ? ? |
+----------+--------------------------------------+
創(chuàng)建存儲(chǔ)類型
[root@node1 ~]# cinder type-create ceph-storage
+--------------------------------------+--------------+-------------+-----------+
| ID? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | Name? ? ? ? | Description | Is_Public |
+--------------------------------------+--------------+-------------+-----------+
| 4c9c7c5a-a15c-41ab-98c5-45cdea8c91cd | ceph-storage | -? ? ? ? ? | True? ? ? |
+--------------------------------------+--------------+-------------+-----------+
將存儲(chǔ)類型和后端存儲(chǔ)綁定
# cinder --os-username admin --os-tenant-name admin type-key ceph-storage set volume_backend_name=ceph
注意:后端存儲(chǔ)類型名稱查看
[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
驗(yàn)證
創(chuàng)建卷并將卷綁定到虛擬機(jī)上
[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 ~]#
文章摘自網(wǎng)絡(luò)离陶,如有侵權(quán)請(qǐng)聯(lián)系刪除