Automating VCF – Deploy vRealize Suite Lifecycle Manager
This is the sixth and final blog in a series that discusses automating VMware Cloud Foundation using the Public APIs and PowerVCF. The series illustrates deploying the Management Domain, creating a Network Pool, commissioning ESXi host, deploying a Workload Domain including NSX-T Edge Cluster and vRealize Suite Lifecycle Manager.
In this post, we will take a look at how to initiate the vRealize Suite Lifecycle Manager deployment workflow in SDDC Manager.
VMware Cloud Foundation APIs Used
- GET /v1/bundles
- POST /v1/bundles
- POST /v1/vrslcms
- GET /v1/tasks/{id}
PowerVCF Cmdlets
- Get-VCFBundle
- Request-VCFBundle
- New-VCFvRSLCM
- Get-VCFTask
PowerShell Scripts
Procedure
Download and populate the Planning and Preparation Workbook for your target platform.
To generate the JSON spec using inputs from the Planning and Preparation Workbook run the following command:
1.\createDeployVrslcmAvnSpec.ps1 -Workbook "E:\pnpWorkbook.xlsx" -Json "E:\MyLab\sfo\sfo-vrslcmDeploy.json" -sshPassword "VMw@re1!" -apiPassword "VMw@re1!"
The createDeployVrslcmAvnSpec.ps1 script will open the supplied Planning and Preparation Workbook, read the 'Management Domain' tab into a variable and then proceed to generate the JSON spec required by the Public API.
- Authenticate to the SDDC Manager appliance by running the following command:
1Request-VCFToken -fqdn "sfo-vcf01.sfo.rainpole.io" -username "[email protected]" -password "VMw@re1!"
- Obtain the bundle ID of for vRealize Suite Lifecycle Manager by running the following command:
1$bundleDetails = Get-VCFBundle | Where {$_.description -Match "vRealize"}
In this step we use the Get-VCFBundle cmdlet to capture the bundle ID for vRealize Suite Lifecycle Manager. We will use this in the next step to download the bundle.
- Obtain the vRealize Suite Lifecycle Manager bundle by running the following command:
1Request-VCFBundle -id $bundleDetails.id
In this procedure we are using the Request-VCFBundle cmdlet to request the download of the vRealize Suite Lifecycle Manager bundle.
- Poll the status of the bundle download, by running the following command:
1Do { $status = Get-VCFBundle -id $bundleDetails.id} While ($status.downloadStatus -eq "IN_PROGRESS")
- Start the vRealize Suite Lifecycle Manager deployment workflow by running the following command:
1$deployVrslcm = New-VCFvRSLCM -json "E:\MyLab\sfo\sfo-vrslcmDeploy.json"
Using the New-VCFvRSLCM cmdlet, we trigger the vRealize Suite Lifecycle Manager deployment workflow, here I'm capturing the output of the command into a variable to be used in the next step.
- Poll the status of the vRealize Suite Lifecycle Manager deployment workflow, by running the following command:
1Do { $status = Get-VCFTask -id $deployVrslcm.id ;} While ($status.status -eq "In Progress")
Here we are polling the status of the workflow, using the unique ID from the New-VCFvRSLCM cmdlet which we retrieve from the variable $deployVrslcm.id and pass to the Get-VCFTask cmdlet. We perform a Do / While loop where we are looking for status of "In Progress", once the state changes from "In Progress" we break from the loop.
That completes the process of generating a vRealize Suite Lifecycle Manager JSON spec used by the public API and running the deployment workflow in SDDC Manager.
Other Posts in Series
- Automating VMware Cloud Foundation with APIs/PowerVCF/PowerShell
- Automating VCF - Deploy Management Domain
- Automating VCF - Create Network Pool
- Automating VCF - Commission Hosts
- Automating VCF - Deploy Workload Domain
- Automating VCF - Deploy NSX-T Edge Cluster
- Automating VCF - Deploy vRealize Suite Lifecycle Manager