WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • 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 // 72 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.bsky.social | @*protected email*) (@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

  • USB Network Native Driver Fling for ESXi 8.0 Update 1
  • 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!

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

Comments

  1. *protectedLuis 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
      • *protectedLuis 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. *protectedAnthony 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
      • *protectedAnthony 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. *protectedEgis 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
      • *protectedEgis says

        10/14/2022 at 2:42 am

        any "free" licenses for home usage maybe available ?

        Reply
  4. *protectedFrancois 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
    • *protectedChris 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
    • *protectedEthan B. says

      05/15/2023 at 12:24 pm

      I have the same "Could not find the hardware virtualization key" issue with non-homelab EPYC chips - assuming this is a deeper issue.

      Reply
      • *protectedFellow says

        07/26/2023 at 11:32 pm

        I had the same on a Threadripper Pro 3955:
        Could not find the hardware virtualization key from the ESXi host 'xxx.lan'.

        Reply
  5. *protectedTom 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
    • *protectedThomaspriv 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
    • *protectedAndrew Hancock (@einsteinagogo) says

      11/08/2022 at 4:14 am

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

      Reply
      • *protectedAndrew Hancock (@einsteinagogo) says

        11/08/2022 at 4:17 am

        or issues!

        Reply
  6. *protectedkurthv71 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. *protectedEugene 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
    • *protectedAndrew 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. *protectedEugene says

    10/27/2022 at 11:01 pm

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

    Reply
    • *protectedAndrew 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. *protectedFreddie 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. *protectedEugene 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
      • *protectedEugene 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. *protectedMikael 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+*protectedThomaspriv 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. *protectedJames 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
      • *protectedJames says

        11/30/2022 at 11:18 pm

        Thank you.

        Reply
  14. *protectedAndrew 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
      • *protectedSPJ says

        11/19/2023 at 12:37 am

        Awesome resource as usual @William .. had the exact same question as the SCRIPT notes doesn't really mention this for the "uninitiated" - HOPEFULLY this works in some way or form.. Fingers X

        Reply
  15. *protectedEugene 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
    • *protectedEugene 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
      • *protectedEugene 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
        • *protectedEugene says

          12/11/2022 at 7:14 pm

          Please, any one?

          Reply
          • *protectedEugene says

            12/13/2022 at 1:36 pm

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

  16. *protectedEugene 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
    • *protectedBoris Levenzon says

      04/22/2023 at 12:42 pm

      You need to have DRS enabled on the cluster.

      Reply
  17. *protectedAndy 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
    • *protectedEugene says

      02/19/2023 at 7:49 pm

      Hi, which line is the creation of vAPP?

      Reply
  18. *protectedYevgeniy 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
  19. *protectedBoris Levenzon says

    04/22/2023 at 12:51 pm

    Never mind found the answer, aside fromt the script it self the logger function: My-Logger "Connecting to the new VCSA ..." insinuates that new VCSA will be created.

    Reply
  20. *protectedSam Bell says

    09/15/2023 at 12:50 am

    Is there a way to run these automated lab scripts to deploy an environment/lab in VMware Workstation instead of needing to deploy the script/nested lab on an existing ESXi bare metal host? Workstation is my only option unfortunately, but I need to run Windows on the host. I built a system with 128 GB of RAM just for this. Sorry if this is a dumb question, but I'm just unsure. If not, do you have any other suggestions for an easy lab build on Workstation? Thank you.

    Reply
    • William Lam says

      09/15/2023 at 1:40 pm

      Not easily, since all the interfaces I’m using relies on either ESXi or vCenter endpoint

      Reply
      • *protectedsam bell says

        09/23/2023 at 6:02 am

        Oh too bad (for me). Thank you for your reply.

        Reply
  21. *protectedDaryl D Claiborne says

    10/15/2023 at 3:32 pm

    Can this be ran in a nested environment? My vsphere 8 environment is virtualize running on top of my vsphere 6.5 physical environment.

    Reply
    • William Lam says

      10/15/2023 at 3:53 pm

      That’s very definition of Nested 🙂

      The physical env doesn’t need to be 8.x but also why are you running such an old release! At least get to 7.x haha

      Reply
  22. *protectedGeorgi I. says

    10/17/2023 at 5:39 am

    Hello William,
    Thank you for all the knowledge you share here.
    I’m using your script as a base to deploy a nested vsphere-vsan-8-lab with Tanzu – Kubernetes. It’s hard to bend my mind around networking, I still can’t understand all the networks one needs to deploy and assign to different interfaces. At first it seem no so difficult as we install all the nested esxi and vcsa as virtual machines. Then – we need to have management, workload, and frontend networks for tanzu. And there is where I stuck. It would create to have a nice article about networking.

    Reply
  23. *protectedSPJ says

    12/13/2023 at 1:43 pm

    Everting Works

    Except cannot get rid of these two errors:

    -----------------
    Line |
    374 | Move-VApp -Server $viConnection $VAppName -Destination (Get-F …
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | 13/12/2023 21:13:39 Move-VApp You cannot move a vApp between different datacenters. <<<<<
    ----
    Line |
    445 | New-VsanDiskGroup -Server $vc -VMHost $vmhost -SsdCanonic …
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | 13/12/2023 21:15:38 New-VsanDiskGroup Server task failed: A general system error occurred: Failed to
    | reserve disk naa.6000c29d388d830970d3b50375f72f99 with exception: Failed to reserve disk
    | naa.6000c29d388d830970d3b50375f72f99 with exception: Reserve failed with error code: -1

    Don't even understand why this is coming up using esxi 7u30 hosts
    -----------------

    Reply
    • William Lam says

      12/13/2023 at 1:44 pm

      Are you using vSAN on your physical setup ... I suspect you are and if so, please see http://www.virtuallyghetto.com/2013/11/how-to-run-nested-esxi-on-top-of-vsan.html

      Reply
  24. *protectedJason Boche says

    03/06/2024 at 6:13 pm

    Good evening William,

    Have you received any feedback about vCenter 8.0 Update 2 causing errors in the nested esxi deployment script? It looks like as of vCenter 8.0u2 and including vCenter 8.0u2b, the script fails at line 408 and is unable to add the nested esxi hosts to the newly deployed vCenter 8.0 Update 2 server. The error message for each of the three hosts attempting to be added is:

    "Cannot contact the specified host (vesxi80-1). The host may not be available on the network, a network configuration problem may exist, or the management services on this host may not be responsing."

    Adding the hosts manually after the fact via the UI or via PowerCLI one liner works fine. This only happens during the nested esxi script execution.

    I've tried various vCenter and nested esxi build combinations and the common denominator starts with vCenter 8.0u2 and extends to 2b. Furthermore, the combination of vCenter Server 8.0 or 8.0u1 and ESXi 8.0u2b works fine. In other words.. presumably not an esxi issue.

    Thank you,
    Jas

    Reply
    • William Lam says

      03/06/2024 at 6:50 pm

      Hey Jason! Good to hear from you 🙂

      I’ve not had any reports and I’ve also deployed to 8.0U2 env without issues … typically that error simply means VC can’t talk to ESXi host, perhaps it’s still booting up when it attempts to add which should be a problem since VCSA is deployed after and that’s the long poll. Have you tried with just Nested ESXi 8.0U2?

      Reply
      • *protectedJason G Boche says

        03/07/2024 at 9:41 am

        Good morning William,

        Great to hear from you as well. I should have included that it only occurs when using DNS names to add hosts to the new VCSA ($addHostByDnsName = 1). When using IP addresses ($addHostByDnsName = 1), it works flawlessly. Regarding your question, the ESXI hosts are the first to be deployed and are powered up immediately, followed by an approximately 22 minute process to deploy and configure the VCSA. I don't think it's an ESXi boot up timing issue. I'll keep poking at it to see if I can root cause it.

        Thank you,
        Jas

        Reply
        • *protectedJason G Boche says

          03/07/2024 at 11:43 am

          Sorry I was too quick with the copy/paste above. That should have read:

          When using DNS names to add hosts to the new VCSA ($addHostByDnsName = 1), it fails due to the error message specified earlier.

          When using IP addresses ($addHostByDnsName = 0), it works flawlessly.

          Reply
          • William Lam says

            03/07/2024 at 12:06 pm

            Are you using only the "short hostname" in https://github.com/lamw/vsphere-8-lab-deployment/blob/master/vsphere-vsan-8-lab-deployment.ps1#L15-L17

            Basically, when you $addHostByDnsName = 1 the script will assume you've used short hostname and then append that to your DNS domain to form the FQDN and then that is used to add to vCenter Server. I bet this either contains the FQDN or something else is off and causing it to incorrectly forming the FQDN which may not be valid.

  25. *protectedJason G Boche says

    03/07/2024 at 2:00 pm

    William,

    I think we've more or less arrived at the same conclusion... name resolution broke with the arrival of vCenter Server 8.0 Update 2 (whereas the same deployment scripts work with anything prior to vCenter Server 8.0 Update 2). After some more testing in the lab, I can tell you what happened. The "why" part is still a bit of a mystery but it's somewhere in the scripted deployment of the VCSA.

    First, I'll provide a reasponse to your question. Yes I use the "esxi" short host names provided by default in the script. Although my personal regimine for the past 25+ years is to strictly use FQDN everywhere, I let it slide with your nested esxi scripts because I though early on it was required for some parsing element. And it always worked regardless. Even up through vSphere 8.0 Update 1.

    As I mentioned above, the nested esxi deployment scripts "broke" when using short names in conjunction with vCenter Server 8.0 Update 2. One workaround is to use FQDNs for the ESXi host name definitions. However, that doesn't explain what broke or changed.

    What changed is that during the deployment of VCSA 8.0 Update 2, the entry:
    search .
    is being appended to the end of /etc/resolv.conf

    That search . entry in /etc/resolv.conf prevents the appending of the domain suffix when resolving host names. So for instance, around line 408 when the nested ESXi hosts are being added to the new VCSA, the VCSA can no longer resolve the short names as it had been able to in the past.

    I rolled back to to previous versions and the search . entry doesn't exist in /etc/resolv.conf in VCSA 8.0 or VCSA 8.0u1. Something in the automated deployment of VCSA 8.0u2 is appending that search . entry.

    This can easily be tested with the adding and removal of the search . entry in an existing lab environment. Add search . and you won't be able to resolve short names. Remove search . and you'll be able to resolve short names with an appended DNS suffix.

    Thank you,
    Jas

    Reply
  26. *protectedPeter van de Velden says

    04/18/2024 at 12:31 pm

    Hello William,

    Good afternoon,

    Deploying the script vCenter 8.0 u2.

    [04-18-2024_09:01:53] Adding vmnic2/vmnic3 for "00 Management" to passthrough to Nested ESXi VMs ...
    [04-18-2024_09:02:04] Updating vCPU Count to 4 & vMEM to 10 GB ...
    [04-18-2024_09:02:05] Updating vSAN Cache VMDK size to 8 GB & Capacity VMDK size to 40 GB ...
    [04-18-2024_09:02:11] Powering On esxi-3 ...
    [04-18-2024_09:02:11] Creating VCSA JSON Configuration file for deployment ...
    [04-18-2024_09:02:11] Deploying the VCSA ...
    Error message: The path provided in the target setting in section new_vcsa,
    subsection vc does not exist. Check the value of the target setting in the JSON
    file provided to the installer.
    [04-18-2024_09:02:57] Creating vApp Nested-vSphere-vSAN-8-Lab-RPhnfwoO ...
    [04-18-2024_09:02:59] Moving Nested ESXi VMs into Nested-vSphere-vSAN-8-Lab-RPhnfwoO vApp ...
    Get-VM: E:\nestedlab\new script.ps1:368:23

    En the scripts stops.

    | 18-4-2024 21:03:04 Get-VM VM with name 'vcsa-1' was not found using the specified filter(s).

    Reply
  27. *protectedPeter van de Velden says

    04/18/2024 at 12:31 pm

    Can you give me clue what is wrong?

    Reply
  28. *protectedPeter van de Velden says

    04/19/2024 at 2:03 am

    Tried the script in on VCSA 7.03 appliance that works OK. the newest VCSA 8U2 has an issue with VCSA deployment.
    Error message: The path provided in the target setting in section new_vcsa,
    subsection vc does not exist. Check the value of the target setting in the JSON
    file provided to the installer.

    Reply
    • William Lam says

      04/19/2024 at 10:17 am

      Are you using the latest version of the script ... there were syntax changes in the VCSA JSON between 7.x/8.x and is most likely looking for the old syntax (why it works for 7.x)

      Reply
  29. *protectedmatteu31 says

    09/02/2024 at 12:34 pm

    Hello,
    Is it normal when VCSA 8.0.3 is deployed the service vmware observability doesn't start ? I tried 2 deployments and same issue.

    Reply
  30. *protectedFernando says

    09/03/2024 at 7:39 pm

    Anyone have tips/advice on how to proceed from the following error message? Everything runs smoothly up until this point and all the hosts are installed but no nested VCSA

    09-03-2024_10:16:06] Deploying the VCSA ...
    Error: OVF Tool: Error: Failed to transfer file [disk-0.vmdk] to host [192.168.100.11] (response code:500)
    Error: OVF Tool: Completed with errors
    Deployment failed. OVF Tool return error code: 1
    Failed to collect support bundle from the deployed appliance 'vcsa-1'. Exception: Cannot collect the support bundle because Cannot find the appliance 'vcsa-1' on the ESXi host '192.168.100.193'. Exception:
    Failed to find VM vcsa-1
    Error message: ApplianceDeploymentTask: Caught an exception Deployment failed. OVF Tool return error code: 1

    Reply
  31. *protectedMongo says

    03/07/2025 at 1:27 pm

    Hey, I'm not at all new to virtualization, but new to your nested scripts. On the face of it it all looks pretty straight forward, however, when I try to run the script(s) either nothing happens, or I get an error telling me that "No valid deployment configuration file was provided or file was not found.' So I'm obviously missing something pretty basic? I've searched plenty through the site to find some sort of build environment prerequisites but no joy...however, this site has so many years of updates, that any "Getting Started?" seems long buried. Anyway, From a 2019 server with PowerShell (5.1.17763.1971) and module VMware PowerCLI 13.3 installed, I execute the "sample.ps1" that i've modified with my vCenter/IP/.ova... information, and/or the vsphere-vsan-8-lab-deployment.ps1 all on the same network segment, I'm at a loss for getting anything to happen (as stated above), what am I missing? I am trying to build out a Nested 4 node on my VxRail P570F with vCenter 8 on ESXi 8 (2x12core Gold, 768 Ram, 8 ea 500G SSD's) to get savvy with Nesting, then I will work on the VCF deployment to prep for the VCF cert exam...Help.

    Reply
    • William Lam says

      03/07/2025 at 5:50 pm

      The script is very basic and easy to get started 🙂

      >> No valid deployment configuration file was provided or file was not found.

      This means you did NOT provide a path to the configuration file that contains all the relavent variables, this is a relatively new change. Please see https://williamlam.com/2025/03/enhancements-to-vmware-cloud-foundation-vcf-vsphere-automated-lab-deployment-scripts.html

      >> From a 2019 server with PowerShell (5.1.17763.1971) and module VMware PowerCLI 13.3

      You need to use PowerShell Core (this is called out in documentation, which is Github as the official source of truth)

      So curious if you tried to use script purely based on reading the blog or did you actually go to Github repo and follow the details outlined there https://github.com/lamw/vsphere-8-lab-deployment which I've tried to make as straight forward as possible

      Furthermore, since you might be new to deploying Nested ESXi .... You should also carefully review networking requirements https://williamlam.com/2023/05/refresher-on-nested-esxi-networking-requirements.html

      Reply
      • *protectedMongo says

        03/08/2025 at 1:20 am

        William, thanks for the reply which really helped to get me looking deeper, I'm getting closer but now have different errors which I'm sure you know exactly what's causing them. But as for your questions.

        ">> No valid deployment configuration file was provided or file was not found.

        This means you did NOT provide a path to the configuration file that contains all the relavent variables, this is a relatively new change...."

        When I went back and looked at the screenshots on the site, I then realized what I was lacking, the three parts of the command calling the various .ps1 files...I get it now. LoL I guess I'm so used to NOT looking at pictures for actual step information, we spell out the steps in all the documents I/we produce at work. Time for me to open my eyes.

        ">> From a 2019 server with PowerShell (5.1.17763.1971) and module VMware PowerCLI 13.3

        You need to use PowerShell Core (this is called out in documentation, which is Github as the official source of truth)"

        I completely missed that CORE requirement, mostly because I wasn't aware of that part of PowerShell...just didn't register because I'm not that deep with PS.

        "So curious if you tried to use script purely based on reading the blog or did you actually go to Github repo and follow the details outlined there https://github.com/lamw/vsphere-8-lab-deployment which I've tried to make as straight forward as possible"

        Yes Sir, I followed that Github page to fill out my environment variables and can see nowhere that would cause a hangup, but given that I missed a few other key requirements at the start...makes sense why it failed.

        "Furthermore, since you might be new to deploying Nested ESXi .... You should also carefully review networking requirements https://williamlam.com/2023/05/refresher-on-nested-esxi-networking-requirements.html"

        From the start I absolutely followed your guidance on the networking side and enabled MAC Learning on the DVS instead of Promiscuous, and Forged Transmits on a vSwitch.

        Anyway, as I'd mentioned above, I am now getting the script to actually run...however, I am getting errors at every step, thus I'm sure there's some other environment variables that i'm missing. Here's a little snippet:

        [03-08-2025_08:30:14] Connecting to Management vCenter Server 10.0.0.159 ...
        Connect-VIServer: C:\Users\dcgs_admin\Downloads\vsphere-vsan-8-lab-deployment.ps1:186
        Line |
        186 | … onnection = Connect-VIServer $VIServer -User $VIUsername -Password $V …
        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        | 3/8/2025 8:30:14 AM Connect-VIServer The SSL connection could not be established, see inner exception.
        Get-Datastore: C:\Users\dcgs_admin\Downloads\vsphere-vsan-8-lab-deployment.ps1:188
        Line |
        188 | … datastore = Get-Datastore -Server $viConnection -Name $VMDatastore | …
        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        | 3/8/2025 8:30:14 AM Get-Datastore You are not currently connected to any servers. Please connect first using a
        | Connect cmdlet.
        Get-Cluster: C:\Users\dcgs_admin\Downloads\vsphere-vsan-8-lab-deployment.ps1:189
        Line |
        189 | $cluster = Get-Cluster -Server $viConnection -Name $VMCluster
        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        | 3/8/2025 8:30:14 AM Get-Cluster You are not currently connected to any servers. Please connect first using a
        | Connect cmdlet.
        Get-Datacenter: C:\Users\dcgs_admin\Downloads\vsphere-vsan-8-lab-deployment.ps1:190
        Line |
        190 | $datacenter = $cluster | Get-Datacenter
        | ~~~~~~~~~~~~~~
        | 3/8/2025 8:30:14 AM Get-Datacenter You are not currently connected to any servers. Please connect first using a
        | Connect cmdlet.
        Get-VMHost: C:\Users\dcgs_admin\Downloads\vsphere-vsan-8-lab-deployment.ps1:191
        Line |
        191 | $vmhost = $cluster | Get-VMHost | Select -First 1
        | ~~~~~~~~~~
        | Cannot validate argument on parameter 'Datastore'. The argument is null or empty. Provide an argument that is
        | not null or empty, and then try the command again.
        Get-OvfConfiguration: C:\Users\dcgs_admin\Downloads\vsphere-vsan-8-lab-deployment.ps1:199
        Line |
        199 | $ovfconfig = Get-OvfConfiguration $NestedESXiApplianceOVA
        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        | 3/8/2025 8:30:14 AM Get-OvfConfiguration This cmdlet requires a vCenter Server connection.
        InvalidOperation: C:\Users\dcgs_admin\Downloads\vsphere-vsan-8-lab-deployment.ps1:200
        Line |
        200 | $networkMapLabel = ($ovfconfig.ToHashTable().keys | where {$_ …
        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        | You cannot call a method on a null-valued expression.
        InvalidOperation: C:\Users\dcgs_admin\Downloads\vsphere-vsan-8-lab-deployment.ps1:201
        Line |
        201 | $ovfconfig.NetworkMapping.$networkMapLabel.value = $VMNetwork
        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        | The property 'value' cannot be found on this object. Verify that the property exists and can be set.
        InvalidOperation: C:\Users\dcgs_admin\Downloads\vsphere-vsan-8-lab-deployment.ps1:203
        Line |
        203 | $ovfconfig.common.guestinfo.hostname.value = $VMName
        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        | The property 'value' cannot be found on this object. Verify that the property exists and can be set.
        InvalidOperation: C:\Users\dcgs_admin\Downloads\vsphere-vsan-8-lab-deployment.ps1:204
        Line |
        204 | $ovfconfig.common.guestinfo.ipaddress.value = $VMIPAddress
        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        | The property 'value' cannot be found on this object. Verify that the property exists and can be set.
        InvalidOperation: C:\Users\dcgs_admin\Downloads\vsphere-vsan-8-lab-deployment.ps1:205
        Line |

        ...it goes on with similar and cmdlet errors for each step of the script. Am I somehow supposed to connect PS to the vCenter prior to running the scripts?

        I definitely appreciate your help as this is definitely educating me on the PowerShell side of things, which I obviously need to get experienced with.

        Reply
        • William Lam says

          03/08/2025 at 6:13 am

          This is happening because by default, PowerCLI expects a trusted TLS endpoint (no different if you were to open a browser to self-signed TLS endpoint asking you to trust). Many users simply ignore error messages that tell you exactly what is going on, which in this case it is in very beginning "Connect-VIServer The SSL connection could not be established, see inner exception" which is an error message from PowerCLI itself, nothing with the script nor PowerShell.

          If you're using self-signed TLS certificate (which I assume you are), then you will to change the PowerCLI client by running Set-PowerCLIConfiguration to change to your desired settings. Please refer to documentation https://developer.broadcom.com/powercli/latest/vmware.vimautomation.core/commands/set-powercliconfiguration?scrollString=Set-PowerCLIConfiguration for more details. Since this is your first time using PowerCLI, it is recommended that you first connect to your existing vCenter Server and make sure that you have a successful connection (this is what is failing the script and hence all subsequent commands are failing, which is expected) and ensure you can do something as basic as "Get-VM". Once you can, then you can disconnect (See documentation) AND you should make further progress in the script, assuming you've filled out the variables correctly

          Reply

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

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