Automating Tag Creation & Assignment to VMs with vRA + vRO

 

Use Case Summary

  • A user provisions a VM from vRA.

  • Once the VM is deployed in vCenter, a vRO workflow is triggered via Event Broker subscription.

  • The workflow:

    1. Checks if the Tag exists (using REST API to NSX-T).

    2. If not found, creates the Tag under the correct category.

    3. Assigns the Tag to the newly provisioned VM.

This eliminates the need for manual intervention and ensures every VM is tagged correctly for policies, automation, and visibility.


High-Level Flow

  1. VM Provisioning in vRA

    • User requests VM with required details (e.g., Environment, Owner, Application).

  2. Event Broker Subscription

    • After provisioning, vRA triggers a vRO workflow.

  3. vRO Workflow Actions

    • Connects to vCenter using REST API.

    • Checks if Tag exists.

      • If exists → Skip creation.

      • If not exists → Create new Tag under category.

    • Assigns Tag to the VM.

  4. Result

    • VM is provisioned with the right tags automatically applied.

Flow Diagram Steps

  1. Start VM Provisioning (Triggered in vRA)

  2. Collect Input Parameters (VM Name, Tag Names, Owner, Environment, etc.)

  3. Call vRO Workflow via vRA Event Broker

  4. Check if Tag Exists in vCenter (REST API)

    • If Exists → Skip creation

    • If Not Exists → Create Tag under appropriate Category

  5. Assign Tag(s) to VM

  6. Log Results & Update CMDB/Tracking (Optional)

  7. End


Flow Diagram




Demo






👉 Further Automation

If you need enhancements or additional automation features, feel free to reach out. HashtagForge



Comments

Popular posts from this blog

Creating Snapshots for Unmanaged VMs in Aria Automation (vRealize Automation)

Bulk import security policies into Palo Alto Networks firewalls