WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

Automating complete HCX deployment and configuration to first cloud migration using PowerCLI

03.04.2019 by William Lam // 5 Comments

PowerCLI 11.2.0, was just released last week and for a "dot" release, it includes a number of new capabilities and enhancements. One of the most exciting features for me personally was the introduction of the VMware Hybrid Cloud Extension (HCX) PowerCLI module which I also had the pleasure of working on and providing early feedback to the HCX Engineering team. The new HCX module enables customers to use PowerCLI to now easily automate the HCX Fleet deployment (Interconnect, WAN Optimization and Network Extension) as well as perform bulk live migrations of  workloads between two HCX-enabled environments, with on-premises vSphere to VMware Cloud on AWS (VMC) being the most popular.

I have written a number articles on HCX Automation using both the HCX REST API and PowerCLI and with this latest PowerCLI module, I realized that we now have complete end-to-end automation with PowerCLI from the HCX OVA deployment to initial configuration and fleet deployment to your very first HCX vMotion! This is quite exciting as I know a number of folks have been asking about automating the fleet deployment, especially for enabling quick proof of concepts and quickly showing the value of HCX to our customers for moving large amount of workloads without any downtime.

Below, you will find a breakdown of the HCX setup which I have split into three sections, each section includes the respective PowerCLI sample code that can easily be adapted to your own environment. I look forward to seeing what customers do with the new HCX PowerCLI module and if you have any feedback, be sure to leave a comment or better yet, file a feature enhancement using the PowerCLI Feature Request Tool.

[Read more...]

Categories // Automation, HCX, PowerCLI, VMware Cloud on AWS Tags // HCX, Hybrid Cloud Extension, PowerCLI, PowerCLICore, VMC, VMware Cloud on AWS

Common PowerCLI examples for VM Provisioning in VMware Cloud on AWS

02.07.2019 by William Lam // 2 Comments

One of the huge benefits of VMware Cloud on AWS (VMC) is not only the ability to extend your existing on-premises environment and tap into the potentially unlimited capacity of the Cloud, but customers can continue to use the existing tools and scripts that they are already familiar with. When it comes to Automation, PowerCLI is still by far the most popular tool that our customers uses on a regular basis. With VMC, this is no different as the SDDC is simply made up of vSphere, vSAN and NSX which PowerCLI fully supports.

One learning curve that I have seen for some customers when working with VMC is around general provisioning and the implication of the restrictive permission model in VMC. Unlike your on-premises vSphere environment, in VMC, you are no longer running as a vSphere Administrator but rather a Cloud Administrator. This simply means you no longer have to worry about managing the underlying infrastructure (patch, upgrade, monitor, etc) and you get to focus deploying and managing your workloads.

What this technically translates to is that you are restricted to a particular part of the vSphere Inventory where you have permissions to actually deploy workloads. This is to help isolate your workloads and ensure that you do not negatively impact the VMware Management VMs by accident and thus affecting your SDDC.

  • From the Hosts/Clusters view, you must use the Compute-ResourcePool
  • From the VM view, you must use the Workloads Folder
  • From the Datastore view, you must use the WorkloadDatastore


When using the vSphere UI to deploy new workloads, the UI does a really good job of guiding you towards the right inventory objects, but this may not always be apparent when using the CLI or API, especially for new folks or folks who never use the UI 😉

[Read more...]

Categories // Automation, PowerCLI, VMware Cloud on AWS Tags // PowerCLI, VMC, VMware Cloud on AWS

Using NSX-T Policy API to retrieve the Routing Table in VMC

02.04.2019 by William Lam // Leave a Comment

When configuring connectivity from your on-premises environment to your VMware Cloud on AWS (VMC) NSX-T SDDC, you can either use a Direct Connect (DX) or a Route/Policy-based VPN. During the configuration, it can really be useful to have insights into the network routing table, especially if you need to verify a specific route or for general network debugging. Today, the NSX-T routing table in VMC is not currently available in the Network and Security UI, however this information can be retrieved using the NSX-T Policy API, which I have written about quite extensively here, here, here and here.

The NSX-T routing table can be retrieved by performing a GET operation on /policy/api/v1/infra/tier-0s/vmc/routing-table?enforcement_point_path=/infra/sites/default/enforcement-points/vmc-enforcementpoint By default, you will get the entire routing table, but you also filter out specific route sources such as BGP, Static or Connected routes by appending the following query parameter to the request URL ?route_source={BGP,CONNECTED,STATIC}

To demonstrate how this API works, I have created a new function in my VMC NSX-T PowerShell Module as well as a quick shell script sample using cURL.

For PowerShell/PowerCLI users, I have a new Get-NSXTRouteTable function which will list the entire routing table by default as shown in the screenshot below.


You can also filter on a specific route source such as BGP, CONNECTED or STATIC routes by simply providing the -RouteSource argument and the route source type. In the screenshot below, I am only interested in the BGP routes.


Here is the output when running the list_vmc_nsxt_route_table.sh script which requires a valid CSP Refresh Token, OrgId and SDDCId

Categories // Automation, NSX, PowerCLI, VMware Cloud on AWS Tags // BGP, NSX-T, Policy Manager API, Routing Table, VMC, VMware Cloud on AWS

  • « Previous Page
  • 1
  • …
  • 24
  • 25
  • 26
  • 27
  • 28
  • …
  • 56
  • Next Page »

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...