VM tagging

Configure and use the OneFuse VM Tagging module with VMware Aria Automation 8x/Cloud

To learn more, refer to Templating and Property Toolkit.

Feature highlights

  • Attach one or more Standard Tags to the VM as it is provisioned.
  • Automate multiple scenarios of Standard Tag Names and values with OneFuse Template Engine.
  • Define one or more vRA custom properties that influence the creation of VM Tags.
  • Define a Standard Tag via JSON format of key:value pair.
  • Supports OneFuse Template Engine for both key:value pair.
  • Supports ordering sets/groupings of Standard Tags by alphabetizing after the Property Key prefix.

Prerequisites

  1. Run OneFuse Configuration per Cloud Assembly Organization.
  2. Review an overview on OneFuse modules with Aria Automation 8.1+/Cloud.
  3. Create a new Cloud Template (if none exist) or determine which existing Cloud Template(s) will utilize this OneFuse Module.

Steps

  1. Know the name of the OneFuse Endpoint created via OneFuse Configuration.
  2. Determine which Standard Tag Categories and Tag Names are needed for this Cloud Template.
  3. Update the Cloud Template to add in necessary vRA Properties to create Standard Tags.
  4. Deploy the Cloud Template to provision a vRA Deployment and create and/or associate Tag(s).
  5. Destroy the vRA Deployment to destroy the vRA Deployment and disassociate itself from Tag(s).

Update the Cloud Template

  1. Log in to vRA > Cloud Assembly
  2. Select the Design tab from the top menu bar
  3. Select the Cloud Templates tab from the left menu
  4. Edit the Cloud Template and perform the below:

Add in necessary vRA Properties

The following vRA Properties need to be added to the Cloud Template’s Code section under the Resource(s) of interest.

1. Trigger Property Toolkit and/or VM Tagging:

Property Name Format Property Value
OneFuse_PropertyToolkit '<OneFuse Endpoint Name>:true'

Example YAML:

# Execute OneFuse VM Tagging

# -- Property Name
# <CustomID> is replaced with 001Backup

# -- Property Value
# <OneFuse Endpoint Name>  is onefuse
# <Category Name>  is Backup
# <Tag Name> is the provisioned resource hostname

name: Simple Example
resources:
  Cloud_Machine_1:
    type: Cloud.Machine
    properties:
      image: CentOS7
      flavor: small
      count: 1
      OneFuse_PropertyToolkit: 'onefuse:true'
      OneFuse_CreateTags_001Backup: '{"key":"Backup", "value":"{{ OneFuse_VmNic0.hostname }}"}'

2. Add in Tags:

Property Name Format Property Value Format
OneFuse_CreateTags_<CustomID>: Replace <CustomID> with a unique, user-defined friendly label. '<JSON key:value pairs of Tags>'

Example CustomID with sorting:

001Apache
002WebApp
003BackupClient

Example YAML:

# -- Property Name
# <CustomID> is replaced with 001Backup

# -- Property Value
# <Category Name>  is Backup
# <Tag Name> is the provisioned resource hostname

# Example
OneFuse_CreateTags_001Backup: '{"key":"Backup", "value":"{{ OneFuse_VmNic0.hostname }}"}'
CustomID

CustomID refers to a user-specified text string to identify and can set an order of precedence for execution when calling multiple Policies for the OneFuse Module in the same vRA EBS State.

Replace <CustomID> with a unique custom identifier:

  • Format is alphanumeric characters only A-Z, a-z, 0-9. No spaces, underscores, hyphens, nor special characters.
  • Must be unique across all EBS Execution Strings for the OneFuse Module on the specific VM for the Blueprint/Cloud Template.
  • Is reusable either between different VM components of the Blueprint/Cloud Template canvas or between different Blueprints/Cloud Templates.
# Execute OneFuse VM Tagging

# -- Property Name
# <CustomID> is replaced with 001Backup

# -- Property Value
# <OneFuse Endpoint Name>  is onefuse
# <Category Name>  is Backup
# <Tag Name> is the provisioned resource hostname

name: Simple Example
resources:
  Cloud_Machine_1:
    type: Cloud.Machine
    properties:
      image: CentOS7
      flavor: small
      count: 1
      OneFuse_PropertyToolkit: 'onefuse:true'
      OneFuse_CreateTags_001Backup: '{"key":"Backup", "value":"{{ OneFuse_VmNic0.hostname }}"}'

Specify sorting with CustomID:

When executing multiple different OneFuse Module Policies in the same EBS State, prefix the <CustomID> with a numeric value (for example, 001, 002, etc.).

The <CustomID> is sorted prior to executing the OneFuse module’s policies.

# Example CustomID with sorting

001Apache
002WebApp
003BackupClient
Additional helpful vRA Properties

Purpose: Relate OneFuse Policy executions from different OneFuse Modules together with a Tracking ID.

Property Value Format
OneFuse_Tracking_Id A GUID (globally unique identifier) that links OneFuse Policy Executions and the resulting Managed Objects together for a given resource on a deployment. The first OneFuse Module Policy execution will populate this vRA property and it will be passed into other OneFuse Modules automatically. (When a Tracking ID is not provided, a Tracking ID gets generated for the Policy execution.) Learn more about OneFuse Tracking ID.

Purpose: Reference a specific NIC’s values to get hostname, IP Address, etc.

Property Format Example
OneFuse_VmNic<#>.<value>: Replace <#> with a number from 0 to 9, one for each NIC. Replace <value> with an appropriate key: dnsSuffix, fqdn, gateway, hostname, ipAddress, macAddress, netmask, network, subnet, target OneFuse_VmNic0.dnsSuffix, OneFuse_VmNic0.fqdn, OneFuse_VmNic0.hostname, OneFuse_VmNic0.ipAddress, OneFuse_VmNic0.target (When DNS Suffix is provided, will be the FQDN; otherwise, will be the hostname without domain.) (For most use cases, NIC 0 is the primary network interface and the target hostname is a Fully Qualified Domain Name (FQDN).)
Example Cloud Template YAML code
# Execute OneFuse VM Tagging

# -- Property Name
# <CustomID> is replaced with 001Backup

# -- Property Value
# <OneFuse Endpoint Name>  is onefuse
# <Category Name>  is Backup
# <Tag Name> is the provisioned resource hostname

name: Simple Example
resources:
  Cloud_Machine_1:
    type: Cloud.Machine
    properties:
      image: CentOS7
      flavor: small
      count: 1
      OneFuse_PropertyToolkit: 'onefuse:true'
      OneFuse_CreateTags_001Backup: '{"key":"Backup", "value":"{{ OneFuse_VmNic0.hostname }}"}'

Provision

Deploy a Cloud Template with OneFuse VM Tagging configured. The resource will create if necessary and associate to the Standard Tag(s).

Outputs

The user-specified vRA Properties will exist on the deployment.

Deprovision

Destroy an existing deployment with OneFuse VM Tagging configured. The resource will be removed from the Standard Tag(s).

vRA EBS

EBS Execution Subscription State EBS Priority EBS Name
Provision
ComputeAllocationPre Early 1000 OneFuse_PropertyToolkit_ComputeAllocate
NetworkConfigure Early 1000 OneFuse_PropertyToolkit_NetworkConfigure
ComputeProvisionPre Early 15 OneFuse_PropertyToolkit_ComputeProvision
ComputeProvisionPost Early 1000 OneFuse_PropertyToolkit_ComputePostProvision

Troubleshooting

Troubleshoot in vRealize Orchestrator.

  1. Log in to vRealize Orchestrator.
  2. Turn on Verbose Logging and try again to see additional log messages in vRO Workflows:
    • Select Library > Workflows from the left menu
    • Go to: OneFuse > Property Toolkit > vRA8 to find corresponding workflow runs and view logs
    • Optionally, run the workflows in the Manual folder to manually test
  3. Optionally, configure timeouts for EBS and/or Configure timeouts for OneFuse modules.

Additional resources: