WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Automated Lab Deployment Script for vSphere with Tanzu using NSX Advanced Load Balancer (NSX ALB)

Automated Lab Deployment Script for vSphere with Tanzu using NSX Advanced Load Balancer (NSX ALB)

04.05.2021 by William Lam // 19 Comments

After spending a few days playing with the NSX Advanced Load Balancer (NSX ALB) APIs, I am happy to share my latest automation lab deployment script for deploying vSphere with Tanzu using the new NSX ALB which was introduced with the latest vSphere 7.0 Update 2 release.

🙌 BOOM!!!

Fully Automated vSphere with @VMwareTanzu using the new @vmwarensx Advanced Load Balancer introduced in vSphere 7.0 Update 2 Lab Deployment in just 32 minutes! 🔥

Still need to clean up some things, but this beats clicking around the UI! My 🤲 thanks me pic.twitter.com/hN32Qk3oDc

— William Lam (@lamw.bsky.social | @*protected email*) (@lamw) March 29, 2021

Lab Deployment Automation

You can find the new automation script along with all the details at the following Github Repo: https://github.com/lamw/vsphere-with-tanzu-nsx-advanced-lb-automated-lab-deployment#enable-workload-management


In my environment, it took about ~32 minutes for the deployment to finish, but YMMV based on the performance of your underlying hardware.

Workload Management Automation

In addition to the automated lab deployment script above, I have also updated my community VMware.WorkloadManagement module to add support for enabling Workload Management on a vSphere Cluster using NSX ALB. This is introduced as a new function creatively called New-WorkloadManagement3. You use the Get-Help cmdlet to get a list of supported arguments or you can take a look at this example.

More from my site

  • Automated enablement of vSphere with Tanzu using vSphere Zones in vSphere 8
  • Quick Tip - How to deploy NSX Advanced Load Balancer (NSX-ALB) with a single Service Engine
  • Disabling vSphere with Tanzu does not delete NSX Advanced Load Balancer (NSX ALB) Service Engine (SE) VMs
  • Automating HAProxy VM deployment with 3-NIC configuration using PowerCLI
  • Automating Workload Management on vSphere with Tanzu

Categories // Automation, Kubernetes, PowerCLI, VMware Tanzu, vSphere 7.0 Tags // NSX Advanced Load Balancer, PowerCLI, vSphere 7.0 Update 2, vSphere Kubernetes Service

Comments

  1. *protectedSteve Ballmer says

    04/05/2021 at 12:08 pm

    Great work William!

    Reply
  2. *protectedjk kim says

    04/11/2021 at 4:21 pm

    Hi William,

    I am getting an error when Creating subnet mapping for Service Engine Network and stopped with the below error messages.

    Failed to create subnet mapping for DVPG-Supervisor-Management-Network
    Write-Error: ({"detail": "Method 'PUT' not allowed."}.Exception.Message)

    Any ideas what can cause this issue?

    Reply
    • *protected@vra4u @JoseCavalheri says

      06/04/2021 at 6:03 am

      Same here... just trying today the automatic deployment and fails on same place.. Doing my investigation, but so far didn't find the reason yet.

      Reply
    • *protectedJoseph Larkin says

      06/30/2021 at 8:34 am

      I'm Having the same exact issue.

      Failed to create subnet mapping for DVPG-Supervisor-Management-Network
      Write-Error: ({"detail": "Method 'PUT' not allowed."}.Exception.Message)

      Reply
  3. *protectedJoseph Larkin says

    06/26/2021 at 6:24 pm

    I'm getting just this one error when deploying from your script.

    "WARNING: Specifying a distributed port group name as network name is no longer supported. Use the -Portgroup parameter." I'm not great at powershell yet. Would you be able to Assist?

    It Happens right after:

    Adding vmnic2/vmnic3 for "Nested-Tanzu-Mgmt" and "Nested-Tanzu-Workload" to passthrough to Nested ESXi VMs ...

    Reply
  4. *protectedGustavo Dorado says

    07/08/2023 at 2:43 am

    Hi Guys.

    In the script, line 1012 (hardcoded username of nested vCenter), i change it for my "administrator@$VCSASSODomainName" and its working right now.

    Sorry for delay 😀

    Reply
  5. *protectedÓscar P. says

    09/10/2023 at 12:51 am

    Hi William.
    I had to add the parameter "-Force" to the line 455 ($vm = Import-VApp -Source $NSXAdvLBOVA...) because I was not be able to deploy the NSX ALB version 30.1.1 with vCenter/ESXi 8.0.1a (I want to test new versions) because I was seeing always the error: "Import-VApp" The certificate used to sign the OVF package is not valid. (Untrusted).
    I don't know if with your original versions was the same...
    Regards.

    Reply
    • *protectedJD says

      10/18/2023 at 12:37 pm

      First off, thanks for putting this together and sharing. Has been a tremendous head start.

      I currently have the script combined to deploy vSphere, NSX ALB and enable Workload Management in our lab using vSphere 8U2 with NSX ALB 20.1.4.

      I've been banging my head on the wall a bit now trying to get ALB 30.1 to configure the networks after successful deployment, but there seems to be some issue with the API call changes from 20.1.4 as expected.

      Seems the older version pre-populates the networks through discovery so the PUT method works as opposed to 30.1. Anyway, at the moment I'm just deploying 20.1.4 which works and then upgrading to 30.1. Would love to figure out how to complete 30.1 configuration directly with script as opposed to upgrading.

      Reply
      • *protectedÓscar P. says

        01/04/2024 at 12:11 am

        I had got it using 30.1 version... I have done some local modifications on the script (adding vCenter Proxy automated configuration, and other little changes) and it's working for me with vSphere 8.0U2 and NSX ALB 30.1.1.
        I can send you the changed script if you like. Sorry @William Lam, I have not documented it anywhere, but I can send you my little modifications if you want.
        For your problem, @JD, basically, I have changed "x-avi-version" to 30.1.1 and added a line at vCenter registration over 1055 line disabling the "use_content_lib" with "use_content_lib" = "false" that doesn't be able to register vCenter in NSX ALB.
        if($registervCenter -eq 1) {
        $cloudConfigResult = ((Invoke-WebRequest -Uri https://${NSXAdvLByManagementIPAddress}/api/cloud -Method GET -Headers $newPassbasicAuthHeaders -SkipCertificateCheck).Content | ConvertFrom-Json).results[0]

        $cloudConfigResult.vtype = "CLOUD_VCENTER"

        $vcConfig = @{
        "username" = "*protected email*"
        "password" = "$VCSASSOPassword";
        "vcenter_url" = "$VCSAHostname";
        "privilege" = "WRITE_ACCESS";
        "datacenter" ="$NewVCDatacenterName";
        "management_ip_subnet" = @{
        "ip_addr" = @{
        "addr" = "$NSXAdvLBManagementNetwork";
        "type" = "V4";
        };
        "mask" = "$NSXAdvLBManagementNetworkPrefix";
        }
        "use_content_lib" = "false";
        }

        Reply
        • William Lam says

          01/04/2024 at 5:24 am

          Awesome! Please send GitHub PR to bring in your changes

          Reply
          • *protectedÓscar P. says

            01/05/2024 at 3:29 am

            I have made several modifications to adapt it to my company environment that is complex about networking (I need two vSphere cluster with two Supervisor Tanzu Cluster, and different networks for Supervisor Workload and K8s Workloads). I will put all in order and translate the interesting modifications. Permit me some days out of my work.

        • *protectedJD says

          01/04/2024 at 7:10 am

          Fantastic and thanks for sharing! I will play around with the script and see if it works now without upgrading ALB afterward.

          Reply
          • *protectedÓscar P. says

            01/05/2024 at 3:30 am

            I'll try to put all in William github to his approve.

          • *protectedÓscar Pedro Isabel Cuéllar says

            01/20/2024 at 1:04 am

            Done. I'm new with Github stuff... I hope I did it correctly. I have deleted some lines relatives to my company networking and datacenter organization (I need two vpshere clusters and two supervisors for my lab). I haven't tested yet this final script.

  6. *protectedJoe Mattilini says

    04/18/2024 at 11:01 am

    Hi William

    I'm trying to deploy NSX-NAPP on nested ESXi environment which requires Tanzu on vsphere to be deployed, I was able to deploy supervisors successfully , but for some reason Host Config Status stuck on "Installed and Started Kubernetes Node Agent on the ESXi Host", I checked logs on ESXi hosts ( /esxupdate.log) and found this error : vmware.esximage.Errors.NoMatchError: ('spherelet', "No VIB matching VIB search specification 'spherelet' on host.") , any idea what could be the issue?

    Regards,
    Joe

    Reply
    • William Lam says

      04/19/2024 at 10:21 am

      Are you using compatible version of VCSA/ESXi? spherelet is a VIB that's deployed to ESXi host as part of vSphere w/Tanzu enablement and it seems like its unable to find the correct version. This would indicate that supervisor enablement was not fully successful

      Reply
      • *protectedbyungmun,lee says

        04/21/2024 at 6:51 pm

        I have the same issue.
        The version information is as below. Is there a solution?
        vCenter Server 8.0 Update 2a 22617221
        VMware ESXi, 8.0.2, 22380479

        Reply
        • William Lam says

          04/21/2024 at 7:09 pm

          Take a look at the VCSA installer logs, it should give you more info on what it’s not happy about

          Reply
          • *protectedbyungmun,lee says

            04/21/2024 at 7:18 pm

            Do you mean vc-installer.log?
            Logs associated with spherelet vib are not visible.

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

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

  • VMware Flings is now available in Free Downloads of Broadcom Support Portal (BSP) 05/19/2025
  • VMUG Connect 2025 - Minimal VMware Cloud Foundation (VCF) 5.x in a Box  05/15/2025
  • 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

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...