Unsupported content This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

Passing deployment data using tokens


When creating service blueprints, you can leverage deployment data such as hostnames and IP addresses in your software packages and post deployment actions using tokens. This capability enables you to easily deploy complex, high value services with parameters that are dynamically evaluated at runtime.

This topic includes the following sections:

Overview

You can define parameters at the service blueprint level and at the option level for a particular resource set.

You can also use parameter tokens, such as HostName and IP address, that are defined or assigned in another resource set in the same blueprint. These tokens are applicable for software deployment, BMC Atrium Orchestrator workflows, or any deployment scripts (such as BMC Server Automation NSH scripts).

For example, consider the following scenario:

  • A service blueprint has a service deployment definition with a resource set that installs BMC AR System Mid-tier. This resource set requires the hostname of the BMC AR System server that was installed previously as a part of the initial resource set deployment in the same blueprint.
  • Create a hostname variable in BMC Server Automation. The hostName variable is defined as a local property in the BMC Server Automation package that deploys the BMC AR System Mid-tier resource set.
  • When defining the resource set for the mid-tier deployment, create a token that obtains the hostname from the previous resource set which installed the BMC AR System Server.
  • The BMC AR System Server deployment passes the AR hostName as a value to the hostname variable in BMC Server Automation.

Before you begin

Including a pre-defined parameter token in a service blueprint

  1. In the Service Blueprints Definition editor, click the Service Definition tab.
     You can define parameters in the Service Deployment Definitions tab after you create the service definition.
  2. Click Parameters.
  3. Click New plus_icon.gif. The Parameter dialog box is displayed.
    Parameter_DB_token.gif
  4. Enter a unique parameter name. This name must be the same name as the one used in the BMC Server Automation package or script. For example, if the parameter in the BMC Server Automation component template has a name of domainControllerName, then you must use the same name as the parameter in BMC Cloud Lifecycle Management.

    Note

    You cannot edit this value later. If you made a mistake, delete the parameter and create a new one.

  5. Optionally, enter a short description for your reference.
  6. Select a data type of Token.

    Note

    You cannot modify data types later.

    The Token type option is displayed.
    Parameter_DB_token_options.gif

  7. Select the Token Type. Depending on which token type you select, only specific options are displayed. The options are combined to build the path of the compute attributes included in the resource set that uses the token. The following token types are available, each with applicable sub-options:

  8. Optionally, click Required.

    Note

    If you choose to make the parameter required, then there must be a value for the token, otherwise the related action will fail. Also, if this option is not marked as Required but is required in BMC Server Automation, the related action would fail if the evaluation of token does not result in any value.

  9. Click OK to close the dialog box.
  10. Click Saveto commit the blueprint and all your changes.

    Note

    You can also use tokenized parameters when setting up option choices for the end-user in a service blueprint. See Configuring-end-user-Option-Choices-in-service-blueprints for information about defining option choices.

Creating a custom token

  1. Follow steps 1 through 7 in Including a pre-defined parameter token in a service blueprint.
  2. Select a Token Type of Advanced Editor
  3. Select a token string from the drop-down list. The drop-down list displays following items:
  4. Click browse.gifand edit the token string, as shown below.
    pass_data_token.gif
    You can edit parts of the above paths that are enclosed in angle brackets ( < > ).
  5. Click OK to save the edited path.
  6. Optionally, you can also create your own token string. For examples of how you would construct a token, see Token examples.
  7. Optionally, click Required.

    Note

    If you choose to make the parameter required, then there must be a value for the token, otherwise the related action will fail. Also, if this option is not marked as Required but is required in BMC Server Automation, the related action would fail if the evaluation of token does not result in any value.

  8. Click OK to close the dialog box and save the parameter.
  9. Click Saveto commit the blueprint and all your changes.

    Note

    If you edit the name of a resource set or delete a resource set, the tokens you have created that reference that resource set must be updated manually to reflect the change.

Token examples

A token is formed based on following rules.

  • The path elements must be BMC Cloud Lifecycle Management object model class names.
  • The conditions inside the path elements must contain the actual relation and attribute names.
    • EQUALS (=), NOT EQUALS (!=), LESS THAN (<), GREATER THAN (>), LESS THAN OR EQUAL (<=) and GREATER THAN OR EQUAL (>=) are allowed
    • AND (&), OR (|) Logical Operators are allowed
    • Conditions for a path element cannot contain both logical operators (that is, both AND and OR).
      • Valid example:

        /ResourceSet[name=RS1&tags.name=T1]/
        ComputeContainer/Server/ServerNetworkInterface/IPAddress[isPublic=true|
        isPublic=false]/ipAddress
      • Invalid example:

        /ResourceSet[name=RS1&tags.name=T1|tags.tagGroup.name=TG1]/
        ComputeContainer/Server/ServerNetworkInterface/IPAddress[isPublic=true|
        isPublic=false]/ipAddress

Note

Tokens must start with either a forward slash ( / ) or two forward slashes ( // ). These notations have different meanings:

  • / — Indicates that the path is to be evaluated for current context
  • // — Indicates that the path is to be evaluated generically (do not bind to current context only).

The following table provides some examples for how you would format token values.

Token name

Token value

Resolves to

RS

 

The resource sets that match the specified tag and tag group

HOSTNAME

??RS??/ComputeContainer/ Server[1]/hostname

The actual host name (for example, abcd.bmc.com). The number in the square brackets is an index relative to the compute container. For example, 0 would reference the first Compute container and 1 would indicate the second compute container.

Note that ??RS?? is a referenced token (that is, it is already defined). At runtime, before evaluating the value of HOSTNAME, ??RS?? is resolved with the actual value. Therefore, the HOSTNAME value would be resolved as

/ResourceSet[tags.label=Token & tags.tagGroup.name=domainController]/
ComputeContainer/Server[1]/hostname

.
Once the token is resolved, then the parameter will be evaluated.

SERVERNAME

/Server[1]/hostName

The host name of the second server, in context of current SOI request

Where to go next

Configuring-the-deployment-sequence-for-the-service-deployment-definition

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*