Setting IOPS limits for a flavor

As with CPU limits, IOPS limits can also be imposed to prevent an instance type from hogging all of the available IO on a system. IOPS here refers to the storage and network IO. Also, as with CPU limits, IOPS limits are a special case of flavor attributes that you may encounter frequently.

Tip

At the time of this writing, the openstack command-line client is the only way to view and change this setting. It is also not shown by default when viewing instance attributes.

Getting ready

To add an IOPS limit to a flavor, you will need the following:

  • The openstack command-line client
  • The openrc file containing appropriate credentials
  • The name of the flavor to change
  • The value you would like to set the IOPS limit to.
  • In our example, these values are as follows:
  • disk_read_iops = 100 IOPS
  • disk_write_iops = 100 IOPS

How to do it…

The following commands are used to add IOPS limits to a flavor:

Tip

As with changing flavor attributes, IOPS limits are not applied to running instances. Rather, they are applied on instance launch.

  1. First, view the attributes of the flavor that is changing, noting that the properties field is blank:
    openstack flavor show openstack.cookbook
    

    This gives an output like the following:

    How to do it…
  2. Now we can add the IOPS limit with the following command:
    openstack flavor set
        --property quota:disk_read_iops=100
        --property quota:disk_write_iops=100
        openstack.cookbook
    

    Tip

    This command shows no output when successful.

  3. We can verify the IOPS limits by viewing the flavor properties:
    openstack flavor show openstack.cookbook
    

    This will bring back an output like the following, noting that we have now set the properties to reflect the IOPS imposed:

    How to do it…

How it works…

As with CPU limits, IO limits are defined at a flavor level. However, unlike CPU limits, IO limits can be applied by the hypervisor, the storage layer, or a combination of the two.

To set the IOPS limit values for a given flavor, the following openstack command is used:

openstack flavor set
    --property quota:disk_read_iops=[read_iops]
    --property quota:disk_write_iops=[write_iops]
    [name]

While both read and write IOPS are shown for completeness, you need not specify both.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.189.129