Building resource group templates

You can use the template builder to create topology templates to generate resource groups, which search your topology database for instances that match its conditions. These resource groups can then be searched for in the Topology Viewer and displayed.

Before you begin

You can access the Template builder from the Resource group templates page. You can also right-click a resource in a Topology viewer diagram and select Build a template from the context menu.

Procedure

  1. Log in to the IBM Cloud Pak for AIOps console.

  2. From the main navigation, click Resource management.

  3. Click the Resource group templates icon Resource group templates on the upper right corner of the page.

  4. From the Resource group templates page, click Create a new template. For more information about the type of template to use to group resources, see Template types.

  5. Click Start to begin building your template.

  6. Search for a resource to get started. Enter a resource name, type, or tags. As you type, a drop-down menu is displayed with suggested search terms that exist in the topology service. If you select one of these, the search results are displayed underneath the search field, with the results listed under separate columns in the results table for Resource name, Resource type, and Tags.

    • For each resource, expand the row to display the properties and property values.

    • If you are creating a Dynamic or Exact template, you can select a resource to view its topology.

  7. When you select a resource, a basic topology view centered around the resource as a seed is displayed in the Topology Visualization panel on the right.

  8. If you are creating a Tag-based template, you can either search for the tags directly on the Tags tab or drill down into the resources on the Resources tab.

  9. Enter a name for the template. The name must be unique. You can optionally enter a description.

    Restriction: The following special characters are not supported when specifying template names, custom group types, or tags:

    . ? + * | { } [ ] ( ) " \ # @ & < > ~
    

    If existing resources have names with these characters, you must change them before you can use them to define resource groups.

  10. From the drop-down list, select the resource group type that is being defined. This determines what the resource groups generated by your template are going to model (for example, cluster, network, or storage). You can also define your own Custom type, which will be added to the list of available Resource group types. If you select Custom type, a new text box opens, where you type a name for your new resource group type.

    • For Tag templates, provide a resource group name.

    • For Token templates, no resource group name is defined, as groups are automatically named based on the rule tokens.

    • For Dynamic and Exact templates, use name patterns that follow a defined topology. The seed name of the defined topology is substituted when a defined topology is generated, but you can define either a prefix, suffix, or both to create an appropriate name for each defined topology.

    Remember: Although an exact template type focuses on a single resource, it remains dynamic, which means as long as the seed resource itself remains unchanged, the defined topology can change through the removal or addition of connected resources or relationships.

  11. Choose an icon to associate with the template using one of the following methods:

    • From the Icon drop-down list:

    If you open the Icon drop-down list, all icons are listed by name in alphabetical order.

    • From the View all icons button:

    If you click View all icons, all icons are displayed in alphabetical order. Click an icon to associate it with the template.

    • From the Define new custom icon button:

    From here you can define a custom icon, which is automatically associated with the template when done.

  12. Add a tag to be included for each defined topology. With tags, you can group the individually generated resource groups by matching them to resources.

  13. Use the following information specific to the type of template you are building:

    • For Token templates, use the right hand side of the screen to define a new rule.

      Under Details, enter a unique Name for the rule. Define the Tokens for the rule, then click Add+ You can use variable substitution to combine more than one property value if required.

      Under Conditions, select observers to which this rule applies from the Observer name drop-down, or leave empty for all observers.

      Select providers to which this rule applies from the Provider name drop-down, or leave empty for all providers.

      Select resource types to which this rule applies from the Resource type drop-down, or leave empty for all resource types.

      Set the Token filter mode to either Exclude or Include, then define a filter (or filters) in the format of a regular expression. If you choose Exclude, tokens which match any one of the expressions will not be applied to resources. If you choose Include, only tokens which match one of the expressions will be applied to the applicable resources.

      Optionally, you can validate the filters using the Validate token filters button.

    • For Dynamic, Tag and Exact templates, use the Search functionality to find a seed resource (or tag).

      As you insert your cursor into the Search field, the five most recent searches are listed, and can be selected. You can delete a recent search by clicking the delete button (X) to the right of the suggested search.

      If you type in a search term, suggested search results are listed, which contain results both from the topology database and from recent searches, with your entered search text highlighted.

    When you select a search result, the found resources are listed by 'Resource name', 'Type' and 'Tags'. You can expand a resource to display its properties and values, or click its name to render a basic topology view centered around the resource as seed. The topology is displayed on the right of the Template builder.

  14. Depending on the type of template you have defined, you can Preview resource groups and refine the template further as required.

    Note: Token templates only apply rules and create groups as new observations are received from their designated observers, and therefore cannot be previewed.

    Tip: You can define a default layout for resource groups. When a resource group based on a template is selected, this default layout is used.

    Note: It might take some time for large resource groups to display in the Preview resource groups section. Also, the previous limit of 5,000 no longer applies, but you might want to consider that to generate and maintain a large number of matches can place additional strain on your system resources.

  15. Click Save template.

Result

Resource groups created from the templates can be viewed on the Resource management page.

**Remember:** Resource groups are updated automatically when the database is updated, and generated dynamically as they are displayed.