[Cinder] 存储 Qos
生活随笔
收集整理的這篇文章主要介紹了
[Cinder] 存储 Qos
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
目錄
文章目錄
- 目錄
- 前言
- 操作步驟
- 參考文章
前言
Cinder 支持 front-end 和 back-end 兩種類型的存儲 QoS,前者由 Hypervisor 端實現(e.g. 通過 Libvirt 設置虛擬機的存儲 QoS),后者指存儲設備上設置的 QoS,需要存儲設備支持。 一般的物理存儲設備都會支持 QoS,但 SDS 的 Ceph RBD 不支持,所以使用 Ceph 存儲方案的用戶一般只能使用 front-end Qos 來限制虛擬機對數據盤的 Qos。
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
操作步驟
通過 openstackclient 創建具有 QoS Policy 的 Volume Type:
[stack@manager ~]$ openstack volume type create VolumeType1 +---------------------------------+--------------------------------------+ | Field | Value | +---------------------------------+--------------------------------------+ | description | None | | id | ae5359b3-0bbc-4104-88ca-3749eab07cc8 | | is_public | True | | name | VolumeType1 | | os-volume-type-access:is_public | True | +---------------------------------+--------------------------------------+[stack@manager ~]$ openstack volume type show VolumeType1 +---------------------------------+--------------------------------------+ | Field | Value | +---------------------------------+--------------------------------------+ | access_project_ids | None | | description | None | | id | ae5359b3-0bbc-4104-88ca-3749eab07cc8 | | is_public | True | | name | VolumeType1 | | os-volume-type-access:is_public | True | | properties | | | qos_specs_id | None | +---------------------------------+--------------------------------------+[stack@manager ~]$ openstack volume qos create qos1 --consumer front-end --property total_iops_sec=200 +----------+--------------------------------------+ | Field | Value | +----------+--------------------------------------+ | consumer | front-end | | id | 05ab9096-3a0f-45d8-acb8-f0cac172ae8c | | name | qos1 | | specs | {u'total_iops_sec': u'200'} | +----------+--------------------------------------+[stack@manager ~]$ openstack volume qos set --property total_bytes_sec=2048000 qos1[stack@manager ~]$ openstack volume qos associate qos1 VolumeType1指定 VolumeType 創建 Volume:
[stack@manager ~]$ openstack volume create --type VolumeType1 --size 1 volume1 +---------------------+--------------------------------------+ | Field | Value | +---------------------+--------------------------------------+ | attachments | [] | | availability_zone | nova | | bootable | false | | consistencygroup_id | None | | created_at | 2018-12-26T13:51:22.597699 | | description | None | | encrypted | False | | id | c24e2a9e-1792-4951-a040-434b87409558 | | migration_status | None | | multiattach | False | | name | volume1 | | properties | | | replication_status | disabled | | size | 1 | | snapshot_id | None | | source_volid | None | | status | creating | | type | VolumeType1 | | updated_at | None | | user_id | 11b816e454384d038472c7c89d2544f4 | +---------------------+--------------------------------------+[stack@manager ~]$ openstack volume list +--------------------------------------+--------------+-----------+------+-------------+ | ID | Display Name | Status | Size | Attached to | +--------------------------------------+--------------+-----------+------+-------------+ | c24e2a9e-1792-4951-a040-434b87409558 | volume1 | available | 1 | | +--------------------------------------+--------------+-----------+------+-------------+查看 Libvirt 虛擬機的 XML 文件內容,disk 標簽具有 QoS 屬性 <iotune>:
[root@overcloud-compute-0 ~]# virsh dumpxml 1 ... <disk type='block' device='disk'><driver name='qemu' type='raw' cache='none' io='native'/><source dev='/dev/sdd'/><backingStore/><target dev='vdb' bus='virtio'/><iotune><total_iops_sec>200</total_iops_sec><total_bytes_sec>2048000</total_bytes_sec></iotune><serial>c24e2a9e-1792-4951-a040-434b87409558</serial><alias name='virtio-disk1'/><address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/></disk>通過 virsh 設定 Libvirt 虛擬機的 QoS 屬性:
[root@overcloud-compute-0 ~]# virsh blkdeviotune 1 vdb --total_iops_sec 100[root@overcloud-compute-0 ~]# virsh blkdeviotune 1 vdb --total-bytes-sec 1024000[root@overcloud-compute-0 ~]# virsh dumpxml 1 ...<disk type='block' device='disk'><driver name='qemu' type='raw' cache='none' io='native'/><source dev='/dev/sdd'/><backingStore/><target dev='vdb' bus='virtio'/><iotune><total_bytes_sec>1024000</total_bytes_sec><total_iops_sec>100</total_iops_sec></iotune><serial>c24e2a9e-1792-4951-a040-434b87409558</serial><alias name='virtio-disk1'/><address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/></disk>NOTE:Qos 一般來說都是在一個建議值上下浮動的,所以可以通過指定 --total-iops-sec-max 來固定上限。
參考文章
Capacity based quality of service
https://blog.csdn.net/LL_JCB/article/details/80412362
轉載于:https://www.cnblogs.com/jmilkfan-fanguiju/p/10589736.html
總結
以上是生活随笔為你收集整理的[Cinder] 存储 Qos的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在创业公司,不懂运维的程序员如何兼顾公司
- 下一篇: VUE页面刷新问题