Automating VCF – Deploy Management Domain

In this part of the series, we take a look at how to deploy the Management Domain using VMware Cloud Builder.

The first step would typically be to download and populate the Deployment Parameters Workbook that is provided as part of VMware Cloud Builder, but in this series of blog posts we are going to generate everything we need using the new Planning and Preparation Workbook.

VMware Cloud Builder APIs Used

  • POST /v1/sddcs/validations
  • GET /v1/sddcs/validations/{id}
  • POST /v1/sddcs
  • GET /v1/sddcs/validations/{id}

PowerVCF Cmdlets

  • Connect-CloudBuilder
  • Start-CloudBuilderSDDCValidation
  • Get-CloudBuilderSDDCValidation
  • Start-CloudBuilderSDDC
  • Get-CloudBuilderSDDC

PowerShell Scripts

Procedure

Step 1 – Download and populate the Planning and Preparation Workbook for your target platform.

Step 2 – To generate the JSON spec using inputs from the Planning and Preparation Workbook run the following command:

.\createManagementDomainSpec.ps1 -Workbook E:\MyLab\pnpWorkbook.xlsx -Json E:\MyLab\sfo\sfo-managementDomain.json -defaultPassword VMw@re1! -nsxtPassword VMw@re1!VMw@re1!

The createManagementDomainSpec.ps1 script will open the supplied Planning and Preparation Workbook, read the ‘Workload Domain’ tab into a variable and then proceed to generate the JSON spec required by the VMware Cloud Builder Public API. Because no passwords are stored in the Workbook we also need to pass default passwords for NSX-T (-nsxtPassword switch) and all other components (-defaultPassword switch), these are passed as part of the command line input of the script.

Step 3 – Authenticate to the VMware Cloud Builder appliance by running the following command:

Connect-CloudBuilder sfo-cb01.sfo.rainpole.io admin VMw@re1!

Step 4 – Perform a validation of the JSON spec file and the target platform by running the following command:

$sddcValidation = Start-CloudBuilderSDDCValidation –json E:\MyLab\sfo\sfo-managementDomain.json

Using the Start-CloudBuilderSDDCValidation cmdlet, we trigger the validation process, here I’m capturing the output of the command into a variable to be used in the next step.

Step 5 – Poll the status of the validation task, by running the following command:

Do { $status = Get-CloudBuilderSDDCValidation -id $sddcValidation.id } While ($status.executionStatus -eq "IN_PROGRESS")

Here we are using the unique ID from the Start-CloudBuilderSDDCValidation cmdlet which we retrieve from the variable $sddcValidation.id which is then passed to the the Get-CloudBuilderSDDCValidation cmdlet. Then we are doing a Do / While loop where we are looking for an executionStatus of “IN_PROGRESS”, once the state changes from “IN_PROGRESS” we break from the loop.

Step 6 – Assuming the validation process completed without any issues, we can then start the actual deployment by running the following command:

$sddcDeployment = Start-CloudBuilderSDDC -json E:\MyLab\sfo\sfo-managementDomain.json

Using the Start-CloudBuilderSDDC cmdlet, we trigger the deployment process and again capture the output of the command into a variable which is used in the next step.

Step 7 – Poll the status of the deployment task, by running the following command:

Do { $status = Get-CloudBuilderSDDC -id $sddcDeployment.id } While ($status.status -eq "IN_PROGRESS")

Like before we are going to poll the status of the deployment, using the unique ID from the Start-CloudBuilderSDDC cmdlet which we retrieve from the variable $sddcDeployment.id and pass this time to the Get-CloudBuilderSDDC cmdlet. Again we are doing a Do / While loop where we are looking for an executionStatus of ‘IN_PROGRESS”, once the state changes from “IN_PROGRESS” we break from the loop.

That completes the process of deploying the Management Domain using VMware Cloud Builder without using the User Interface.

For other posts in this series see:

5 thoughts on “Automating VCF – Deploy Management Domain

  1. Pingback: Automating VMware Cloud Foundation with APIs/PowerVCF/PowerShell – My Cloudy World

  2. Pingback: Automating VCF – Create Network Pool – My Cloudy World

  3. Pingback: Automating VCF – Commission Hosts – My Cloudy World

  4. Pingback: Automating VCF – Deploy Workload Domain – My Cloudy World

  5. Pingback: Automating VCF – Deploy NSX-T Edge Cluster – My Cloudy World

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s