0 0

Ask Rick: TGC Service Groups and QoS Redux

Rick Ehrhart is Tintri’s Developer Evangelist, Engineering. In his column, Rick solves IT problems with one simple solution: Tintri storage. Got a question? Let us know.

With TGC 2.1, is there a new way to set QoS at scale?

In a previous blog on TGC Service Groups and QoS, the TGC Service Group was used as a container for VMs and QoS was set for each VM in TGC Service Group. Now TGC 2.1 with API version v310.31, QoS can be set at the TGC Service Group. This means that a connection to each VMstore doesn't have to be made. Along with QoS, replication and snapshot configuration can now be set at the TGC Service Group level. TGC Services Groups can be used as Storage Service Catalogs. More on this in later posts, but this post shows how to set QoS on a TGC Service Group.

This Python script uses a new method, api_version() to obtain the version and product information. The api_version() method returns the same thing as the \info API. The change was made to support disabling the SSL warning when connecting to the VMstore.

# Get the preferred version and product
r = tintri.api_version(server_name)
json_info = r.json()
preferred_version = json_info['preferredVersion']
product_name = json_info['productName']

This time we check that the minor version is 31.

if minor_version < 31:
    print_error("Incorrect minor Version: " + minor_version + ".  Should be 31 or greater")

Next, we get the TGC service groups as the previous script did:

url = "/v310/servicegroup"
r = tintri.api_get(server_name, url, session_id)

When the script finds a qualified TGC Service Group, the TGC Service Group unique identifier, sg_uuid is saved. This sg_uuid is used later to set the QoS.

As you might recall, the previous script had to collect live VMs in the TGC Service group, but now with the new feature, QoS is set directly on the TGC Service Group in set_qos(). Setting the QoS on a TGC Service Group is done in two steps:

Step 1: Configure the QoS:

# Create new QoS object with the fields to be changed
modify_qos_info = {'minNormalizedIops': int(new_min_value),
                   'maxNormalizedIops': int(new_max_value),
                   'typeId': 'com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineQoSConfig'# Configure the QoS for the service group
modify_qos_url = "/v310/servicegroup/" + sg_uuid + "/qosConfig"
r = tintri.api_put(server_name, modify_qos_url, modify_qos_info, session_id)

Step 2: Apply the QoS configuation:

# Apply the QoS values that were for the service group that were configured above.
apply_qos_url = "/v310/servicegroup/" + sg_uuid + "/qos"
r = tintri.api_post(server_name, apply_qos_url, None, session_id)

As you can see, setting the QoS on a TGC service group is more straight-forward. There is no Multiple Selection Request to each VMstore.

This code is located at set _qos _tgc _service _group.py on the Tintri GitHub site.

Enjoy servicing IOPs,

Rick Ehrhart / Nov 05, 2015

Rick Ehrhart is Tintri’s Developer Evangelist with a strong software development background focusing on APIs. Rick has assisted many companies with API integrations including VMware, NetApp, HP, ...more