Creating QoS policies

To create a QoS policy with rules, do the following:

  1. Connect to the OpenStack command-line interface, as described in Connecting to OpenStack command-line interface.
  2. Create a QoS policy:

    • If you used the environment file for a system administrator, create a policy within a project it will be applied to:

      # openstack --insecure network qos policy create \
      --project 3823a2d908ea4dd6909a8f93a6f66018 policy1
      +-------------+------------------------------------------------+
      | Field       | Value                                          |
      +-------------+------------------------------------------------+
      | description |                                                |
      | id          | 8e2511c9-7db5-456c-b8ee-939f7729d981           |
      | is_default  | False                                          |
      | location    | Munch({'project': Munch({'domain_name': None,  |
      |             | 'domain_id': None, 'name': None,               |
      |             | 'id': u'3823a2d908ea4dd6909a8f93a6f66018'}),   |
      |             | 'cloud': '', 'region_name': '', 'zone': None}) |
      | name        | policy1                                        |
      | project_id  | 3823a2d908ea4dd6909a8f93a6f66018               |
      | rules       | []                                             |
      | shared      | True                                           |
      | tags        | []                                             |
      +-------------+------------------------------------------------+
      
    • If you used the environment file for a domain administrator, create a policy, as outlined in Creating QoS policies as a domain administrator.

      To be able to create and manage network QoS policies, a domain administrator needs to have the quota manager role assigned.
  3. Create a rule for the QoS policy:

    • To create a bandwidth limit, specify bandwidth-limit for the --type option and specify rule parameters. For example, to limit the egress traffic to 3 Mbps, run:

      # openstack --insecure network qos rule create --type bandwidth-limit \
      --max-kbps 3000 --max-burst-kbits 2400 --egress policy1
      +----------------+--------------------------------------------------+
      | Field          | Value                                            |
      +----------------+--------------------------------------------------+
      | direction      | egress                                           |
      | id             | 6f036f09-d952-420d-986b-27c7eb14b2da             |
      | location       | Munch({'project': Munch({'domain_name': Default, |
      |                | 'domain_id': None, 'name': admin,                |
      |                | 'id': u'e215189c0472482f93e71d10e1245253'}),     |
      |                | 'cloud': '', 'region_name': '', 'zone': None})   |
      | max_burst_kbps | 2400                                             |
      | max_kbps       | 3000                                             |
      | name           | None                                             |
      | project_id     |                                                  |
      +----------------+--------------------------------------------------+
    • To create a minimum bandwidth guarantee, specify minimum-bandwidth for the --type option and specify rule parameters. For example, to guarantee the minimum of 100 Kbps to the ingress traffic, run:

      # openstack --insecure network qos rule create --type minimum-bandwidth \
      --min-kbps 1000 --ingress policy1
      +------------+--------------------------------------------------+
      | Field      | Value                                            |
      +------------+--------------------------------------------------+
      | direction  | ingress                                          |
      | id         | 4eb79c67-e2b7-4ee7-845c-4cbe39f095cd             |
      | location   | Munch({'project': Munch({'domain_name': Default, |
      |            | 'domain_id': None, 'name': admin,                |
      |            | 'id': u'e215189c0472482f93e71d10e1245253'}),     |
      |            | 'cloud': '', 'region_name': '', 'zone': None})   |
      | min_kbps   | 1000                                             |
      | name       | None                                             |
      | project_id |                                                  |
      +------------+--------------------------------------------------+