Place instances on hosts with sufficient bandwidth

Apply a minimum bandwidth QoS policy to ensure instances are placed on hosts with sufficient bandwidth.

Before you begin

  • Your administrator has enabled the Networking service with the qos and the placement service plugins. The qos service plugin is loaded by default.
  • The administrator has created a project for you and has provided you with a clouds.yaml file for you to access the cloud.
  • The python-openstackclient package is on your workstation.
    $ dnf list installed python-openstackclient
  • The Networking service must support the following API extensions:
    • agent-resources-synced
    • port-resource-request
    • qos-bw-minimum-ingress
  • You must use the ML2/OVN or ML2/SR-IOV mechanism drivers.
  • You can only modify a minimum bandwidth QoS policy when there are no instances using any of the ports the policy is assigned to. The Networking service cannot update the Placement API usage information if a port is bound.
  • The Placement service must support microversion 1.29.
  • The Compute service (nova) must support microversion 2.72.

Procedure

  1. Confirm that the system OS_CLOUD variable is set for your cloud:
    $ echo $OS_CLOUD
    my_cloud

    Reset the variable if necessary:

    $ export OS_CLOUD=my_other_cloud

    As an alternative, you can specify the cloud name by adding the --os-cloud <cloud_name> option each time you run an openstack command.

  2. Confirm that the qos service plugin is loaded in the Networking service:
    $ openstack network qos policy list

    If the qos service plugin is not loaded, then you receive a ResourceNotFound error, and you must load the qos services plugin before you can continue. For more information, see your RHOSO administrator.

  3. Identify the ID of the project you want to create the QoS policy for:
    $ openstack project list
    Sample output
    +----------------------------------+----------+
    | ID                               | Name     |
    +----------------------------------+----------+
    | 4b0b98f8c6c040f38ba4f7146e8680f5 | auditors |
    | 519e6344f82e4c079c8e2eabb690023b | services |
    | 80bf5732752a41128e612fe615c886c6 | demo     |
    | 98a2f53c20ce4d50a40dac4a38016c69 | admin    |
    +----------------------------------+----------+
  4. Using the project ID from the previous step, create a QoS policy for the project.
    Example

    In this example, a QoS policy named guaranteed_min_bw is created for the admin project:

    $ openstack network qos policy create --share \
     --project 98a2f53c20ce4d50a40dac4a38016c69 guaranteed_min_bw
  5. Configure the rules for the policy.
    Example

    In this example, QoS rules for ingress and egress with a minimum bandwidth of 40000000 kbps are created for the policy named guaranteed_min_bw:

    $ openstack network qos rule create \
     --type minimum-bandwidth --min-kbps 40000000 \
     --ingress guaranteed_min_bw
    $ openstack network qos rule create \
     --type minimum-bandwidth --min-kbps 40000000 \
     --egress guaranteed_min_bw
  6. Configure a port to apply the policy to.
    Example

    In this example, the guaranteed_min_bw policy is applied to port ID, 56x9aiw1-2v74-144x-c2q8-ed8w423a6s12:

    $ openstack port set --qos-policy guaranteed_min_bw \
     56x9aiw1-2v74-144x-c2q8-ed8w423a6s12