Work with Custom Attributes
This topic discusses how to work with custom attributes in Commander.
Create custom attributes
Access: | Configuration > Custom Attributes |
Available to: | Commander Roles of Superuser and Enterprise Admin |
- On the Custom Attributes page, click Add.
You can search for a custom attribute by name or description.
- In the Configure Custom Attribute dialog, enter a name for the custom attribute.
This is the name that appears for users to select when they apply an attribute to a service, infrastructure element, or organization.
Although you shouldn't create an attribute that's already defined in Commander or duplicates the name of a policy within Commander, you can create new custom attributes that are variations of existing attributes (for example, Cost Center Europe). See Predefined custom attributes.
- Optional: Enter a Description.
The details that you enter here will be visible to users.
- From Attribute Type, select the attribute type:
- Inventory — Inventory custom attributes can be applied to services or infrastructure elements. See Inventory custom attributes.
- Form — Form custom attributes are used to capture information required only during the service request process (form attributes aren't attached to deployed services). See Form custom attributes.
- Organization — Organization custom attributes allow you to segregate organization-specific information and customize workflows to meet each organization's needs. See Organization custom attributes.
If you're editing an existing custom attribute, you can't change the attribute type. If you want to change the attribute type, you must delete the attribute and create it again with a different type.
- To use an Inventory or Form custom attribute for Intelligent Placement, select the Placement Attribute checkbox. For more information, see Configure Placement Attributes.
- From Input Type, select the input type:
- List — Allows you to define values that users can select from a drop-down.
- Text — Allows users to enter text values. You can allow either free-form text or enforce a specific format. A maximum of 4096 characters is supported.
- Sublist — Allows you to define allowed values for each value of another custom attribute. For more information, see Create Relationships Between Attributes Used on Forms.
If you select Sublist, the Sublist drop-down appears. Select the custom attribute that will act as the "parent" attribute.
- For Inventory custom attributes with Input Type set to List or Text, from Applies To, do one of the following:
- Select the virtual infrastructure element that you want the custom attribute to be available for. Services includes all service types (VMs, load balancers, databases, virtual services, application stacks, auto scaling groups, and Kubernetes namespaces).
- Select All Types if:
- The infrastructure element where you want to apply a custom attribute doesn't appear in the drop-down (for example, a datacenter, a Kubernetes managed cluster, or a Kubernetes namespace).
- You want the custom attribute to be available for all infrastructure elements.
Custom attributes configured to be available for All Types can also be added to request forms through the Custom Attribute form element. In this case, selected values are applied to deployed services. See Service Request Form Elements.
- For Inventory custom attributes, to allow a user to view or set the value of the custom attribute in the Service Portal, select Accessible in Service Portal.
- Service Portal users can set a value only if their role has the required permission. For more information, see Customize Service Portal Roles for Users.
- If Commander is configured to import AWS, GCP, or Azure tags as Commander custom attributes, but isn't configured to export Commander custom attributes as tags, we recommend keeping this checkbox cleared for all custom attributes created from public cloud tags. Otherwise, if a user sets an attribute value, the value will be removed during the next public cloud synchronization. By default, this checkbox is cleared for all custom attributes created from imported tags. For more information on importing tags as custom attributes, see Tag and Label Enforcement.
- On the Configure Attribute page, configure the acceptable values for the input type you selected:
List — To add list values, do either of the following:
- Enter each value separately and click Add.
- Enter a comma-separated list of allowed values for the attribute and click Add.
The maximum number of characters for each value is 100.
- To specify a fixed cost for each value of a list type custom attribute, see Custom page.
- To calculate a custom cost for each value of a list type custom attribute, see Calculate Custom Costs.
- Text — Select one of the following:
- Free Form — Allows users to enter text in any format.
- Specific Format — Forces users to follow a set text format.
- In the Regular Expression field, enter a regular expression.
- In the Validation Error Message field, enter a message that users will see if they enter text that doesn't conform to the regular expression.
- In the Entry to test against field, to test your regular expression, enter text that should pass validation. For example, if you're enforcing a project code, enter a valid project code.
To avoid format conflicts, Text type custom attributes used in cost models shouldn't contain regular expressions. All custom attributes used in cost models are validated as positive numbers. For more information, see Cost Models.
- Sublist — To add sublist values, do the following:
- Click a parent attribute in the list and enter a comma-separated list of allowed sublist values in the text field, then click Add.
- Repeat for each parent attribute you want to have sublist values.
- Click Finish.
You can only select the Placement Attribute checkbox if the Type is set to List.
Use the Move Up and Move Down buttons to position the allowed values.
Edit custom attributes
You can make changes to existing custom attributes, such as the attribute's name, description, its value, or the position of those values in a selectable list.
However, you can't change the attribute type. If you want to change the attribute from a text to a list type or from a list to a text type, you must delete the attribute and configure it again.
Access: | Configuration > Custom Attributes |
Available to: | Commander Roles of Superuser and Enterprise Admin |
- On the Custom Attributes page, select a custom attribute, and click Edit.
- In the Configure Custom Attribute dialog, make the configuration changes required.
- Click Finish.
Delete custom attributes
A custom attribute in use by a tag compliance policy can't be deleted.
Access: | Configuration > Custom Attributes |
Available to: | Commander Roles of Superuser and Enterprise Admin |
- On the Custom Attributes page, select a custom attribute, and click Delete.
- Click Yes to confirm the deletion.
If the custom attribute you're deleting has sublist attributes, the confirmation dialog provides a list of sublist attributes. When you confirm the deletion, the sublist attributes are also deleted.
Apply inventory custom attribute values
You can apply an unlimited number of inventory custom attributes to services and infrastructure elements. You can manually apply custom attributes to:
- An infrastructure element such as a cloud account, Kubernetes cluster, datacenter, folder, datastore, host, or resource pool.
- A service, such as a VM, virtual service, or Kubernetes namespace.
- Custom attribute values set for a parent element, such as a virtual service or application stack, aren't inherited by its children.
- If Commander is configured to import AWS, GCP, or Azure tags as Commander custom attributes but isn't configured to export Commander custom attributes as tags, a value set for a custom attribute created from an imported tag will be overwritten during the next public cloud synchronization.
Besides manually applying custom attribute values as described here, you can also set custom attributes on a service request form, with a workflow step, during manual deployment, and through the tag compliance policy.
Access: | Views > Inventory |
Available to: | Administrator and All Operator Levels of Access Rights |
- Click the Infrastructure, Applications, or Storage tab.
- Select a service or other element in the tree or in a table, then do the following:
- For a selected VM, select Action > Lifecycle Management > Set Custom Attributes.
- For all other selected elements, select Actions > Set Custom Attributes.
The Set Custom Attributes dialog displays all available attributes for the selected element.
To view an attribute's description, hover over its name. Descriptions beginning with "Automatically generated from" indicate custom attributes imported from AWS, GCP, or Azure tags.
- For a list-type custom attribute, select a value from the list. For a text-type custom attribute, enter a value in any or all of the Value fields.
- Click OK.
If the custom attribute has a required format, a validation error is displayed for input that doesn't match the required format.
If this is a Cost custom attribute, use the Value field to enter the cost. Enter a number only, such as 500 or 67. For more information, see Custom page in Configure Cost Models.
View inventory custom attribute values
Access: | Views > Inventory > Infrastructure, Applications, or Storage |
Available to: | All Access Rights Levels |
When you select a resource from the Inventory tree, you can view its custom attribute values in the Details section of the Summary page for the resource.
If you don't see any custom attributes in the Details section, beside Details, click Pick Properties. In the Property Selection dialog, select available custom attributes. For more information, see Customize the Admin Portal Display.