WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Automation / Automated vSphere & vSAN 8 Lab Deployment Script

Automated vSphere & vSAN 8 Lab Deployment Script

10.12.2022 by William Lam // 43 Comments

🎉 vSphere 8.0 (IA) Initial Availability is LIVE! 🎉

FYI: RN still being published

vCenter
📒https://t.co/YTgxFB1k7S
💿https://t.co/Yn4mKnj8g7

ESXi
📒https://t.co/jQ3nkkxExl
💿https://t.co/xdkO8NVGKD

vSAN
📒https://t.co/FFrEZ3FzCJ

vSphere w/Tanzu
📒https://t.co/054qjFQE7O pic.twitter.com/EySqneYDoq

— William Lam (@lamw) October 11, 2022

Continuing with the tradition of a new vSphere release, I have also released an update to my Nested ESXi Virtual Appliance to support the latest vSphere 8 release.

I know many of you are excited to get hands on experience with vSphere 8 and start exploring some of the new features and capabilities. To make it even easier to deploy, I have created an updated version of my vSphere and vSAN Lab Deployment script which you can find on my Github repo: Automated vSphere & vSAN 8 Lab Deployment Github Repo

Here are a few screenshots of using the PowerCLI script:

The deployment took ~37 minutes in my environment and after that, you will have a fully functional and ready to use vSphere and vSAN 8 lab!

Simliar to previous lab deployment scripts, the deployed VMs will be placed into a vApp as shown below.

More from my site

  • How to bootstrap vSAN Express Storage Architecture (ESA) on unsupported hardware?
  • Nested ESXi installation using HTTPS boot over VirtualEFI in vSphere 8
  • ACPI motherboard layout requires EFI - Considerations for switching VM firmware in vSphere 8 
  • USB Network Native Driver for ESXi Fling now supports vSphere 8!
  • Quick Tip - Changes to building custom ESXi images in vSphere 8

Categories // Automation, vSphere 8.0 Tags // ESXi 8.0, nested virtualization, vSphere 8.0

Comments

  1. Luis Leitão says

    10/12/2022 at 1:46 pm

    Hi William. First of all, thank you for this precious piece of scripting, it is a very handy tool. I have just one question. Is it possible to target a physical instead of the vCenter v7 you have defined in the requirements? Thank You!

    Reply
    • William Lam says

      10/13/2022 at 6:59 am

      Not sure what you mean by target physical instead of vCenter v7? The requirement is that you have a vSphere 7 setup, usually its physical 🙂

      Reply
      • Luis Leitão says

        10/13/2022 at 7:01 am

        Hi William, you have this in the requirements: "vCenter Server running at least vSphere 7.x or later" my question is, instead of vCenter, can we run the script against an ESXi running standalone? Thanks

        Reply
        • William Lam says

          10/13/2022 at 7:02 am

          No, vCenter is a requirement for the script

          Reply
  2. Anthony Francaviglia says

    10/12/2022 at 4:04 pm

    Hi William - nice work as usual. It was a pleasure meeting you during the VMware Explore 2022 in one your your session. Did you try to run this script from a Windows machine? I did install PowerShell Core LTS 7.2.6 and PowerCLI, but it is failing with error on line 243. I have a brand new vcsa with 1 esxi host with enough capacity to run this lab. Tried to run on PowerShell ISE and modify the check for PowerShell core to "Desktop" and still the same error. I checked the Logs and I can't find anything outstanding to point to the error.
    Thanks in advance for your help!

    Reply
    • William Lam says

      10/13/2022 at 6:57 am

      I've not run this specific version on Windows, I primarily use PowerShell on Mac but this code is not new and has been tested in the past. L243 is a strange place to fail, so wondering if you have the correct input for ESXi VM variables?

      Reply
      • Anthony Francaviglia says

        10/23/2022 at 12:02 pm

        Hi Williams - I was able to build a macOS BigSur VM and your script ran like a charm! I am OK with deploying the LABs from a macOS VM and then managing them from my regular desktop. Problem solved 🙂 Have a great weekend, for what's left of it. Thanks again!

        Reply
  3. Egis says

    10/13/2022 at 2:22 am

    hi, does ESXi 7.0 licence key works for ESXi 8.0 when doing in place upgrade ?

    Reply
    • William Lam says

      10/13/2022 at 6:53 am

      No, there are new vSphere 8 license keys afaik. You'll need to work with your account team as I'm not involved in licensing details.

      Reply
      • Egis says

        10/14/2022 at 2:42 am

        any "free" licenses for home usage maybe available ?

        Reply
  4. Francois Beaudoin says

    10/14/2022 at 6:33 am

    Hello, I'm hitting the following error on step "Deploying the VCSA" : Could not find the hardware virtualization key from the ESXi host

    What I found weird is that nested VCSA and ESXi are all running.

    I'm running my homelab on AMD Zen3 platform (Ryzen 5950x) using consumer motherboard (Asus Crosshair Hero VIII). I double checked and yes SVM is enabled on every hosts. I'm running VCSA and ESXi on latest release from 7.x branch.

    Reply
    • Chris Podgorski says

      03/18/2023 at 5:04 pm

      Hello,

      I am running into the same issue, running my Homelab using Ryzen 9 5950X as well.

      Also,

      I did run into issues running the script on windows. It was failing on vcsa deployment.
      To get around the issue, I removed the logic for the deployment on Win, MacOS or Linux.
      I was also curious how you are setting the variables which specify the OS.
      I do not see $IsWindows set anywhere for example.

      Thank You for all that you do!

      Reply
  5. Tom Cronin says

    10/14/2022 at 12:17 pm

    I'm having the process of setting up the VCSA fail at various points and never fully completing. If I let it run long enough it will time out on the deploy and then create the vApp but fail on the rest. Two things I notice is the OVF tool when it gets an IP address returned in the log gets an IPV6 address instead of the assigned IPV4 address. The other is that after the VCSA install fails the script tries to add the physical hosts from the cluster I'm installing too after trying the nested hosts. Of course, it fails because the VC is not there, but that could be a problem if the install had succeeded.
    I've run the installer from the CMD terminal with the generated json file and it also gets the IPV6 address, but also fails to complete the install.

    Reply
    • Thomaspriv says

      10/21/2022 at 2:48 pm

      Not sure if its the same for you but for me the $IsWindows variable was not working.
      So I just ended up with removing the IF condition, removing the part for MacOS and Linux, and the letting script run the windows part for installing VCSA-1. (starting from line327)

      Reply
    • Andrew Hancock (@einsteinagogo) says

      11/08/2022 at 4:14 am

      I've opened some PR's on GitHub about this.

      Reply
      • Andrew Hancock (@einsteinagogo) says

        11/08/2022 at 4:17 am

        or issues!

        Reply
  6. kurthv71 says

    10/20/2022 at 5:46 am

    Hi William,
    do you have a „quick tip“ how to use the script to build a nested vSphere 8 environment _without_ vSAN?
    Thx Volker

    Reply
    • William Lam says

      10/20/2022 at 5:59 am

      Yes, disable it in script 🙂

      Reply
  7. Eugene says

    10/27/2022 at 10:34 pm

    Hello William,
    IP address that you are using, are they tied in to your home network? If you deploy windows vm to your nested environment, will it have access to the internet?

    Reply
    • Andrew Hancock (@einsteinagogo) says

      11/08/2022 at 4:18 am

      If your network has access to the Internet, and your environment has access to the internet, your VMs should have access to the internet, depends how you have configured your LAN

      Reply
  8. Eugene says

    10/27/2022 at 11:01 pm

    Also, will this lab support vMotion provide that it’s configured manually?

    Reply
    • Andrew Hancock (@einsteinagogo) says

      11/08/2022 at 4:19 am

      You can configure items manually after deployment, and do what you like with the Nested Lab

      Reply
  9. Freddie says

    11/10/2022 at 2:28 am

    Hi William - nice script. It's my first time setting up a nested enviromen with your script or any script. It started fine, but when the script finished running I saw that it missed a few things. It hadn't added the hosts to the new cluster. So no vSAN was created. I checked the log file for errors or failed messages but coulden't find any. I have runned the script twice with the same results. Do you have any thoughts on what could have gone wrong, if I missed any prerequisites in my environment?

    Thanks in advance for your help!

    Reply
  10. Eugene says

    11/14/2022 at 2:54 pm

    Hello i get this
    Unable to find /vmfs/volumes/DataStore1-1TB-SSD/Software/VMware/Lab/Nested_ESXi8.0_IA_Appliance_Template_v2.ova
    Can some one help?

    Reply
    • William Lam says

      11/14/2022 at 4:09 pm

      You deploy this from your desktop system, NOT on ESXi

      Reply
      • Eugene says

        11/14/2022 at 9:06 pm

        Thank you. I have tried running the script from my mac and from windows computer.
        Get-Cluster: /Users/......./vsphere-8-lab/vsphere-vsan-8-lab-deployment.ps1:238
        Line |
        238 | $cluster = Get-Cluster -Server $viConnection -Name $VMCluster
        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        | 11/14/2022 9:01:50 PM Get-Cluster Cluster with name 'Tek-Cluster' was not found using the specified filter(s).

        This is the very first error that i get. I have been trying to deploy it for the past 2 hrs. nothing i do is working 🙁

        Reply
  11. Mikael Lelouch says

    11/19/2022 at 7:44 am

    Hi william,

    Thanks for the script but I've error during the vcsa deployment

    [11-19-2022_04:30:29] Deploying the VCSA ...
    Failed to collect support bundle from the deployed appliance 'vcsa8'. Exception:
    HTTPSConnectionPool(host='pcc-XXX.ovh.com', port=40067): Max retries
    exceeded with url: /guestFile?id=85&token=5235ef83-306a-8ae0-55e5-07af0401394885
    (Caused by SSLError('Fingerprints did not match. Expected
    "7f4ca02d5020f4f456a169c60613e44570fbb332", got
    "b\'b24dbab9104ccc007e3063c3e682b6259de494e5\'".',))
    Cannot fetch certificate from 'vcsa8'. Error: [Errno 11001] getaddrinfo failed
    Error message: The VCSA deployment has failed VCSA Deployment Start Time:
    1970-01-01T00:00:00.000Z VCSA Deployment End Time: 1970-01-01T00:00:00.000Z

    Do you have an idea ?
    Thanks

    Reply
    • William Lam says

      11/19/2022 at 8:28 am

      Sounds like you don’t have DNS setup correctly? Ensure all host names you’re using can resolve OR only use IPs. Please re-read GitHub docs

      Reply
  12. Thomaspriv says

    11/23/2022 at 1:41 am

    Hi William,
    Thank you for this script. I really learned a lot by reading through the powershell script and eventually deploying it.

    But when adding additional vNICs to my nested ESX hosts I am experiencing partitioned networks even when adding the additional advanced options to these VM's (ethernet2.filter4.name and ethernet2.filter4.onFailure) and the MAC learning option on the DPG.
    Got any clue what seems to be missing here?

    Reply
  13. James says

    11/30/2022 at 7:29 am

    Does the ESXi8 OVA have the legacy CPU support enabled?

    Reply
    • William Lam says

      11/30/2022 at 12:31 pm

      No. You'll need to add this via boot option SHIFT+O and then permanently set it via ESXCLI for persistence

      Reply
      • James says

        11/30/2022 at 11:18 pm

        Thank you.

        Reply
  14. Andrew A says

    12/02/2022 at 9:26 pm

    Hi William,

    Thanks for making this script but I am unable to get it work. I am using a Windows 10 Desktop with Powershell + PowerCLI installed on it.
    I have a 3 node ESXi 7 cluster with VCenter 7 on it and a nfs-datastore. I am unable to understand where to put the vsphere 8 ova and the vcenter 8 (extracted). I put it on a datastore but then how will i give the path. - I am not able to get started itself.

    i have given the path as
    /vmfs/volumes/vmware-nfs/Nested_ESXi........ ova path
    /vmfs/volumes/vmware-nfs/Vcenter-8....... path of the vcenter 8 iso extracted

    but when I run the script I get.
    unable to find /vmfs/volumes/vmware-nfs/Nested_ESXi....

    point is how will we let vcenter know this path.. as the nfs is not mounted in the vcenter and how will vcenter access this path

    Reply
    • William Lam says

      12/03/2022 at 11:56 am

      The files along with the script run from your local desktop, not on your ESXi host 🙂

      Reply
  15. Eugene says

    12/08/2022 at 11:28 am

    Can some one please make instructions for people that are unfamiliar with powershell ect. What exactly needs to be present on vcenter prior to deployment? are clusters needs to be created prior running the script? I have been trying to deploy this for over a week and nothing had worked so far. With latest attempt i get this error.
    Import-VApp: C:\Users\me\Documents\VMware\Lab\LabDeployment.ps1:269
    Line |
    269 | … n $ovfconfig -Name $VMName -Location $cluster -VMHost $vmhost -Datast …
    | ~~~~~~~
    | Cannot validate argument on parameter 'VMHost'. The argument is null or empty. Provide an argument that is not
    | null or empty, and then try the command again.

    is there a video tutorial that explains on how to do this? I am even willing to pay some one to help with understand this thing!

    Reply
    • Eugene says

      12/09/2022 at 12:29 pm

      ok, so i have made some progress but getting stuck on this
      "Cannot fetch certificate from 'localhost'. Error: [WinError 10061] No connection could be made because the target machine actively refused it"

      Can some one please point me in to the right direction on this? 🙂

      Reply
      • Eugene says

        12/09/2022 at 4:33 pm

        Also while looking at the logs i found this error
        Powering VM: vcsa-1 task failed. Error: Task Failed on server: Insufficient resources to satisfy configured fail-over level for vSphere HA.

        Reply
        • Eugene says

          12/11/2022 at 7:14 pm

          Please, any one?

          Reply
          • Eugene says

            12/13/2022 at 1:36 pm

            wow, a few days and no one is willing to help???

  16. Eugene says

    02/08/2023 at 10:58 am

    I am running the scipt and when it gets to the point where it should be creating vApp on a Datacenter i get an error message in vcenter saying "The Operation is not supported"

    Reply
  17. Andy says

    02/09/2023 at 5:02 pm

    Having a weird issue with deployment, the steps where it is supposed to create the VDS, create new Management Port Group, and then migrate hosts to the VDS are not happening. If I look in the newly created Virtual Center, I'm not seeing it even attempt to create the VDS, so it makes sense those subsequent tasks are failing. This is from the deployment log.
    [02-09-2023_05:57:32] Creating VSAN DiskGroup for 192.168.2.13 ...
    New-VDSwitch: C:\Users\Andy\Desktop\Nested-vSphere8.ps1:450
    Line |
    450 | … VDSName -Location (Get-Datacenter -Name $NewVCDatacenterName) -Mtu 16 …
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | Cannot convert 'System.Object[]' to the type 'VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer'
    | required by parameter 'Location'. Specified method is not supported.
    [02-09-2023_05:58:04] Creating VDS Management Network Portgroup
    New-VDPortgroup: C:\Users\Andy\Desktop\Nested-vSphere8.ps1:453
    Line |
    453 | … Portgroup -Server $vc -Name $NewVCMgmtPortgroupName -Vds $vds | Out-F …
    | ~~~~
    | Cannot validate argument on parameter 'VDSwitch'. The argument is null or empty. Provide an argument that is not
    | null or empty, and then try the command again.
    Get-VDPortgroup: C:\Users\Andy\Desktop\Nested-vSphere8.ps1:454
    Line |
    454 | Get-VDPortgroup -Server $vc $NewVCMgmtPortgroupName | Get-VDU …
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | 2/9/2023 5:58:04 PM Get-VDPortgroup VDPortgroup with name 'DVPG-Management-Network' was not found using the
    | specified filter(s).
    [02-09-2023_05:58:04] Adding 192.168.2.11 to VDS
    Add-VDSwitchVMHost: C:\Users\Andy\Desktop\Nested-vSphere8.ps1:458
    Line |
    458 | $vds | Add-VDSwitchVMHost -VMHost $vmhost | Out-Null
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | Cannot validate argument on parameter 'VDSwitch'. The argument is null or empty. Provide an argument that is not
    | null or empty, and then try the command again.
    Add-VDSwitchPhysicalNetworkAdapter: C:\Users\Andy\Desktop\Nested-vSphere8.ps1:461
    Line |
    461 | … $vds | Add-VDSwitchPhysicalNetworkAdapter -VMHostNetworkAdapter …
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | Cannot validate argument on parameter 'DistributedSwitch'. The argument is null or empty. Provide an argument
    | that is not null or empty, and then try the command again.
    [02-09-2023_05:58:04] Adding 192.168.2.12 to VDS
    Add-VDSwitchVMHost: C:\Users\Andy\Desktop\Nested-vSphere8.ps1:458
    Line |
    458 | $vds | Add-VDSwitchVMHost -VMHost $vmhost | Out-Null
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | Cannot validate argument on parameter 'VDSwitch'. The argument is null or empty. Provide an argument that is not
    | null or empty, and then try the command again.
    Add-VDSwitchPhysicalNetworkAdapter: C:\Users\Andy\Desktop\Nested-vSphere8.ps1:461
    Line |
    461 | … $vds | Add-VDSwitchPhysicalNetworkAdapter -VMHostNetworkAdapter …
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | Cannot validate argument on parameter 'DistributedSwitch'. The argument is null or empty. Provide an argument
    | that is not null or empty, and then try the command again.
    [02-09-2023_05:58:04] Adding 192.168.2.13 to VDS
    Add-VDSwitchVMHost: C:\Users\Andy\Desktop\Nested-vSphere8.ps1:458
    Line |
    458 | $vds | Add-VDSwitchVMHost -VMHost $vmhost | Out-Null
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | Cannot validate argument on parameter 'VDSwitch'. The argument is null or empty. Provide an argument that is not
    | null or empty, and then try the command again.
    Add-VDSwitchPhysicalNetworkAdapter: C:\Users\Andy\Desktop\Nested-vSphere8.ps1:461
    Line |
    461 | … $vds | Add-VDSwitchPhysicalNetworkAdapter -VMHostNetworkAdapter …
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | Cannot validate argument on parameter 'DistributedSwitch'. The argument is null or empty. Provide an argument
    | that is not null or empty, and then try the command again.

    If I run the commands from line 450-454 the VDS, uplinks, and port group are created fine so I am not sure why this is failing. I am using latest VCSA 8.0 Update A I believe, downloaded yesterday, along with latest 8.0 update A nested OVA. The only things I have changed are, I set createvApp to 0 because it was consistently failing, and I am using my 192.168.2.0/24 for my subnet instead of what comes in the code.

    Reply
    • Eugene says

      02/19/2023 at 7:49 pm

      Hi, which line is the creation of vAPP?

      Reply
  18. Yevgeniy Levin says

    02/17/2023 at 1:09 pm

    I have the same issue. It always fails on creating vApp and stops deploying and configuring anything after that.

    Reply

Thanks for the comment! Cancel reply

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

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023
  • Is my vSphere Cluster managed by vSphere Lifecycle Manager (vLCM) as a Desired Image or Baseline? 03/10/2023
  • Interesting VMware Homelab Kits for 2023 03/08/2023

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 © 2023

 

Loading Comments...