From 79bcb20f8fa157b42280a6950af788c3d5ca6a85 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 24 Jan 2024 17:55:02 -0600 Subject: [PATCH] update --- esxi-scripts/host-maintenance_mode.ps1 | 1 - esxi-scripts/set-drs.ps1 | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 esxi-scripts/set-drs.ps1 diff --git a/esxi-scripts/host-maintenance_mode.ps1 b/esxi-scripts/host-maintenance_mode.ps1 index 07e9f84f..2adc57d1 100755 --- a/esxi-scripts/host-maintenance_mode.ps1 +++ b/esxi-scripts/host-maintenance_mode.ps1 @@ -1,6 +1,5 @@ #!/usr/bin/env pwsh -Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null . /opt/idssys/powerwall/settings.ps1 $ESXI = Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null diff --git a/esxi-scripts/set-drs.ps1 b/esxi-scripts/set-drs.ps1 new file mode 100755 index 00000000..6a88f24f --- /dev/null +++ b/esxi-scripts/set-drs.ps1 @@ -0,0 +1,22 @@ +#!/usr/bin/env pwsh + +. /opt/idssys/powerwall/settings.ps1 + +$ESXI = Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null + + +$spec = New-Object VMware.Vim.ClusterConfigSpecEx +$spec.DrsConfig = New-Object VMware.Vim.ClusterDrsConfigInfo + +$spec.DrsConfig.Option = New-Object VMware.Vim.OptionValue[] (1) +$spec.DrsConfig.Option[0] = New-Object VMware.Vim.OptionValue +$spec.DrsConfig.Option[0].Key = 'MaxVcpusPerCore' +$spec.DrsConfig.Option[1].Value = "3" + +$modify = $true +$cluster_ID= Get-Cluster -Name "iDS-Cluster" +$_this = Get-View -Id $cluster_ID.Id +$_this.ReconfigureComputeResource_Task($spec, $modify) + + +Disconnect-VIServer $ESXI -Confirm:$false \ No newline at end of file