This describes how to enable the QoS extension for OpenStack networking.
Enabling QoS
On all nodes edit the ini files using the crudini tool as
follows.
crudini --set --verbose /etc/neutron/plugins/ml2/openvswitch_agent.ini \ agent extensions qos crudini --set --verbose /etc/neutron/plugins/ml2/ml2_conf.ini \ agent extensions qosRestart OpenStack services on all nodes.
systemctl restart neutron-*On the controller node, verify whether all services are running.
openstack network agent listAn output example:
+------------------------+--------------------+----------+-----------+-------+-------+---------------------------+ | ID | Agent Type | Host | Avail...e | Alive | State | Binary | +------------------------+--------------------+----------+-----------+-------+-------+---------------------------+ | 09584195-3bd7-4fa4-... | Metadata agent | localhost| None ... | :-) | UP | neutron-metadata-agent | | 29b054e8-cf94-400f-... | Open vSwitch agent | cmp122 | None ... | :-) | UP | neutron-openvswitch-agent | | 2e085545-2fa5-48df-... | L3 agent | cmp122 | nova ... | :-) | UP | neutron-l3-agent | | 62136bda-e17a-4d5c-... | Open vSwitch agent | localhost| None ... | :-) | UP | neutron-openvswitch-agent | | 757e55de-9dea-4e4f-... | L3 agent | cmp110 | nova ... | :-) | UP | neutron-l3-agent | | 7f9a7a68-e36a-4aeb-... | DHCP agent | localhost| nova ... | :-) | UP | neutron-dhcp-agent | | b06e1ec9-615c-418d-... | L3 agent | localhost| nova ... | :-) | UP | neutron-l3-agent | | c5d19902-11c1-49bd-... | Open vSwitch agent | cmp110 | None ... | :-) | UP | neutron-openvswitch-agent | | efd05555-6a78-43c3-... | Metering agent | localhost| None ... | :-) | UP | neutron-metering-agent | +------------------------+--------------------+----------+-----------+-------+-------+---------------------------+Create VM instances. For example:
openstack server create --flavor m1.medium --image fedora --port port10 \ --availability-zone ::cmp122 vm1 openstack server create --flavor m1.medium --image fedora --port port20 \ --availability-zone ::cmp110 vm2If you create a VM instance with a new port or restart neutron-* services, you must remove flows on compute nodes. For example:
ovs-ofctl --strict del-flows br-int priority=200,reg3=0To check whether traffic between VM instances is not affected by any rules, log in to vm1 and start iperf in server mode.
iperf -sLog in to vm2 and start iperf to send traffic.
iperf -c <vm1_IP>
Useful commands for QoS
Commands to create/delete a QoS policy and rules.
- Create the new QoS
policy:
openstack network qos policy create <policy_name>
For example:openstack network qos policy create bw-limiter
- Create the ingress rule for the QoS
policy:
openstack network qos rule create --type bandwidth-limit --max-kbps 70000 \ --max-burst-kbits 1000 --ingress <policy_name_or_id>
For example:openstack network qos rule create --type bandwidth-limit --max-kbps 70000 \ --max-burst-kbits 1000 --ingress bw-limiter
- Create the egress rule for the QoS
policy:
openstack network qos rule create --type bandwidth-limit --max-kbps 70000 \ --max-burst-kbits 1000 --egress <policy_name_or_id >
For example:openstack network qos rule create --type bandwidth-limit --max-kbps 70000 \ --max-burst-kbits 1000 --egress bw-limiter
- Delete a rule for the QoS
policy:
openstack network qos rule delete <policy_name_or_id > <rule_id>
For example:openstack network qos rule delete bw-limiter 5c0c4655-c62b-42c7-9d68-40449f5790cd
- Delete the QoS
policy:
openstack network qos policy delete <policy_name_or_id >
For example:openstack network qos policy delete bw-limiter
Commands to attach/detach a policy.
- Apply the QoS policy to a
port:
openstack port set --qos-policy <policy_name_or_id> <port_name_or_id>
For example:openstack port set --qos-policy bw-limiter port10
- Remove the QoS policy from a
port:
openstack port unset --qos-policy <port_name_or_id>
For example:openstack port unset --qos-policy port10
- Apply the QoS policy to a
network:
openstack network set --qos-policy <policy_name_or_id> <network_name_or_id>
For example:openstack network set --qos-policy bw-limiter net1
- Remove the QoS policy from a
network:
openstack network set --no-qos-policy <network_name_or_id>
For example:openstack network set --no-qos-policy net1
Note: It is not possible to remove the egress rule from a port using the
unset action. You can manually remove the egress rule from a port on
a compute node as
follows.
ovs-vsctl destroy QoS <port_name> -- clear port <port_name> qosFor example:
ovs-vsctl destroy QoS dpdk0 -- clear port dpdk0 qos
Commands to verify rules for the QoS policy on a compute node.
- Verify ingress
parameters:
ovs-vsctl list interface <port_name> |grep ingress
For example:ovs-vsctl list interface dpdk0 |grep ingress
An output example:ingress_policing_burst: 1000 ingress_policing_kpkts_burst: 0 ingress_policing_kpkts_rate: 0 ingress_policing_rate: 700000
- Verify egress
parameters:
ovs-appctl -t ovs-vswitchd qos/show <port_name>
For example:ovs-appctl -t ovs-vswitchd qos/show dpdk0
An output example:QoS: dpdk0 egress-policer cbs: 125000 cir: 87500000
Commands to modify rules for the QoS policy.
- Update ingress
rules:
openstack network qos rule set --max-kbps 500000 --max-burst-kbits 800 \ --ingress <policy_name_or_id> <rule_id>
For example:openstack network qos rule set --max-kbps 500000 --max-burst-kbits 800 \ --ingress bw-limiter 5c0c4655-c62b-42c7-9d68-40449f5790cd
- Update egress
rules:
openstack network qos rule set --max-kbps 500000 --max-burst-kbits 800 \ --egress <policy_name_or_id> <rule_id>
For example:openstack network qos rule set --max-kbps 500000 --max-burst-kbits 800 \ --egress bw-limiter 6dcf5644-947c-4295-b12e-e159837e58f0