# Aria Automation

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

---

Site [llms.txt](/llms.txt)

---

To learn more about this OneFuse module, refer to [Aria Automation](/docs/onefuse/configure/modules/vmware-aria-automation/).

## Prerequisites

1. Configure OneFuse [Property Set(s)](/docs/onefuse/templating/property-sets/) and OneFuse Module Policies.
1. Run [OneFuse Configuration](/docs/onefuse/consume/vmware-aria-automation/aria-automation-8x/installation-and-setup/#run-the-onefuse-configuration-workflow) per Cloud Assembly Organization.
1. Review an overview on [OneFuse modules](/docs/onefuse/consume/vmware-aria-automation/aria-automation-8x/modules/) with Aria Automation 8.1+/Cloud.
1. Create a new **Cloud Template** (if none exist) or determine which existing Cloud Template(s) will utilize this OneFuse Module.
   - Resource: [Designing your vRealize Automation Cloud Assembly deployments](https://docs.vmware.com/en/vRealize-Automation/8.1/Using-and-Managing-Cloud-Assembly/GUID-BFD33C28-ADCC-43F4-BE43-CC92B62FBE2E.html)

## Steps

1. **Know the name of the OneFuse Endpoint** created via [OneFuse Configuration](/docs/onefuse/consume/vmware-aria-automation/aria-automation-8x/installation-and-setup/#run-the-onefuse-configuration-workflow).
1. **Determine _which_ OneFuse vRA Policies to run** for this Cloud Template.
1. **Determine _when_ to run each OneFuse vRA Policy** for the deployment provisioning lifecycle with vRA's EBS'.
1. **Update the Cloud Template** to add in necessary vRA Properties and/or add in the Custom Resource to invoke OneFuse vRA Policies.
1. **Deploy the Cloud Template** to provision additional vRA Deployment(s).
1. **Destroy the vRA Deployment** to destroy the dynamically provisioned vRA Deployment(s).

### Update the Cloud Template

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

#### Option 1: 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 vRA EBS for vRA Module:**

| Property name format | Property value |
| --- | --- |
| See options below | `'true'` |

**Option 1.** Trigger only specific individual EBS state(s):

<div class="alert alert-info" role="alert">


This method is recommended to decrease provision time since it will only run the execute for the states defined. This also offers a quicker way to turn on/off the Policy for testing.
</div>


- `OneFuse_VraPolicy_Trigger_<EBSExecutionString>`
- Replace `<EBSExecutionString>` with an appropriate Event Broker Subscription

**OR:**

**Option 2.** Trigger all EBS state(s):

<div class="alert alert-warning" role="alert">


This overrides the individual EBS Execution triggers if they are present (see above).
</div>


- `OneFuse_VraPolicy_Trigger`

**Example YAML:**

```yaml
# Execute OneFuse vRA Policy

# <EBSExecutionString> is replaced with ComputeProvisionPostLate

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

# -- Property Value
# <OneFuse Endpoint Name>  is onefuse
# <vRA Policy Name> is linux_ApacheDeployment

name: Nested Example
resources:
  Cloud_Machine_1:
    type: Cloud.Machine
    properties:
      image: CentOS7
      flavor: small
      count: 1
      OneFuse_VraPolicy_Trigger_ComputeProvisionPostLate: 'true' # Trigger Property
      OneFuse_VraPolicy_ComputeProvisionPostLate_001Apache: 'onefuse:linux_ApacheDeployment'
```

**2. Call vRA Module Policy for a vRA EBS:**

| Property name format | Property value format |
| --- | --- |
| `OneFuse_VraPolicy_<EBSExecutionString>_<CustomID>` | `'<OneFuse Endpoint Name>:<vRA Policy Name>:<vRA Deployment Name>'` |

- Replace `<EBSExecutionString>` with an appropriate Event Broker Subscription
- Replace `<CustomID>` with a unique, user-defined friendly label

**Example YAML:**

```yaml
# Example CustomID with sorting

001Apache
002WebApp
003BackupClient
```

##### vRA Module EBS execution states

**EBSExecutionString** refers to a specific vRA EBS State for the OneFuse Module's policy to execute on.

Replace `<EBSExecutionString>` with one of the following EBS Execution States, using the table below as a resource:

| EBS Execution | Subscription State | EBS Priority | EBS Name |
| --- | --- | --- | --- |
| **Provision** | | | |
| ComputeAllocationPre | Early | 20 | OneFuse_Provision_vRA_ComputeAllocationPreEarly |
| ComputeAllocationPre | Late | 2010 | OneFuse_Provision_vRA_ComputeAllocationPreLate |
| NetworkConfigure | Early | 20 | OneFuse_Provision_vRA_NetworkConfigureEarly |
| NetworkConfigure | Late | 2010 | OneFuse_Provision_vRA_NetworkConfigureLate |
| ComputeProvisionPre | Early | 20 | OneFuse_Provision_vRA_ComputeProvisionPreEarly |
| ComputeProvisionPre | Late | 2010 | OneFuse_Provision_vRA_ComputeProvisionPreLate |
| ComputeProvisionPost | Early | 20 | OneFuse_Provision_vRA_ComputeProvisionPostEarly |
| ComputeProvisionPost | Late | 2010 | OneFuse_Provision_vRA_ComputeProvisionPostLate |
| **Deprovision** | | | |
| ComputePreRemoval | - | 20 | OneFuse_De-Provision_vRA |

**List of vRA EBS Trigger Properties:**

```yaml
# Execute OneFuse vRA Policy

# <EBSExecutionString> is replaced with ComputeProvisionPostLate

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

# -- Property Value
# <OneFuse Endpoint Name>  is onefuse
# <vRA Policy Name> is linux_ApacheDeployment

name: Nested Example
resources:
  Cloud_Machine_1:
    type: Cloud.Machine
    properties:
      image: CentOS7
      flavor: small
      count: 1
      OneFuse_VraPolicy_Trigger_ComputeProvisionPostLate: 'true' # Trigger Property
      OneFuse_VraPolicy_ComputeProvisionPostLate_001Apache: 'onefuse:linux_ApacheDeployment'
```

##### 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.

```yaml
# Execute OneFuse vRA Policy

# <EBSExecutionString> is replaced with ComputeProvisionPostLate

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

# -- Property Value
# <OneFuse Endpoint Name>  is onefuse
# <vRA Policy Name> is linux_ApacheDeployment

name: Nested Example
resources:
  Cloud_Machine_1:
    type: Cloud.Machine
    properties:
      image: CentOS7
      flavor: small
      count: 1
      OneFuse_VraPolicy_Trigger_ComputeProvisionPostLate: 'true' # Trigger Property
      OneFuse_VraPolicy_ComputeProvisionPostLate_001Apache: 'onefuse:linux_ApacheDeployment'
```

**Specify sorting with CustomID:**

When executing multiple different OneFuse Module's 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.

```yaml
# 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 |
| --- | --- |
| `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. Learn more about OneFuse [Tracking ID](/docs/onefuse/concepts/tracking-id/). |

- The first OneFuse Module Policy execution will populate this property and pass it into other OneFuse Modules automatically.
- When a Tracking ID is not provided, one is generated for the Policy execution.

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

| Property format | Example |
| --- | --- |
| `OneFuse_VmNic<#>.<value>` | `OneFuse_VmNic0.hostname`, `OneFuse_VmNic0.ipAddress`, `OneFuse_VmNic0.fqdn` |

- Replace `<#>` with a number from `0` to `9`, one for each NIC. For most use cases, NIC 0 is the primary network interface.
- Replace `<value>` with an appropriate key: `dnsSuffix`, `fqdn`, `gateway`, `hostname`, `ipAddress`, `macAddress`, `netmask`, `network`, `subnet`, `target`
- `target` will be the FQDN when a DNS Suffix is provided; otherwise, it will be the hostname without domain.

##### Example Cloud Template YAML

```yaml
# Execute OneFuse vRA Policy

# <EBSExecutionString> is replaced with ComputeProvisionPostLate

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

# -- Property Value
# <OneFuse Endpoint Name>  is onefuse
# <vRA Policy Name> is linux_ApacheDeployment

name: Nested Example
resources:
  Cloud_Machine_1:
    type: Cloud.Machine
    properties:
      image: CentOS7
      flavor: small
      count: 1
      OneFuse_VraPolicy_Trigger_ComputeProvisionPostLate: 'true' # Trigger Property
      OneFuse_VraPolicy_ComputeProvisionPostLate_001Apache: 'onefuse:linux_ApacheDeployment'
```

---

#### Option 2: Add in Custom Resource for OneFuse vRA Module

<div class="alert alert-warning" role="alert">


Review [OneFuse custom resources](/docs/onefuse/consume/vmware-aria-automation/aria-automation-8x/modules/custom-resources/) before using this method.
</div>


- From the **Resource Types** navigation, expand **Custom Resources**
- Drag-and-drop `OneFuse:vRA_v1` to the canvas
- In the **Code** tab, provide values for the following _properties_:

| Parameter Name | Required? | Notes |
| --- | --- | --- |
| `endpointName` | Required | OneFuse Endpoint Name in vRA. Refer to [Managing endpoints](/docs/onefuse/consume/vmware-aria-automation/aria-automation-8x/installation-and-setup/#managing-endpoints). |
| `policyName` | Required | OneFuse Module Policy Name (string). |
| `templateProperties` | Optional | Additional properties that are referenced within the Policy. JSON format. |
| `trackingId` | Optional | Tracking ID (string) to link multiple OneFuse Policy Executions and resulting OneFuse Managed Objects together. If none is passed, one gets generated by OneFuse for that specific Policy Execution. |

_Aria Automation specific parameters:_

| Parameter Name | Required? | Notes |
| --- | --- | --- |
| `deploymentName` | Required | Name of the vRA Deployment |

### Provision

Deploy a Cloud Template with OneFuse vRA module configured. The vRA Module will run and dynamically create additional vRA deployment(s).

#### Outputs

The following vRA Property will have the generated OneFuse vRA Managed Object as a JSON string on the Deployment.

| Property Name | Property Value Format |
| --- | --- |
| `OneFuse_Vra_<CustomID>` | _JSON string of OneFuse vRA Managed Object_ |

### Deprovision

Destroy an existing deployment with OneFuse vRA Module configured. The vRA Module will run and destroy the dynamically provisioned deployments.

## vRA EBS

| EBS Execution | Subscription State | EBS Priority | EBS Name |
| --- | --- | --- | --- |
| **Provision** | | | |
| ComputeAllocationPre | Early | 20 | OneFuse_Provision_vRA_ComputeAllocationPreEarly |
| ComputeAllocationPre | Late | 2010 | OneFuse_Provision_vRA_ComputeAllocationPreLate |
| NetworkConfigure | Early | 20 | OneFuse_Provision_vRA_NetworkConfigureEarly |
| NetworkConfigure | Late | 2010 | OneFuse_Provision_vRA_NetworkConfigureLate |
| ComputeProvisionPre | Early | 20 | OneFuse_Provision_vRA_ComputeProvisionPreEarly |
| ComputeProvisionPre | Late | 2010 | OneFuse_Provision_vRA_ComputeProvisionPreLate |
| ComputeProvisionPost | Early | 20 | OneFuse_Provision_vRA_ComputeProvisionPostEarly |
| ComputeProvisionPost | Late | 2010 | OneFuse_Provision_vRA_ComputeProvisionPostLate |
| **Deprovision** | | | |
| ComputePreRemoval | - | 20 | OneFuse_De-Provision_vRA |

**List of vRA EBS Trigger Properties:**

```yaml
# Execute OneFuse vRA Policy

# <EBSExecutionString> is replaced with ComputeProvisionPostLate

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

# -- Property Value
# <OneFuse Endpoint Name>  is onefuse
# <vRA Policy Name> is linux_ApacheDeployment

name: Nested Example
resources:
  Cloud_Machine_1:
    type: Cloud.Machine
    properties:
      image: CentOS7
      flavor: small
      count: 1
      OneFuse_VraPolicy_Trigger_ComputeProvisionPostLate: 'true' # Trigger Property
      OneFuse_VraPolicy_ComputeProvisionPostLate_001Apache: 'onefuse:linux_ApacheDeployment'
```

## Troubleshooting

Troubleshoot in vRealize Orchestrator.

1. Log in to **vRealize Orchestrator**.
1. Turn on [Verbose Logging](/docs/onefuse/consume/vmware-aria-automation/aria-automation-8x/modules/#troubleshooting-verbose-logging) and try again to see additional log messages in vRO Workflows:
   - Select **Library** > **Workflows** from the left menu
   - Go to: **OneFuse** > **vRA** > **vRA8** to find corresponding workflow runs and view logs
   - Optionally, run the workflows in the **Manual** folder to manually test
1. Optionally, [configure timeouts for EBS](/docs/onefuse/consume/vmware-aria-automation/aria-automation-8x/modules/event-broker-subscriptions/#configure-ebs-timeouts) and/or [Configure timeouts for OneFuse modules](/docs/onefuse/consume/vmware-aria-automation/aria-automation-8x/installation-and-setup/#configure-timeouts-for-onefuse-modules).

**Additional resources:**

- Review [Troubleshooting in OneFuse](/docs/onefuse/getting-started/troubleshooting/)
- Review [VMware troubleshooting resources](/docs/onefuse/consume/vmware-aria-automation/aria-automation-8x/getting-started/#troubleshooting)
