This commit is contained in:
2024-01-27 19:52:19 -06:00
parent b0b533fe92
commit ccf763a641
2 changed files with 7 additions and 2 deletions

View File

@@ -1,9 +1,11 @@
#!/usr/bin/env pwsh
. /opt/idssys/powerwall/settings.ps1
Write-Progress -Activity "Connecting to vCenter [$VCENTERHOST] ..." -PercentComplete 20
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
Write-Progress -Activity "Connected! Setting the new DRS Max vCPU ..." -PercentComplete 70
$spec = New-Object VMware.Vim.ClusterConfigSpecEx
$spec.DrsConfig = New-Object VMware.Vim.ClusterDrsConfigInfo
@@ -17,7 +19,10 @@ $cluster_ID= Get-Cluster -Name "iDS-Cluster"
$_this = Get-View -Id $cluster_ID.Id
$_this.ReconfigureComputeResource_Task($spec, $true)
Write-Progress -Activity "Refreshing DRS and invoking any DRS Recommendations ..." -PercentComplete 90
Get-Cluster -Name "iDS-Cluster" | Get-DrsRecommendation -Refresh | Invoke-DrsRecommendation
Write-Progress -Activity "Done" -Completed
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false