Passing deployment data using tokens
When creating service blueprints, you can use deployment data such as hostnames and IP addresses in your software packages and post deployment actions using tokens. This capability lets you 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 as part of a service blueprint 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, SQL scripts or other scripts supported that BMC Database Automation supports as Actions, or any deployment scripts (such as BMC Server Automation NSH scripts).
The Custom Resource token patch type is not supported.
For example, consider the following scenario:
- A service blueprint has a 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 setting up parameters in BMC Database Automation, see Using parameters in PaaS provisioning .
- For information about sequencing the application deployments as part of a service blueprint definition, see Creating-copying-or-editing-a-service-blueprint.
Including a pre-defined parameter token in a service blueprint
- In the Service Designer workspace, open a service blueprint for editing.
Do one of the following:
If you want to configure parameters...
Then...
At the service blueprint level
Select Service Properties > Parameters.
At the definition level
Select Definition > Parameters.
At the server level
Select a server within a server group and then click Parameters in the edit pane.
At the application level
Select an application and then click Parameters in the edit pane.
At the database instance level
Select a database instance and then click Parameters in the edit pane.
- In the Parameters table, click New
.
- Enter a unique parameter name. This name must be the same name as the one used in a BMC Server Automation package or script or in a BMC Database Automation template or Action. 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, in the Label field, enter the name that is displayed to the end user for this parameter.
- 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 attributes included in the resource set that uses the token. The following token types are available, each with applicable sub-options:
Optionally, click Required Value.
- Click OK to save the new parameter.
You can continue editing other aspects of the service blueprint. If you are done making changes, you can check it in to the Blueprint Library. See Creating-copying-or-editing-a-service-blueprint for detailed information.
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 Path Type of Compute or PaaS, depending on the type of resource you are deploying.
Click the Token Path field to open the field for editing.
The field contains a default token for PaaS or compute provisioning.Compute token path:
/ResourceSet[name=<value>]/ComputeContainer[0]/Server/ServerNetworkInterface[nicNumber=<value>]/IPAddress[isPublic=false]/ipAddressPaaS token path:
/ResourceSet[name=<value>]/SoftwareContainer[0]/<attr-name>- To select another predefined token path, click
. A list of token paths appears. Scroll through the list and select another token path.
- Edit the token string as needed.
You can edit text that is enclosed in angle brackets ( < > ). Optionally, you can also create your own token string. For examples of how you would construct a token, see Token examples. Optionally, click Required Value.
Click OK to save the new parameter.
- You can continue editing other aspects of the service blueprint. If you are done making changes, you can check it in to the Blueprint Library. See Creating-copying-or-editing-a-service-blueprint for detailed information.
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 |
Here is an example of a token used in a multi-tier service blueprint that is deploying both a server and a database. The server deployment includes an application that provisions BMC Server Automation. Configuring BMC Server Automation requires a connection to a database. The application that deploys BMC Server Automation can include a token like the following, which provides the name of the provisioned database:
Where to go next