VMware Cloud Community
nightrider7731
Contributor
Contributor
Jump to solution

HCX APIs via Powershell

I've read and borrowed a lot of pointers from Lam over at VirtualGhetto, but I've been trying to extend his libraries a little further as well as understand some of the nuances of the API.  I'm not a JSON expert by any stretch, but I've put my time into trying to understand the syntax.  However, the HCX API has worked in several locations, but has either failed or escaped me in others.  For instance, what is the difference between the migration Cancel and Delete calls?  Are they both the same?  Or does one just remove the schedule and completes the migration ASAP (like Remove Schedule from the GUI.)  I would image the call would need the current migrationId, but how do I tell if it needs more inputs.  Through trial and error, I know the Cancel just requires the migrationID, but I'm not sure about the Delete (it failed when i tried various parameters.)  And how do I code a date change in the schedule?  I assume it is the Update call, but even thought I pass in the original Migration ID, it just spawns another migration that sits at 'waiting' in the progress meter.  Finally, unlike the new migration schedule commands, I can't seem to find a rescheduled migration from the GUI in the logs.  I figured that if I could see the syntax in the logs, it would help solve these mysteries. 

If anyone has any pointers, it would be graciously appreciated!

Reply
0 Kudos
1 Solution

Accepted Solutions
i_am_mohit
VMware Employee
VMware Employee
Jump to solution

Reply
0 Kudos
3 Replies
nightrider7731
Contributor
Contributor
Jump to solution

FYI, I found out there are modules current in the works from VMware to handle this.  Modules are currently in beta

Reply
0 Kudos
i_am_mohit
VMware Employee
VMware Employee
Jump to solution

HCX API details will be published here: https://hcx-manager-ip/hybridity/docs/

Reply
0 Kudos
A13x
Hot Shot
Hot Shot
Jump to solution

PowerShell Gallery | VMware.VimAutomation.Hcx 11.3.0.13976786

Currently located on the powershell gallery at version 11.3 and seem to be working as expected.

We use these to stretch networks, move vms and check status. This is far faster than using the gui

Reply
0 Kudos