With the release of PowerCli 11.2, support for many new VMware products was introduced, including VMware HCX. The PowerCli module name for HCX is “VMware.VimAutomation.HCX” and it currently has 20 cmdlets to manage HCX.
You can use Windows Power Shell to install/upgrade your PowerCLI to v11.2 using the below commands:
1 |
Install-Module -Name VMware.PowerCLI -RequiredVersion 11.2.0.12780525 |
1: Once the necessary module is installed, we can use the Get-Command to examine the cmdlets that are available for HCX.
1 |
Get-Command -Module VMware.VimAutomation.HCX |
2: Authenticate with HCX: To connect to the HCX Manager, we need to use the Connect-HCXServer cmdlet.
1 2 3 4 5 |
PS C:Usersmanish> Connect-HCXServer -Server hcx-ent.ionoinc.local Server User ------ ---- hcx-ent.ionoinc.local administrator@vsphere.local |
3: Check deployed appliances: To check the appliances deployed via HCX, we can use the Get-HCXAppliance cmdlet.
In the above example, we can see that we have 2 appliances deployed and their types. This is the same information that is visible in the vSphere web client under the “HCX Components” tab.
4: Verify the status of interconnect (fleet) appliances: The Get-HCXInterconnectStatus cmdlet shows the status of the fleet appliance and the tunnel. Tunnel status shows whether or not connectivity between the on-premises and cloud side HCX is OK.
5: Verify site details: The get-HCXSite cmdlet shows the HCX site information. We can use 2 additional parameters with this cmdlet “source and destination” to view info specific to a site. If no parameter is used, the cmdlet only shows source site information by default.
6: Verify site pairing: The Get-HCXSitePairing cmdlet shows the registration of On-prem HCX with the Cloud site.
7: Get VDS details
1 2 3 4 5 6 7 8 9 10 |
PS C:Usersmanish> Get-HCXApplianceDVS MaxMTU : 9000 Type : DistributedVirtualSwitch Site : mgmt01vc01.ionoinc.local Id : dvs-27 Name : Mgmt-vDS Uid : /CisServer=administrator@vsphere.local@hcx-ent.ionoinc.local:443/20190313181315155-5f3843e5-7a2c-489e-8fac-862 c61ed150e=20190313181315155-5f3843e5-7a2c-489e-8fac-862c61ed150e/mgmt01vc01.ionoinc.local=146cf9d6-53c1-417c-8 b72-1354b917e57e/Mgmt-vDS=dvs-27/ |
And that’s it for this post. I am new to HCX cmdlets and currently exploring more and more on this.
Helpful Articles