Registering a custom hostname advisor
On the Configuration workspace, you can configure the length of the host name string and a predefined format for the string. if you want more control, you can use a custom host name advisor to control the host names assigned to servers provisioned. For example, based on whether it is a virtual machine or physical server, you might want to add a character (v or p) at a fixed position.
To control host names this way, you must implement a separate host name adviser provider. Then, you can define custom workflow and use its workflow ID when configuring the provider. Then, if you provide an ID, you can call BMC Atrium Orchestrator workflow to configure the custom host name; otherwise, the default host name configuration from the Configuration workspace is used.
Even if this workflow is custom workflow and you can dynamically change the field, you cannot dynamically change the parameters passed to this workflow. Therefore, make sure that the provisioning workflow passes all of the necessary parameters to provide details of all infrastructure-related placement decisions (such as location, cluster, pod, network container, organization as well as service offering instance, resource set, and their specific objects).
This topic includes:
For additional information, see the following BMC Communities video (9:45), which describes how to register a custom host name advisor.
To create a custom host name provider definition
- Generate the authentication token with the
loginType
ofSUPERUSER
:{
"loginType" : "SUPERUSER"
}
To generate the token, you can use a REST utility via POST method with the following URL:
http://<PlatformManager>:<Port>/csm/login
- Make sure that the custom host name provider definition will be a child of Workload Manager provider so that the provider overrides the default host name provider that is a child of EFM provider.
- To obtain the GUID for the Workload Manager provider, search the providers through a REST utility via POST method with the following URL:
http://<PlatformManager>:<Port>/csm/provider/search
- To create the definition of the custom host name provider, send the API call through a REST utility by providing the necessary access attributes.
- Use a REST utility via POST method with the following URL:
http://<PlatformManager>:<Port>/csm/providerdefinition
For examples of creating a custom host name provider definition, see the attached input and output files.
To register the custom host name provider
To register the custom host name provider definition with the access attribute values, use a REST utility via the POST method. with the following URL:
http://<PlatformManager>:<Port>/csm/provider
The following table lists access attributes and sample values:Access attribute Sample value
AO_SERVER_URL
http://<AOServer>:<AOPort>/baocdp/orca
AO_SERVER_USERNAME
admin
AO_SERVER_PASSWORD
RKy3Q6NHz05RFC7CCzzKRQ==
This should be an encrypted password.
AO_SERVER_GRID_NAME
GRID1
AO_SERVER_ADAPTER_NAME
Host_Adapter
- Use the provider definition GUID in the provider registration input json file.
For examples of registering the custom host name provider, see attached input and output json files.
To create custom BMC Atrium Orchestrator workflow for host name advisor
Use BMC Atrium Orchestrator Development Studio to create custom workflow.
This workflow should contain the logic to generate the required host name.
Make sure that the following parameters are passed to the BMC Atrium Orchestrator workflow to generate the required host name.Parameter Name
Type
Purpose
computeContainerSpec
ComputeContainerSpec
The "Compute Resources" details of the ResourceSet.
deploymentParameterValue
DeploymentParameterValue
The app parameters and values for blueprint parameters defined in the SDD, if any.
functionalComponentSpec
FunctionalComponentSpec
The FunctionalComponents associated with this ResourceSet.
hostnamePrefix
String
The host name prefix specified by the user.
location
Location
The placement target location as configured in BMC Cloud Lifeycycle Management.
logicalHostingEnvironment
LogicalHostingEnvironment
The placement target Network Container or Logical Data Center (LDC).
organization
Organization
The tenant info for the owner.
resourceSetSpec
ResourceSetSpec
The ResourceSet specification.
serviceOfferingInstanceName
String
The SOI name.
userParameters
DeploymentParameterValue
The additional application parameters associated with this request, if any.
See the sample custom_hostname_response.xml and custom_hostname_response.xml files.
The workflow should return the list of HostnameAdvice objects as mentioned in ComputeContainerSpec instances method.- Import the workflow into BMC Atrium Orchestrator.
To create custom BMC Atrium Orchestrator workflow for resource name advisor for Azure
NEW IN 4.6.06
Use BMC Atrium Orchestrator Development Studio to create custom workflow.
This workflow should contain the logic to generate the required host name.
Make sure that the following parameters are passed to the BMC Atrium Orchestrator workflow to generate the required host name.Parameter Name
Type
Purpose
ccSpecList ComputeContainerSpec
The "Compute Resources" details of the ResourceSet.
deploymentParameterValue
DeploymentParameterValue
The app parameters and values for blueprint parameters defined in the SDD, if any.
fcSpecList
FunctionalComponentSpec
The FunctionalComponents associated with this ResourceSet.
resourceNamePrefix
String
The resource name prefix specified by the user.
location
Location
The placement target location as configured in BMC Cloud Lifeycycle Management.
logicalHostingEnvironment
LogicalHostingEnvironment
The placement target Network Container or Logical Data Center (LDC).
organization
Organization
The tenant info for the owner.
rsSpecList
ResourceSetSpec
The ResourceSet specification.
serviceOfferingInstanceName
String
The SOI name.
userParameters
DeploymentParameterValue
The additional application parameters associated with this request, if any.
user User The owner of the request. resources ResourceNameAdvice This is the list of recources for which name needs to be advised. See the sample ResourceNameAdvice-Request1.xml and ResourceNameAdvice-Request2.xml files.
The workflow should return the list of HostnameAdvice objects as mentioned in ComputeContainerSpec instances method.The following table displays the type, subtype, and attributes for Azure resource group and resources.
Azure Resources Type SubType Attributes Resource Group RESOURCE_CONTAINER COMPUTE Availability Set AVAILABILITY_SET MANAGED
UNMANAGED
SOI_NAME
RESOURCESET_NAME
IP Address IP_ADDRESS PUBLIC
SERVER_NAME
RESOURCESET_NAME
NIC_NUMBERLoad Balancer LOAD_BALANCER PUBLIC_FACING
PRIVATE_FACING
SOI_NAME
RESOURCESET_NAME
AVAILABILITYSET_NAME
Storage Account STORAGE_ACCOUNT STANDARD
PREMIUM
SOI_NAME
RESOURCESET_NAMENetworkInterface NIC STATIC
DHCP
SERVER_NAME
RESOURCESET_NAME
NIC_NUMBER
Disk DISK MANAGED
UNMANAGED
SERVER_NAME
RESOURCESET_NAME
DISKNUMBER
DISKTYPE
Network Security Group NETWORK_SECURITY_GROUP NIC_LEVEL_NSG SERVER_NAME
NIC_NUMBER
NIC_NETWORK_NAME
NIC_GUID
- Import the workflow into BMC Atrium Orchestrator.
To un-register the custom host name provider
- Get the GUID of the host name advisor instance, perform a search POST API call on
http://<platform manager machine>:<port>/csm/provider/Search
. - To unregister the advisor, perform a DELETE operation on the API:
http://<platform manager machine>:<port>/csm/provider/<host name advisor instance GUID>
- To unregister the provider definition, look for the provider definition GUID by performing a search POST API call on
http://<platform manager machine>:<port>/csm/providerdefinition/Search.
- Perform a DELETE operation on the API:
http://<platform manager machine>:<port>/csm/providerdefinition/<hostname advisor provider definition guid>
Example workflows
Following are two example workflows:
- Workflow 1: Returns the list of host names in the "affix last four characters of GUID" format.
- Workflow 2: Returns the list of host names in following format:
- 1 OS (W)indows, (L)inux
- 2 LOC (P)hoenix
- 3 ENV (L)ab, (D)ev, (Q)a, (P)rod
- 4 ARB CLD now but it's arbitrary - perhaps we can use for multiple vCDs
- 56 TYPE (WB)Web, (AP)App, (DB)Database, (UT)Utility, (WA)WebApp
- XXXX Incrementing number 01,02,03,04,99 then rolls to 100, and 999 then rolls to 1000 etc
Following are two example custom host names:
- WPDCLDAP01 - Windows,Phoenix,Dev,CLOUD,App
- LPQCLDDB01 - RHEL,Phoenix,CLOUD,QA,Database
As you create custom host names, remember these constraints:
- The maximum length of a host name is 15 characters.
- The configuration is global and applies to all host names that BMC Cloud Lifecycle Management generates.
- When writing a custom host name advisor, keep concurrency and multi-thread aspects in mind. For example, two concurrent requests should not have the same host name.
Troubleshooting
Following are troubleshooting tips if you run into issues:
- Check the custom provider definition.
- After you create the custom provider definition, search the providers to confirm that it was created.
- You can search by using a REST utility via POST Method by URL:
http://<PlatformManager>:<Port>/csm/providerdefinition/search
- Check the custom provider registration.
- After you register the custom provider, search the providers to confirm that it was registered.
- You can search by using a REST utility via POST Method by URL:
http://<PlatformManager>:<Port>/csm/provider/search
- De-register the custom host name provider.
- If you need to use the out-of-the-box host name provider and de-register the custom host name provider, complete the following steps:
- Use the DELETE API call:
DELETE ../csm/provider/<guid>
DELETE ../csm/providerdefinition/<guid>
Make sure that the custom host name provider is deleted first and then the custom host name provider definition is deleted.
The entry in the CloudDB is set to Mark as Deleted. All relationships are then deleted. - Remove the Mark as Deleted entries from the CloudDB.
You can execute one Reconciliation Job (purge) to clear all Mark as Deleted entries.
- Use the DELETE API call:
- If you need to use the out-of-the-box host name provider and de-register the custom host name provider, complete the following steps:
Comments
Log in or register to comment.