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 are then listed on the Resource management page.
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.
For more information about the type of template to use to group resources, see Template types.
About this task
You can create a new template, or edit or delete an existing template.
To create a new template, you construct a topology view centered around a seed resource. This lets you search your database for topologies with resources and relationships that match the conditions defined in the template.
These defined topologies are dynamically generated, maintained and updated, and can be searched for and accessed via the Resource management page. Resource groups are dynamically refreshed when accessed.
Dynamic changes to resource group: If edges or resources are removed that render an existing resource group that has already been indexed incomplete, it will remain available, and can therefore still be found and displayed via the search functionality, or via a previously created direct URL. If edges or resources are added or changed that render a resource group that was not indexed previously complete, the resource group will be indexed automatically, thereby becoming accessible via the search service.
Tip: The following special characters are not supported when specifying template names, custom group types, or tags:
. ? + * | { } [ ] ( ) " \ # @ & < > ~
Procedure
-
Log in to the IBM Cloud Pak for AIOps console.
-
From the main navigation, click Resource management.
-
Click the Resource group templates icon
on the upper right corner of the page.The Resource group templates page is displayed listing existing templates in a table format by name, type, number of resource groups, description, user, and date modified.
Tip: To reduce the number of templates displayed in the table, use the Filter table text field. The items displayed are filtered as you enter the search text.
From here, you can perform the following actions:
-
To reload the templates, click Refresh (top right). This can be useful if other users are customizing the templates.
-
To delete an existing template, select it in the table, then click Delete topology template. If you intend to recreate the template, be aware of the restrictions.
-
To edit an existing template, select it in the table, then click Edit topology template.
-
To create a new template, click Create a new template (top right). You are presented with a choice of template types. Select either a Dynamic, Tag based, Token, or Exact template, then click Start. The Template builder page is displayed, consisting of a topology view area on the right, and a number of template definition fields on the left.
For more information about the type of template to use to group resources, see Template types.
-
-
For new templates, enter a unique Template name (required).
Note: When you edit an existing template, the template definition and topology areas are already populated, and you cannot edit the Name and Type parameters. You edit the other parameters as for a new template, and when you do, the template definition and topology areas will change. If you require a template with a different name, you must create a new template.
-
Enter/edit the Description (optional).
-
For new templates, select an existing type from the Resource group type drop-down, or select Custom type from the drop-down. This determines what the resource groups generated by your template are going to model (for example,
cluster,network, orstorage).- If you select Custom type, a new text box opens, where you type a name for your new resource group type.
-
Define a resource group name or naming pattern.
-
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, the seed name of the resource group is used when a resource group is generated, but you can define either a prefix, suffix, or both to create an appropriate name for each of the dynamically generated resource group.
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.
-
-
For tag and token templates only: Select the hop type from the Resource group hop type drop-down.
-
If you select Element to element, the template displays all resources and connections when rendering the topology.
-
If you select Host to host, it displays only host resources and the connections between them.
-
-
Choose an icon to associate with the template from the drop-down, or click (+) to create a new icon. All resource groups based on this template will display the icon.
- You create a new icon on the New custom icon screen using SVG XML.
-
Enter a tag to be appended to each resource group, then click Add tag. With tags, you can group the individually generated resource groups by matching them to resources.
-
For Exact templates only: To (optionally) use the exact resource layout as specified when generating a new resource group, select the Maintain displayed resource position toggle.
Tip: To create an exact templates, you can first create a view with an exact layout in the Topology viewer and then use the context menu to create the template.
-
Complete the following steps (depending on the type of template you are building):
- For Exact, Dynamic and Tag templates, use Search for 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.
-
For Token templates, define a new rule:
In the Details section
- 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.
In the Conditions section
- Select the observers to which this rule applies from the Observer name drop-down, or leave the field empty to select 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, then tokens that 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 Exact and Dynamic templates only: Use the topology view tools to refine the topology.
You can apply filters, increase the hop count, change the layout, specify resource neighbors, follow adjacent relationships, and more. As you define the topology and with it the template conditions, a preview function retrieves information from the topology database, indicating the number of matches.
For more information on working with topologies, see the Viewing topologies topic.
-
Depending on the type of template you have defined, you can preview and refine, then generate resource groups.
-
For Exact, Dynamic and Tag templates: You can preview the resource groups that will be discovered by the template, then refine them if needed.
- Click Preview resource groups. A list of resource groups is displayed.
- Preview individual resource group topologies to verify that they meet your requirement. If they do not, refine your template further.
- Once your template meets all of its required conditions, click Save template & generate resource groups.
-
For Token templates: Token templates only apply rules and create groups as new observations are received from their designated observers, and therefore cannot be previewed.
- Click Save template.
Tip: 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.
-
Results
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.