Using Custom Attributes to Add Infrastructure Metadata

You can use vCommander custom attributes to provide more management information about your virtualized infrastructure. For example, you could design custom attributes so that budget or profit center code information for a VM or an asset number for an infrastructure element can be applied.

You can configure any custom attribute so that a Service Portal user can edit that attribute's associated value, and vCommander allows you to use regular expressions to enforce the provided values that use a text type. Enforcing a format can be helpful, for example, when values will be used as input to scripts, or when VM asset information is required in order to comply with corporate standards.

Once you've created custom attributes, they can be used in reporting, in workflows and in script execution.

In this topic:

Elements that custom attributes can be applied to

You can apply custom attributes to the following infrastructure elements:

  • Services, including VMs, load balancers, databases, virtual services, stacks and auto scaling groups
  • Custom attribute values applied to virtual services, stacks and auto scaling groups aren't inherited by their children.

  • Managed systems
  • Folders
  • Datacenters
  • Compute clusters
  • Hosts
  • Resource pools
  • Datastores
  • Regions
  • Virtual networks
  • Availability zones
  • Azure resource groups
  • GCP projects
  • GCP organizations
  • GCP zones

Predefined custom attributes

In addition to user-defined custom attributes that you configure to specifically suit your requirements then apply to infrastructure elements, some predefined custom attributes are provided for convenience or for specific use cases.

The following predefined custom attributes are included as examples for you to get started and may be edited:

  • Cost Center
  • PCI Applicable
  • Primary Application
  • Project Code
  • Service Type
  • SLA
  • SOX Applicable

Additional Costs custom attribute

The Additional Costs custom attribute, which applies only to AWS stacks and VMs deployed from Amazon Marketplace AMIs, has a unique function.

For stacks, this custom attribute captures the cost of resources in the stack that aren't supported by vCommander. If a value was set for the Annual Stack Costs in the service catalog, vCommander automatically assigns a value for this custom attribute to stacks deployed from service requests.

For VMs deployed from Marketplace AMIs, this custom attribute captures costs in addition to instance type costs. If a value was set for the Additional Annual Cost in the service catalog, vCommander automatically assigns a value for this custom attribute to VMs deployed from service requests for Marketplace AMIs.

This custom attribute can't be edited or deleted. vCommander users can assign a value for this attribute, but Service Portal users can't. See the "Annual Stack Cost" field in Adding an AWS Service to the Catalog for more information.

Form-only custom attributes

You can create custom attributes that apply only to service request forms. Form attributes are useful for capturing information required only during the service request process. Form attribute values don't persist once the completion workflow has finished and aren't assigned to deployed services. Note that you also need to add the Custom Attribute or the Multi-Select element to the service request form.

Placement attributes

Placement attributes are a special type of custom attributes used in Intelligent Placement. See Configuring Attributes for Intelligent Placement.

Custom attributes based on public cloud tags

You can import public cloud tags, such as Cost Center, Business Unit, Product, Tier or Version, as vCommander custom attributes. See Synchronizing AWS Tags and vCommander Metadata and Synchronizing Azure Tags and vCommander Metadata to learn how.

Creating and editing custom attributes

Access through:

Configuration menu > Custom Attributes

Available to:

vCommander Roles of Superuser and Enterprise Admin

To create a new custom attribute or editing an existing custom attribute:

  1. On the Custom Attributes page, do one of the following:
    • To add a custom attribute, click Add.
    • To edit a custom attribute, select a listed custom attribute and click Edit.
  2. 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 an infrastructure element, or for administrators to select when adding custom attributes to a request form.

    Caution: Don't create:

    • an attribute that is already defined in vCommander or duplicates the name of a policy within vCommander
    • an attribute named Expiry Date, Primary Owner, or IT Contact, because these attributes are already available to work with the Compliance policy
    • However, you can create new custom attributes that are variations of the existing attributes (for example, Cost Center Europe).

  3. Optional: In the Description field, enter descriptive text for the custom attribute.

    The details that you enter here will be displayed when a user selects a custom attribute name.

  4. From the Type drop-down list, select the attribute type:
    • Text allows users to enter text values. You can allow either free-form text or enforce a specific format.
    • List allows you to define values that users can select from a drop-down menu.
    • Sublist allows you to define allowed values for each value of another custom attribute. See Creating relationships between custom attributes below.

      If you select Sublist, the Sublist Of drop-down appears. Select the custom attribute that will act as the "parent" attribute. See Creating relationships between custom attributes below.

    If you are editing an existing custom attribute, 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. You can rename a list-type attribute value, move its position in the list of selectable values, or delete it from the list of values.

  5. If you want to use the custom attribute for Intelligent Placement, enable the Placement Attribute option. See Configuring Attributes for Intelligent Placement for more information.
  6. You can only enable the Placement Attribute option if the Type is set to List.

  7. From the Apply To menu, select the virtual infrastructure element that you want the custom attribute to be available for, or select Form to create a custom attribute to capture information required only during the service request process (form attributes aren't attached to deployed services). Note that Services includes all service types (VMs, load balancers, databases, virtual services, stacks and auto scaling groups).

    Select All if:

    • the infrastructure element where you want to apply a custom attribute doesn't appear in the drop-down menu (for example, datacenter)
    • 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.

  8. To allow a user to change the value of the attribute in the Service Portal, enable Edit in Service Portal.

    Service Portal users can change the value only if their Service Portal role has the required permission. However, custom attributes created by importing AWS tags are automatically set to disallow editing by Service Portal users.

  9. On the Configure Attribute page, configure the acceptable values.

    Text Type

    List Type

    Sublist Type

    1. To allow users to enter text in any format, select Free Form and click Finish.

      or

    2. To enforce a format, select Specific 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 test your validation error message, enter text that won't pass validation. For example, enter an invalid project code. The validation error message should appear.

    3. Click Finish.
    4. Notes:

      • Text-type custom attribute values support a maximum of 4096 characters.
      • 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.
    1. Enter a comma-separated list of allowed values for the attribute and click Add. The maximum number of characters for each value is 100.

      or

    2. enter each value separately and click Add.

    3. Click Finish.

    For each value of the parent attribute, enter a comma-separated list of allowed values for the sublist attribute.

    1. Click a value in the list and enter values in the text field, then click Add.
    2. Click another value in the list and enter values for it, and click Add.

      If required, use the Move Up and Move Down buttons to arrange the allowed values in the tree.

    1. Click Finish.

We recommend that you complete all in-progress service requests before you begin using a custom attribute that enforces a specific format. If a custom attribute value specified on the request form doesn't match the required format, automated deployment of the service will fail, and manual deployment will be required. Likewise, if a custom attribute value is specified in a completion workflow and the value doesn't match the required format, you'll need to edit the workflow step for any in-progress service requests.

Deleting custom attributes

Access through:

Configuration menu > Custom Attributes

Available to:

vCommander Roles of Superuser and Enterprise Admin

To delete a custom attribute:

  1. On the Custom Attributes page, select a custom attribute, and click Delete.
  2. Click Yes to confirm the deletion.

    Notes:

    • A custom attribute in use by a Compliance policy can't be deleted.
    • If the custom attribute you're deleting has sublist attributes, the confirmation dialog provides a list of sublist attributes. If you confirm the deletion, the sublist attributes are also deleted.

What's next?

  • To add the custom attribute to a request form, see Customizing Service Request Forms.
  • To specify a fixed cost for each value of a List Type custom attribute, see Configuring Cost Models.
  • To calculate a custom cost for each value of a List Type custom attribute, see Calculating Custom Costs.
  • To edit a custom attribute: Select it and click Edit. 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. You can rename a list-type attribute value, move its position in the list of selectable values, or delete it from the list of values.

Creating relationships between custom attributes

Access through:

Configuration menu > Custom Attributes

Available to:

vCommander Roles of Superuser and Enterprise Admin

You can create relationships between list-type custom attributes that are used on service request forms, so that the value selected for one custom attribute affects the selectable values for one or more other custom attributes. These relationships allow you to prevent requesters from making invalid form choices.

For example, if you want requesters to specify the machine role, either database server or web server. If they choose database server, the form could prompt them to choose a database application (Microsoft SQL or Postgres). If they choose Postgres, the form could prompt the requester to choose from the available Postgres versions.

The steps required to configure this example are:

  1. Create a List custom attribute called Machine Role
  2. Create a Sublist attribute called Application
  3. Create a Sublist attribute called Application Version
  4. Add the custom attributes to the service catalog blueprint

Once the above steps are completed, the component section of the service request form will show the three attributes.

Notes:

  • The relationship between two attributes is visible only on new service request forms and service change request forms. Selectable values aren't filtered for sublist attributes when applying custom attributes to services in other ways, such as applying values directly in vCommander or the Service Portal, or through workflows.
  • When the parent attribute is a placement attribute, all of its sublist attributes are also placement attributes. Likewise, when the parent attribute is a custom attribute, all of its sublist attributes are custom attributes (that is, they don't affect placement). If a custom attribute is changed into a placement attribute, all of its sublist attributes are also changed into placement attributes. If a placement attribute is changed into a custom attribute, all of its sublist attributes are also changed into custom attributes.

Create a List custom attribute called Machine Role

  1. On the Custom Attributes page, click Add.
  2. In the Configure Attribute dialog, enter "Machine Role" for the name.
  3. From Type, select List.
  4. From Applies To, select Form to create a custom attribute to capture information required only during the service request process (form attributes aren't attached to deployed services), then click Next.

    You can apply the custom attribute to All Types as well, which includes forms, but the relationship between attributes is visible only on request forms.

  5. On the Configure Attribute page, type a comma-separated list of values that users can select from a drop-down menu list for the attribute and click Add. The maximum number of characters for each value is 100. For this example, type "Database Server,Web Server".

    You can also enter each value separately and click Add for each one.

  6. Click Finish.

Create a Sublist attribute called Application

  1. On the Custom Attributes page, click Add.
  2. In the Configure Attribute dialog, enter "Application" for the name.
  3. From Type, select Sublist.
  4. From Sublist Of, select Machine Role, then click Next.

    The Sublist Of option allows you to define child allowed values for the defined values of another custom attribute (in this case, Machine Role was the custom attribute created in a previous step).

    Define Attribute

  5. On the Configure Attribute page, for each value of the parent attribute, enter a comma-separated list of allowed values:
    • Click a value in the list and enter values in the text field, then click Add.
    • Then, click another value in the list and enter values for it, and click Add.
    • You can also use the Move Up and Move Down buttons to arrange the allowed values in the tree.

      The image below shows that we've added two server types to Database Server, but we haven't yet added the new values for Web Server.

      Configure Attribute dialog

  6. Click Finish.

Create a Sublist attribute called Application Version

Now we'll create another level of relationship.

  1. On the Custom Attributes page, click Add.
  2. In the Configure Attribute dialog, enter Application Version for the name.
  3. From Type, choose Sublist.
  4. From Sublist Of, choose Application, then click Next.
  5. On the Configure Attribute page, for each application, enter available versions as shown below.

    Configure Attribute dialog

  6. Click Finish.

Add the custom attributes to the service catalog blueprint

To make these custom attributes available on the new service request form, we need to add the three attributes to the blueprint. (We could also add these attributes to a service change request form.)

  1. Edit a service catalog entry.
  2. On the Component Blueprints page, go to the Attributes tab, and click Add Attributes.
  3. In the Add Attributes dialog, enable all three custom attributes we created above, and click OK.

    vCommander automatically places the attributes in the correct order, from parent to child to grandchild.

    sublist-attrib-blueprint

  4. If you want, you can select default values for one or more of the attributes. In this example, we aren't setting defaults.
  5. Click the Form tab of the blueprint.
  6. In the Toolbox, under Attributes, click all three attributes to add them to the form.
  7. Use the up and down arrow buttons to position them in a logical order.
  8. We want to force requesters to select a value for each attribute, so for each attribute click Edit, enable the Required option, and the click OK.

    sublist-attrib-bp-form

  9. Click Finish.

Request the service

Now, when a user requests a service, the component section of the form shows the three attributes, and selecting a Machine Role limits the selectable values for Application, and selecting an Application limits the selectable values for Application Version. The example below shows a request for the service made through the Service Portal.

New Service Request

Applying custom attribute values

Access through:

Views menu > Operational, Deployed, or Storage

Available to:

Administrator and All Operator Levels of Access Rights

vCommander allows you to apply an unlimited number of custom attributes to services and infrastructure elements. You can manually apply custom attributes on:

  • an infrastructure element such as a managed system, datacenter, folder, datastore, host or resource pool

    When you select an infrastructure element in the tree (including a virtual service), custom attribute values aren't inherited by its children. To ensure that custom attribute values are applied as expected, right-click services in a table.

  • a service, such as a VM, virtual service

Additional ways to apply custom attribute values, include:

To set a custom attribute value:

  1. Go to a service or infrastructure element in the tree or in a table, then do the following:
    • For a VM, right-click and choose Lifecycle Management > Set Custom Attributes.
    • For all other elements, right-click and select Set Custom Attributes.

      The Set Custom Attributes dialog displays all available attributes for the selected element. (To view a description of the attribute name, mouse over the name.)

  2. For a list-type custom attribute, select a value in the drop-down list. For a text-type custom attribute, enter a value (up to 4096 characters) in any or all of the Value fields.
  3. If you've configured costs for custom attributes, use the Value field to enter the cost. Enter a number only, such as 500 or 67; don't enter a currency symbol. See Specifying how costs for custom attributes are displayed.

  4. Click OK.

    If the custom attribute has a required format, a validation error is displayed for input that doesn't match the required format.

Troubleshooting: See the Knowledge Base article Warning: There Are No Custom Attributes Defined in the System.

Viewing custom attribute values

Access through:

Views menu > Operational, Deployed, or Storage

Available to:

All Access Rights Levels

For any selected VM, virtual service or infrastructure element, you can view the custom attribute values on the element's Details pane.

If you don't see any custom attributes in the Details pane, right-click anywhere in the Details pane, select Pick Properties, and select available custom attributes. For more information, see Customizing the vCommander Display.

You can also select an infrastructure element from the tree and click Set Custom Attributes. All available custom attributes and their assigned values, if any, appear in the dialog.

More information

For more information on how you can use custom attributes in vCommander, see also the following Knowledge Base articles: