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
- For information about setting up parameters in BMC Server Automation, see Parameterizing-BLPackages-by-adding-local-properties and Parameterizing-NSH-scripts.
- For information about sequencing the application deployments, see Configuring-the-deployment-sequence-for-the-service-deployment-definition.
Including a pre-defined parameter token in a service blueprint
- 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. - Click Parameters.
- Click New
. The Parameter dialog box is displayed.
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.
- Optionally, enter a short description for your reference.
Select a data type of Token.
The Token type option is displayed.
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:
Optionally, click Required.
- Click OK to close the dialog box.
Click Saveto commit the blueprint and all your changes.
Creating a custom token
- Follow steps 1 through 7 in Including a pre-defined parameter token in a service blueprint.
- Select a Token Type of Advanced Editor
- Select a token string from the drop-down list. The drop-down list displays following items:
- Click
and edit the token string, as shown below.
You can edit parts of the above paths that are enclosed in angle brackets ( < > ). - Click OK to save the edited path.
- Optionally, you can also create your own token string. For examples of how you would construct a token, see Token examples.
Optionally, click Required.
- Click OK to close the dialog box and save the parameter.
Click Saveto commit the blueprint and all your changes.
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]/ipAddressInvalid example:
/ResourceSet[name=RS1&tags.name=T1|tags.tagGroup.name=TG1]/
ComputeContainer/Server/ServerNetworkInterface/IPAddress[isPublic=true|
isPublic=false]/ipAddress
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. /ResourceSet[tags.label=Token & tags.tagGroup.name=domainController]/ ComputeContainer/Server[1]/hostname . |
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