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 updated to support VMware Cloud Foundation (VCF) 5.1

Automated Lab Deployment Script updated to support VMware Cloud Foundation (VCF) 5.1

01.31.2024 by William Lam // 11 Comments

I finally got some time to update my Automated VMware Cloud Foundation Lab (VCF) Deployment script to support the latest VCF 5.1 release as this has been requested by a number of folks both internally and externally.

In addition to updating some of the new resource requirements such as increasing the Nested ESXi vSAN capacity drive from 60GB to 100GB, I was also thinking about some of the feedback that I had received internally from one of our engineers and that gave me some ideas on how to further stream the deployment using automation. I also came up with a few new ideas that I have added to the script, some of which I will cover in a future blog post 😁


The first thing you will notice is that you can now specify the number of ESXi hosts to deploy both for the VCF Management Domain as well as for a Workload Domain.


The script is doing more than just deploying the required Nested ESXi VM, but it will actually generate the VCF commission host file (JSON) that can then be used make SDDC Manager aware of the new ESXi hosts, which can then be used to deploy a Workload Domain.

While the previous version of the script already generated the required VCF Management Domain bringup file (JSON) based on your input, the VCF Bringup was performed manually by logging into the Cloud Builder UI and uploading the generated JSON file to begin the deployment. I have now enhanced the script to automatically wait for the Cloud Builder VM to be ready and then automatically initiate the VCF Bringup using the generated JSON, so there are no additional manual steps required other than opening a browser to the Cloud Builder URL to monitor the progress of your VCF deployment!


In my environment, the deployment of the 8 x Nested ESXi VM, Cloud Builder VM and initiating the bringup process took ~19minutes and then it took another ~1.5hrs for the complete VCF Management Domain to be fully deployed and configured. YMMV based on your available resources


Hopefully folks apperciate the additional simplicity of using this script and if you have any feedback, feel free to drop a comment here or better yet, leave a comment directly in the repo or even submit a PR. For the complete list of changes in the script, be sure to check out the change log section of the README in the repo. Enjoy!

More from my site

  • VMware Cloud Foundation (VCF) Homelab Hardware Options
  • Quick Tip - Character Limits for VMware Cloud Foundation (VCF) Objects
  • PowerCLI automation for VMware Private AI Foundation with NVIDIA (PAIF-N)
  • Automated VMware Cloud Foundation (VCF) host commission using ESXi Kickstart
  • Determining new VMware vSphere Foundation (VVF) & VMware Cloud Foundation (VCF) license usage in vSphere 8.0 Update 2b

Categories // Automation, PowerCLI, VMware Cloud Foundation Tags // VCF, VMware Cloud Foundation

Comments

  1. *protectedNiclas says

    01/31/2024 at 11:47 pm

    Fantastic William! Thanks for sharing!

    Reply
  2. *protectedMatt T says

    02/01/2024 at 6:22 am

    Will this work for non-nested configurations - Like your previous script you used to deploy VCF on Intel NUCs? I have 3 SFF hosts with similar in specs to the NUCs and want to deploy VCF - one MGMT two workload hosts - but reading through this script it looks like its mainly for nested builds.

    Reply
    • William Lam says

      02/01/2024 at 6:39 am

      Please see README for requirements

      Reply
  3. *protected*protected email* says

    07/01/2024 at 8:36 am

    Hi,

    love your work. Great article. Just been running against a standalone host - not working as expected - lots of errors on not finding values:

    [07-01-2024_08:33:53] Connecting to Management vCenter Server 10.100.1.148 ...
    Get-Cluster: C:\VCF\vcf-automated-lab-deployment.ps1:263
    Line |
    263 | $cluster = Get-Cluster -Server $viConnection -Name $VMCluster
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | 01/07/2024 08:33:53 Get-Cluster Cluster with name 'Compute' was not found using the specified filter(s).
    Get-OvfConfiguration: C:\VCF\vcf-automated-lab-deployment.ps1:272
    Line |
    272 | $ovfconfig = Get-OvfConfiguration $NestedESXiApplianceOVA
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | 01/07/2024 08:33:53 Get-OvfConfiguration This cmdlet requires a vCenter Server connection.
    InvalidOperation: C:\VCF\vcf-automated-lab-deployment.ps1:273
    Line |
    273 | $networkMapLabel = ($ovfconfig.ToHashTable().keys | where {$_ …
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | You cannot call a method on a null-valued expression.
    InvalidOperation: C:\VCF\vcf-automated-lab-deployment.ps1:274
    Line |
    274 | $ovfconfig.NetworkMapping.$networkMapLabel.value = $VMNetwork
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | The property 'value' cannot be found on this object. Verify that the property exists and can be set.

    Reply
    • William Lam says

      07/01/2024 at 10:05 am

      Please see requirements 🙂 Hint: vCenter is required

      Reply
    • *protected*protected email* says

      07/02/2024 at 3:36 am

      Ah - readme - not for standalone host....

      Reply
  4. *protectedmauro balbiani says

    07/09/2024 at 5:30 am

    Hi William
    the requrements mention a Standard or Distributed Portgroup (routable) to deploy all VMs. Why routable? Is it a must?

    Reply
    • William Lam says

      07/09/2024 at 7:46 am

      That was to convey that from the system where you run the PowerCLI script, that it'll be able to communicate to the network where the VMs are deployed and that it isn't some isolated network that you can't reach

      Reply
  5. *protectedAfzal Hossain says

    10/20/2024 at 2:45 am

    [10-20-2024_03:39:11] Logging into SDDC Manager ...
    [10-20-2024_03:39:11] Retreiving VCF Management Domain vcf-m01-rp01 PoolId ...
    [10-20-2024_03:39:11] Updating vcf-commission-host-api.json with PoolId value ...
    [10-20-2024_03:39:11] Validating ESXi host commission file vcf-commission-host-api.json ...
    [10-20-2024_03:40:05] Comissioning new ESXi hosts for Workload Domain deployment using vcf-commission-host-api.json ...
    [10-20-2024_03:40:05] Host commission has not completed, sleeping for 30 seconds
    [10-20-2024_03:40:35] Host commission has not completed, sleeping for 30 seconds
    [10-20-2024_03:41:06] Host commission has not completed, sleeping for 30 seconds
    [10-20-2024_03:41:36] Retreiving unassigned ESXi hosts from SDDC Manager and creating Workload Domain JSON deployment file wld-w01.json
    Cannot find an overload for "add" and the argument count: "2".
    At E:\wld\vcf-automated-workload-domain-deployment.ps1:340 char:9
    + $payload.computeSpec.clusterSpecs.Add("clusterImageId",$clust ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

    [10-20-2024_03:41:36] Starting Workload Domain deployment using file wld-w01.json
    New-VCFWorkloadDomain : The validation task commpleted the run with the following problems:
    At E:\wld\vcf-automated-workload-domain-deployment.ps1:348 char:22
    + ... eployment = New-VCFWorkloadDomain -json $VCFWorkloadDomainDeploymentJ ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-VCFWorkloadDomain

    Script File: C:\Program Files\WindowsPowerShell\Modules\PowerVCF\2.4.1.1000\PowerVCF.psm1 Line: 1951
    Relevant Command: Write-Error $response.validationChecks.errorResponse.message
    Target Uri:
    Exception Message: Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Message'. Specified method is not supported.
    Error Message:
    [10-20-2024_03:41:47] Open a browser to your SDDC Manager to monitor the deployment progress
    [10-20-2024_03:41:47] VCF Workload Domain Deployment Complete!
    [10-20-2024_03:41:47] StartTime: 10/20/2024 15:39:05
    [10-20-2024_03:41:47] EndTime: 10/20/2024 15:41:47
    [10-20-2024_03:41:47] Duration: 2.69 minutes to initiate Workload Domain deployment
    PS E:\wld>

    Reply
    • *protectedSamusArun says

      12/06/2024 at 8:42 am

      I ran into this same error. I'm not sure why I was getting the cluster count error. But the 2nd part that error'd on the "New-VCFWorkloadDomain" function was failing due to bad licensing. Once I fixed my licenses, that succeeded and kicked off. However, again.... i'm not sure why I continue to get the cluster count issue.

      Reply
  6. *protectedJan says

    01/01/2025 at 7:56 am

    I ran in to the problem that at least on my hardware (AMD Ryzen 3600) the nested ESX host would not boot. After some searching I found that the hardware version is vmx-14 to get the nested esxi host running I needed to upgrade the vmx version to 21.

    To do that from the script I added the following lines. Jus before booting the nested esxi hosts...

    My-Logger "Upgrading hardware for $vmname ..."
    $VMConfig = Get-View -VIObject $VM.Name
    $vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
    $vmConfigSpec.ScheduledHardwareUpgradeInfo = New-Object -TypeName VMware.Vim.ScheduledHardwareUpgradeInfo
    $vmConfigSpec.ScheduledHardwareUpgradeInfo.UpgradePolicy = "always"
    $vmConfigSpec.ScheduledHardwareUpgradeInfo.VersionKey = "vmx-21"
    $VMConfig.ReconfigVM($vmConfigSpec)

    My-Logger "Powering On $vmname ..."

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