Windspirit
Enthusiast
Enthusiast

Using 8.4 REST to Onboard VMs

Jump to solution

I need to automate onboarding. However, the existing APIs for this looks geared towards pre 8.4 (where there were rules) and I tested the call, but Im not getting anything done.

https://code.vmware.com/apis/707/vrealize-automation-cloud-relocation-rest?p=vrealize-automation-clo...

I need to add an item to the onboarding List and execute the plan.

Any ideas?

 

0 Kudos
1 Solution

Accepted Solutions
Windspirit
Enthusiast
Enthusiast

OK. after long and hard tries ...here is how this works:

1) Get the plan link...thats the onboarding plan you allready have.

GET /relocation/onboarding/plan

-> planLink

2) get VM details

GET /iaas/api/machines

-> find VM, get name and id (needs to be reconstructed to "/resources/compute/[ID]"

3) create an onboarding deployment. Thats the ones you have in the deployment plan where VMs are assosiated to. Two options there. Eitehr use an existing Deployment or a new one.

NEW DEPLOYMENT

POST ​/relocation/onboarding/deployment

{planLink,[name optional]} -> take the selflink that comes back.

USE EXISTING

GET  /relocation​/onboarding​/deployment

-> selfLink

4) add VM to Onboarding plan

POST /relocation/onboarding/resource

{planLink,deploymentLink,resourceLink,resourceName}

5) Execute onboarding plan

execute Plan

POST /relocation/api/wo/execute-plan

{planlink}

View solution in original post

1 Reply
Windspirit
Enthusiast
Enthusiast

OK. after long and hard tries ...here is how this works:

1) Get the plan link...thats the onboarding plan you allready have.

GET /relocation/onboarding/plan

-> planLink

2) get VM details

GET /iaas/api/machines

-> find VM, get name and id (needs to be reconstructed to "/resources/compute/[ID]"

3) create an onboarding deployment. Thats the ones you have in the deployment plan where VMs are assosiated to. Two options there. Eitehr use an existing Deployment or a new one.

NEW DEPLOYMENT

POST ​/relocation/onboarding/deployment

{planLink,[name optional]} -> take the selflink that comes back.

USE EXISTING

GET  /relocation​/onboarding​/deployment

-> selfLink

4) add VM to Onboarding plan

POST /relocation/onboarding/resource

{planLink,deploymentLink,resourceLink,resourceName}

5) Execute onboarding plan

execute Plan

POST /relocation/api/wo/execute-plan

{planlink}

View solution in original post