Automating VCF Upgrade - Perform Health Checks
This is part two of a four part blog series in which I talk about automating the VMware Cloud Foundation upgrade process. In part one we discussed downloading the bundles to SDDC Manager to prepare the system for the upgrade process, in this post we discuss performing the upgrade pre-checks.
Ensuring your VMware Cloud Foundation instance is healthy prior to starting an upgrade is critical to a successful upgrade, SDDC Manager itself has a pre-check process which is executed on a per workload domain basis. Depending on the version of VMware Cloud Foundation your upgrading from this pre-check has seen some significant improvements over time. In addition to executing the specific workload domain pre-check at the SDDC Manager level our team released a PowerShell Module last year called VMware.CloudFoundation.Reporting
which can be utilized in conjunction with the internal pre-check to perform additional health checks prior to starting an upgrade step.
My recommendation would be to carry out the following steps before commencing with the any upgrade:
- Step 1 - Run a Health Report using
Invoke-VcfHealthReport
- Step 2 - Run an Alert Report using
Invoke-VcfAlertReport
- Step 3 - Run an initial SDDC Manager System Pre-Check for each Workload Domain
For detailed instructions on installed and using VMware.CloudFoundation.Reporting
refer to the GitHub Documentation
.
VMware Cloud Foundation APIs Used
- GET /v1/system/prechecks/tasks/{id}
- POST /v1/system/prechecks
PowerVCF Cmdlets
- Start-VCFSystemPrecheck
- Get-VCFSystemPrecheckTask
PowerShell Scripts
Run a Health Report using Invoke-VcfHealthReport
Procedure
Start Windows PowerShell.
Replace the values in the sample code with values for the instance of VMware Cloud Foundation and run the commands in the PowerShell console.
1$sddcManagerFqdn = "lax-vcf01.lax.rainpole.io"
2$sddcManagerUser = "[email protected]"
3$sddcManagerPass = "VMw@re1!"
4$sddcManagerLocalUser = "vcf"
5$sddcManagerLocalPass = "VMw@re1!"
6$reportPath = "F:\Reporting\LAX"
- Run a Health Report by running the following command:
1Invoke-VcfHealthReport -sddcManagerFqdn $sddcManagerFqdn -sddcManagerUser $sddcManagerUser -sddcManagerPass $sddcManagerPass -sddcManagerLocalUser $sddcManagerLocalUser -sddcManagerLocalPass $sddcManagerLocalPass -reportPath $reportPath -allDomains -failureOnly
- Review the Health Report and investigate any issues identified.
Run an Alert Report using Invoke-VcfAlertReport
Start Windows PowerShell.
Replace the values in the sample code with values for the instance of VMware Cloud Foundation and run the commands in the PowerShell console.
1$sddcManagerFqdn = "lax-vcf01.lax.rainpole.io"
2$sddcManagerUser = "[email protected]"
3$sddcManagerPass = "VMw@re1!"
4$reportPath = "F:\Reporting\LAX"
- Run a Health Report by running the following command:
1Invoke-VcfAlertReport -sddcManagerFqdn $sddcManagerFqdn -sddcManagerUser $sddcManagerUser -sddcManagerPass $sddcManagerPass -reportPath $reportPath -allDomains -failureOnly
- Review the Alert Report and investigate any issues identified.
Run an initial SDDC Manager System Pre-Check for each Workload Domain
Start Windows PowerShell.
Replace the values in the sample code with values for the instance of VMware Cloud Foundation and run the commands in the PowerShell console.
1$sddcManagerFqdn = "lax-vcf01.lax.rainpole.io"
2$sddcManagerUser = "[email protected]"
3$sddcManagerPass = "VMw@re1!"
4$workloadDomain = "lax-m01"
- Authenticate to the SDDC Manager appliance by running the following command:
1Request-VCFToken -fqdn $sddcManagerFqdn -username $sddcManagerUser -password $sddcManagerPass
- Generate the JSON spec for a pre-check and trigger it by running the following command:
1$jsonSpec = '{ "resources" : [ { "resourceId" : "'+ (Get-VCFWorkloadDomain | Where-Object {$_.name -eq $workloadDomain}).id+'", "type" : "DOMAIN" } ] }'
2$task = Start-VCFSystemPrecheck -json $jsonSpec
In this step we use the Start-VCFSystemPrecheck cmdlet to start the workload domain pre-check workflow and we capture the task ID in task variable.
- Generate the JSON spec for a pre-check and trigger it by running the following command:
1Do { $status = Get-VCFSystemPrecheckTask -id $task.id } While ($status.status -eq "IN_PROGRESS")
2$status.subtasks | Select-Object name, status
In this step we use the Get-VCFSystemPrecheckTask cmdlet to check on the status of the workflow and when complete display the summary of the tasks.
- Repeat these steps for each additional Workload Domain.
That completes the process of executing a system pre-check for a Workload Domain. You can download my startSystemPrecheck.ps1
script from GitHub
to simply execute:
1$sddcManagerFqdn = "lax-vcf01.lax.rainpole.io"
2$sddcManagerUser = "[email protected]"
3$sddcManagerPass = "VMw@re1!"
4$workloadDomain = "lax-m01"
5
6.\startSystemPrecheck.ps1 -server $sddcManagerFqdn -user $sddcManagerUser -pass $sddcManagerPass -workloadDomain $workloadDomain