IBM Streams 4.2.1

Using tags to restrict externally managed resources

You can use tags to restrict externally managed resources for a specific application purpose by creating a tag restriction between the resource and a tag. This TagRestriction instructs the scheduler to place on the resource only the PEs that refer to a hostpool that specifies that tag.

About this task

You can use the Management Dashboard in the Streams Console to create a TagRestriction. Select Manage Resources and Tags to choose the resources and tags that you want to restrict.

For more information about the streamtool commands that are used to restrict resources, enter streamtool man command-name.

Procedure

Creating a TagRestriction with externally managed resources:

  1. Create the tag, for example
    streamtool mktag -d Domain1 SpecialPurpose
     --description "Special purpose tag used as an example to create a TagRestriction"
    Note: When the instance is started, a resource with a TagRestriction is created.
  2. Add a resource specification that includes the TagRestriction, for example:
    streamtool addresourcespec -d Domain1 -i Instance1
     --numresources 1,SpecialPurpose*
    Notes:
    • A resource specification with a TagRestriction contains the tag name with an asterisk (*).
    • If you already have a resource specification that includes the tag but not the TagRestriction, you can add the asterisk (*) to the end of the tag by using the streamtool chresourcespec command.
    • When creating an instance, you can specify a resource specification with a TagRestriction by using the streamtool mkinstance command.

Results

With the TagRestriction in place, in this example, the scheduler allows placements of PEs only if the PEs refer to a hostpool that specifies the SpecialPurpose tag.

What to do next

  • To remove the TagRestriction with externally managed resources, change the resource specification by removing the TagRestriction, for example:
    streamtool chresourcespec -d Domain1 -i Instance1
     --numresource 1,SpecialPurpose 2
    Note: The TagRestriction is removed by removing the asterisk (*) from the end of the tag.
    Note: In the example, 2 is the resource specification identifier.

  • To see which tags are restricted on the resources in a domain, use streamtool lsavailablehosts -d Domain1 or streamtool getdomainstate -d Domain1 command. In the command output, an asterisk (*) indicates that a tag is restricted.

  • To see which tags are restricted on the resources in an instance, use streamtool lshosts -d Domain1 -i Instance1 -l or streamtool getdomainstate -d Domain1 -i Instance1 command. In the command output, an asterisk (*) indicates that a tag is restricted.