# Naming

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

---

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

---

To learn more about this OneFuse module, refer to [Naming](/docs/onefuse/configure/modules/naming/).

## 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 Naming Policy to run** for this Cloud Template.
1. **Update the Cloud Template** to add in the necessary vRA Property and/or add in the Custom Resource to invoke a OneFuse Naming Policy.
1. **Deploy the Cloud Template** to provision a vRA Deployment and generate a name.
1. **Destroy the vRA Deployment** to destroy the vRA Deployment and name.

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

The following vRA Property needs to be added to the Cloud Template's **Code** section under the **Resource(s)** of interest.

**Call a Naming Policy:**

| Property Name Format | Property Value Format |
| --- | --- |
| `OneFuse_NamingPolicy` | `'<OneFuse Endpoint Name>:<Naming Policy Name>'` |

**Example YAML:**

```yaml
# Execute OneFuse Naming Policy

# -- Property Value
# <OneFuse Endpoint Name>  is onefuse
# <Naming Policy Name> is global

name: Simple Example
resources:
  Cloud_Machine_1:
    type: Cloud.Machine
    properties:
      image: CentOS7
      flavor: small
      count: 1
      OneFuse_NamingPolicy: 'onefuse:global'
```

***Optional.* Request additional names** (`2022.0.0 Build 17166779`)

Support for requesting Additional Naming objects from one VM (for example, naming installed components in the VM or naming the additional IPAM and DNS objects being requested alongside them). The additional Names are reserved and stored in both OneFuse and vRA Machine Properties for future reference in vRA lifecycles.

| Property Name Format | Property Value Format |
| --- | --- |
| `OneFuse_NamingPolicy_Additional_<CustomID>` | `'<OneFuse Endpoint Name>:<Naming Policy Name>'` |

- Replace `<CustomID>` with a unique, user-defined friendly label.
- To name the additional IPAM and/or DNS objects being requested with the VM, replace `<CustomID>` with the matching value for `<niclabel>` defined for IPAM and/or DNS Additional properties.

**Example vRA Custom Property** (in `key: value` pair format)

```yaml
# -- Property Value
# <OneFuse Endpoint Name>  is onefuse
# <OneFuse Naming Policy Name> is global
# Will name Component 01 with Naming Policy 'component'
# Will name additional IPAM and DNS objects that have <niclabel> = 'xyz' with Naming Policy 'xyz'


# Example
OneFuse_NamingPolicy: onefuse:global
OneFuse_NamingPolicy_Additional_xyz: onefuse:xyz
OneFuse_NamingPolicy_Additional_component01: onefuse:component
```

##### Example Cloud Template YAML code

```yaml
# Execute OneFuse Naming Policy

# -- Property Value
# <OneFuse Endpoint Name>  is onefuse
# <Naming Policy Name> is global

name: Simple Example
resources:
  Cloud_Machine_1:
    type: Cloud.Machine
    properties:
      image: CentOS7
      flavor: small
      count: 1
      OneFuse_NamingPolicy: 'onefuse:global'
```

#### Option 2: Add in Custom Resource for OneFuse Naming

<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:Name_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. |

### Provision

Deploy a Cloud Template with OneFuse Naming Policy configured. A unique name will generate for the resource(s).

#### Outputs

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

| Property Name | Property Value Format |
| --- | --- |
| `OneFuse_Naming` | *JSON string of OneFuse Name Managed Object* |

### Deprovision

Destroy an existing deployment with OneFuse Naming Policy configured. The name will be removed from OneFuse Managed Names inventory.

## vRA EBS

| EBS Execution | Subscription State | EBS Priority | EBS Name |
| --- | --- | --- | --- |
| **Provision** | | | |
| ComputeAllocationPre | Early | 1150 | OneFuse_Provision_Naming |
| **Deprovision** | | | |
| ComputePostRemoval | - | 1500 | OneFuse_De-Provision_Naming |

## 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** > **Naming** > **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)
