第 10 章 配置 QoS
Red Hat OpenStack Platform 9 推出了对网络服务质量(QoS)策略的支持。OpenStack 管理员可以使用这些策略,通过为实例的网络速度设置不同限制来实现提供不同服务级别的功能。当网络流量超过所设定的限制时,相关网络通讯会被忽略。
10.1. QoS 策略范围
QoS 策略可以应用到单独的端口上,也可以应用到一个特定的租户网络中(其中的所有端口都会继承这个策略)。
10.2. QoS 策略管理
QoS 策略可以被动态应用、修改或删除。这个示例手工创建了一个带宽限制规则并被应用到一个端口。
查看租户列表并决定需要创建 QoS 策略的租户 ID:
# openstack project list +----------------------------------+----------+ | ID | Name | +----------------------------------+----------+ | 4b0b98f8c6c040f38ba4f7146e8680f5 | auditors | | 519e6344f82e4c079c8e2eabb690023b | services | | 80bf5732752a41128e612fe615c886c6 | demo | | 98a2f53c20ce4d50a40dac4a38016c69 | admin | +----------------------------------+----------+
在
admin租户中创建名为bw-limiter的 QoS 策略:# neutron qos-policy-create 'bw-limiter' --tenant-id 98a2f53c20ce4d50a40dac4a38016c69
为
bw-limiter策略配置策略规则:# neutron qos-bandwidth-limit-rule-create bw-limiter --max_kbps 3000 --max_burst_kbps 300
配置一个 neutron 端口来应用
bw-limiter策略:# neutron port-update <port id> --qos-policy bw-limiter
查看 QoS 规则。例如:
# neutron qos-rule-show 9be535c3-daa2-4d7b-88ea-e8de16 +-------------------+---------------------------------+ | Field | Value | +-------------------+---------------------------------+ | id | 9be535c3-daa2-4d7b-88ea-e8de16 | | rule_type | bandwidth_limit | | description | | | max_kbps | 3000 | | max_burst_kbps | 300 | +-------------------+---------------------------------+
使用以下值来配置相应的策略算法:
-
max_kbps- 实例允许发送的最大速率(以 Kbps 为单位)。 -
max_burst_kbps- 接口可以发送的、超过策略数据的最大数据量(以 Kbps 为单位)。
10.3. QoS 策略的 RBAC
Red Hat OpenStack Platform 9 为 QoS 策略增加了 RBAC(Role-based Access Control - 基于角色的访问控制)。作为结果,现在可以针对于特定项目应用 QoS 策略。
例如,您现在可以为低优先级网络数据设置一个 QoS 策略,并只在特定项目中应用它。以下命令会把以前创建的 bw-limiter 策略分配给 demo 租户:
# neutron rbac-create 'bw-limiter' --type qos-policy --target-tenant 80bf5732752a41128e612fe615c886c6 --action access_as_shared

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.