Skip to content

balusaba/vcf-automated-lab-deployment

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Automated VMware Cloud Foundation Lab Deployment

Table of Contents

Description

Similar to previous "Automated Lab Deployment Scripts" (such as here, here, here, here, here and here), this script makes it very easy for anyone to deploy a "basic" VMware Cloud Foundation (VCF) in a Nested Lab environment for learning and educational purposes. All required VMware components (ESXi and Cloud Builder VMs) are automatically deployed and configured to allow for VCF to be deployed and configured using VMware Cloud Builder. For more information, you can refer to the official VMware Cloud Foundation documentation.

Below is a diagram of what is deployed as part of the solution and you simply need to have an existing vSphere environment running that is managed by vCenter Server and with enough resources (CPU, Memory and Storage) to deploy this "Nested" lab. For VCF enablement (post-deployment operation), please have a look at the Sample Execution section below.

You are now ready to get your VCF on! 😁

Changelog

  • 05/25/2021
    • Initial Release

Requirements

  • vCenter Server running at least vSphere 6.7 or later

    • If your physical storage is vSAN, please ensure you've applied the following setting as mentioned here
  • Resource Requirements

    • Compute

      • Ability to provision VMs with up to 8 vCPU
      • Ability to provision up to 192 GB of memory
    • Network

      • 1 x Standard or Distributed Portgroup (routable) to deploy all VMs (VCSA, NSX-T Manager & NSX-T Edge)
        • 9 x IP Addresses for Cloud Builder, SDDC Manager, VCSA, ESXi and NSX-T VMs
    • Storage

      • Ability to provision up to 400GB of storage

      Note: For detailed requirements, plesae refer to the official document here

  • VMware Cloud Foundation 4.2 Licenses for vCenter, ESXi, vSAN and NSX-T

  • Desktop (Windows, Mac or Linux) with latest PowerShell Core and PowerCLI 12.1 Core installed. See instructions here for more details

  • vSphere 7 Update 1d & Cloud Builder OVAs:

Configuration

Before you can run the script, you will need to edit the script and update a number of variables to match your deployment environment. Details on each section is described below including actual values used in my home lab environment.

This section describes the credentials to your physical vCenter Server in which the vSphere with Tanzu lab environment will be deployed to:

$VIServer = "FILL-ME-IN"
$VIUsername = "FILL-ME-IN"
$VIPassword = "FILL-ME-IN"

This section describes the location of the files required for deployment.

$NestedESXiApplianceOVA = "C:\Users\william\Desktop\VCF\Nested_ESXi7.0u1d_Appliance_Template_v1.ova"
$CloudBuilderOVA = "C:\Users\william\Desktop\VCF\VMware-Cloud-Builder-4.2.0.0-17559673_OVF10.ova"

This section defines the number of Nested ESXi VMs to deploy along with their associated IP Address(s). The names are merely the display name of the VMs when deployed. At a minimum, you should deploy at least three hosts, but you can always add additional hosts and the script will automatically take care of provisioning them correctly.

$VCSALicense = "FILL-ME-IN"
$ESXILicense = "FILL-ME-IN"
$VSANLicense = "FILL-ME-IN"
$NSXLicense = "FILL-ME-IN"

This section describes the configuration for the VMware Cloud Builder virtual appliance:

$CloudbuilderVMName = "vcf-m01-cb01"
$CloudbuilderHostname = "vcf-m01-cb01.tshirts.inc"
$CloudbuilderIP = "172.17.31.180"
$CloudbuilderAdminUsername = "admin"
$CloudbuilderAdminPassword = "VMw@re123!"
$CloudbuilderRootPassword = "VMw@re123!"

This section describes the configuration that will be used to deploy SDDC Manager within the Nested ESXi environment:

$SddcManagerName = "vcf-m01-sddcm01"
$SddcManagerIP = "172.17.31.181"
$SddcManagerVcfPassword = "VMware1!"
$SddcManagerRootPassword = "VMware1!"
$SddcManagerRestPassword = "VMware1!"
$SddcManagerLocalPassword = "VMware1!VMware1!"

This section defines the number of Nested ESXi VMs to deploy along with their associated IP Address(s). The names are the display name of the VMs when deployed and you should ensure these are added to your DNS infrastructure. A minimum of four hosts is required for proper VCF deployment.

$NestedESXiHostnameToIPs = @{
    "vcf-m01-esx01"   = "172.17.31.185"
    "vcf-m01-esx02"   = "172.17.31.186"
    "vcf-m01-esx03"   = "172.17.31.187"
    "vcf-m01-esx04"   = "172.17.31.188"
}

This section describes the minimum amount resources that will need to be allocated to each of the Nested ESXi VM(s) for proper VCF configuration Depending on your usage, you may want to increase the resources but for proper functionality, this is the minimum to start with. For Memory and Disk configuration, the unit is in GB.

$NestedESXivCPU = "8"
$NestedESXivMEM = "38" #GB
$NestedESXiCachingvDisk = "4" #GB
$NestedESXiCapacityvDisk = "60" #GB

This section describes the Nested ESXi Network that will be used for VCF configuration, this CIDR definition should match the network specified in $VMNetwork variable.

$NestedESXiManagementNetworkCidr = "172.17.31.0/24"

This section describes the configurations that will be used to deploy the VCSA within the Nested ESXi environment:

$VCSAName = "vcf-m01-vc01"
$VCSAIP = "172.17.31.182"
$VCSARootPassword = "VMware1!"
$VCSASSOPassword = "VMware1!"

This section describes the configurations that will be used to deploy the NSX-T infrastructure within the Nested ESXi environment:

$NSXManagerVIPName = "vcf-m01-nsx01"
$NSXManagerVIPIP = "172.17.31.183"
$NSXManagerNode1Name = "vcf-m01-nsx01a"
$NSXManagerNode1IP = "172.17.31.184"
$NSXRootPassword = "VMware1!VMware1!"
$NSXAdminPassword = "VMware1!VMware1!"
$NSXAuditPassword = "VMware1!VMware1!"

This section describes the location as well as the generic networking settings applied to Nested ESXi & Cloud Builder VMs:

$VMDatacenter = "San Jose"
$VMCluster = "Compute Cluster"
$VMNetwork = "sjc-comp-mgmt (1731)"
$VMDatastore = "comp-vsanDatastore"
$VMNetmask = "255.255.255.0"
$VMGateway = "172.17.31.1"
$VMDNS = "172.17.31.2"
$VMNTP = "172.17.31.2"
$VMPassword = "VMware1!"
$VMDomain = "tshirts.inc"
$VMSyslog = "172.17.31.182"
$VMFolder = "VCF"

Note: It is recommended that you use an NTP server that has both forward and DNS resolution configured. If this is not done, during the VCF JSON pre-req validation phase, it can take longer than expected for the DNS timeout to complete prior to allowing user to continue to VCF deployment.

Once you have saved your changes, you can now run the PowerCLI script as you normally would.

Logging

There is additional verbose logging that outputs as a log file in your current working directory vcf-lab-deployment.log

Sample Execution

In the example below, I will be using a one /24 VLANs (172.17.31/0/24). The first network will be used to provision all VMs and place them under typical vSphere Management network configuration and 5 IPs will be allocated from this range for the Supervisor Control Plane and 8 IPs for the NSX ALB Service Engine. The second network will combine both IP ranges for the NSX ALB VIP/Frontend function as well as the IP ranges for Workloads. See the table below for the explicit network mappings and it is expected that you have a setup similar to what has been outlined.

Hostname IP Address Function
vcf-m01-cb01.tshirts.inc 172.17.31.180 Cloud Builder
vcf-m01-sddcm01.tshirts.inc 172.17.31.181 SDDC Manager
vcf-m01-vc01.tshirts.inc 172.17.31.182 vCenter Server
vcf-m01-nsx01.tshirts.inc 172.17.31.183 NSX-T VIP
vcf-m01-nsx01a.tshirts.inc 172.17.31.184 NSX-T Node 1
vcf-m01-esx01.tshirts.inc 172.17.31.185 ESXi Host 1
vcf-m01-esx02.tshirts.inc 172.17.31.186 ESXi Host 2
vcf-m01-esx03.tshirts.inc 172.17.31.187 ESXi Host 3
vcf-m01-esx04.tshirts.inc 172.17.31.188 ESXi Host 4

Lab Deployment Script

Here is a screenshot of running the script if all basic pre-reqs have been met and the confirmation message before starting the deployment:

Here is an example output of a complete deployment:

Note: Deployment time will vary based on underlying physical infrastructure resources. In my lab, this took ~12min to complete.

Once completed, you will end up with four Nested ESXi VM and VMware Cloud Builder VMs which is placed into a vApp.

At the end of the deployment, an automatically generated VMware Cloud Foundation JSON configuration failed named vcf-config.json will be saved in the current working directory. This will be used as input to deploy your SDDC using the Cloud Builder interface.

Deploy VMware Cloud Foundation

Step 1 - Open a browser to the FQDN of the Cloud Builder VM and select VMware Cloud Foundation as the infrastructure to deploy and accept the EULA

Step 2 - Ignore the Download Workbook option and click next until you are presented with the option to upload VCF JSON configuration file which was generated as part of the initial deployment. Click next to proceed to the validation phase.

Step 3 - The validation phase should take a few minutes to complete and it is expected to have at least three warnings as shown in the screenshot below. At this point, you can acknowledge the warning and then click next which proceed with deploying and configuring VCF.

The deployment and configuration can take up to several hours to complete depending on the resources of your underlying hardware. In this example, the deployment took about 1hr and 45 minutes to complete and you should see a success message as shown below.

Step 4 - Click on the Finish button which should prompt you to login to SDDC Manager. You will need to use [email protected] credentials that you had configured within the deployment script for the deployed vCenter Server.

About

Automated VMware Cloud Foundation Lab Deployment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%