"Resource name was not unique" error while onboarding a deployment
search cancel

"Resource name was not unique" error while onboarding a deployment

book

Article ID: 444840

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

  • Onboarding a deployment fails with "resource name was not unique" error.
  • The machines in the deployment span across vcenters which have network of the same names in each.
  • The UI will only allow quick onboarding of these resources as the regular onboarding via ui only allows a single cloud account to be specified and filters the available machines accordingly.

Environment

VMware Aria Automation 8.18.1

Cause

The error occurrs when resource names within the scope of the deployment are not unique. For example networks with duplicate names across vCenters are attempted to be imported into the same deployment object.

Resolution

To resolve the issue you can skip the importing of the relevant network resources by onboarding via the API and leveraging the EXCLUDE_NETWORK_ONBOARDING property. Creating the onboarding plan vai api allows us to specify multiple endpoint ids

1. Get compute links for the machines (you'll need these as input):

GET https://{{vRAHost}}/iaas/api/machines?$filter=name eq '<machine-name>'

The selfLink in each result is the resourceLink (e.g., /resources/compute/{uuid}).

2. Create the onboarding plan with multiple endpoint IDs:

POST https://{{vRAHost}}/relocation/onboarding/plan
Authorization: Bearer {{token}}
Content-Type: application/json

{
  "name": "migration-plan-no-network",
  "projectId": "<project-uuid>",
  "endpointIds": ["<vcenter1-endpoint-uuid>", "<vcenter2-endpoint-uuid>"]
}

Save the returned documentSelfLink — this is your planLink (e.g., /relocation/onboarding/plan/{plan-uuid}).

3. Create deployments with machines (This step can also be completed via UI now that the onboarding plan is created with multiple endpoint ids):

POST https://{{vRAHost}}/relocation/onboarding/task/create-deployment
Authorization: Bearer {{token}}
Content-Type: application/json

{
  "planLink": "/relocation/onboarding/plan/<plan-uuid>",
  "name": "<deployment-name>",
  "resources": [
    {"link": "/resources/compute/<machine-uuid-1>", "name": "<vm-name-1>"},
    {"link": "/resources/compute/<machine-uuid-2>", "name": "<vm-name-2>"}
  ]
}

Repeat for each deployment grouping.

4. Query the created resources (to get their UUIDs):

GET https://{{vRAHost}}/relocation/onboarding/resource?expand=true&$filter=deploymentLink eq '/relocation/onboarding/deployment/<dep-uuid>'
Authorization: Bearer {{token}}


5. PATCH each machine resource to include the EXCLUDE_NETWORK_ONBOARDING property:

PATCH https://{{vRAHost}}/relocation/onboarding/resource/<resource-uuid>
Authorization: Bearer {{token}}
Content-Type: application/json

{
  "options": ["EXCLUDE_NETWORK_ONBOARDING"]
}


6. Execute the onboarding plan:

POST https://{{vRAHost}}/relocation/api/wo/execute-plan
Authorization: Bearer {{token}}
Content-Type: application/json

{
  "planLink": "/relocation/onboarding/plan/<plan-uuid>"
}