diff --git a/esxi-scripts/disable-system-vms.ps1 b/esxi-scripts/disable-system-vms.ps1 new file mode 100755 index 00000000..6595bc5b --- /dev/null +++ b/esxi-scripts/disable-system-vms.ps1 @@ -0,0 +1,9 @@ +#!/usr/bin/env pwsh + +. /opt/idssys/powerwall/settings.ps1 + +Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null + +Set-DrsRule -Rule "System VMs (S)" -Enabled $false; + +Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false \ No newline at end of file diff --git a/esxi-scripts/set-drs.ps1 b/esxi-scripts/set-drs.ps1 index f39523bc..f5a5f815 100755 --- a/esxi-scripts/set-drs.ps1 +++ b/esxi-scripts/set-drs.ps1 @@ -13,10 +13,9 @@ $spec.DrsConfig.Option[0] = New-Object VMware.Vim.OptionValue $spec.DrsConfig.Option[0].Key = 'MaxVcpusPerCore' $spec.DrsConfig.Option[0].Value = $args[0] -$modify = $true $cluster_ID= Get-Cluster -Name "iDS-Cluster" $_this = Get-View -Id $cluster_ID.Id -$_this.ReconfigureComputeResource_Task($spec, $modify) +$_this.ReconfigureComputeResource_Task($spec, $true) Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false \ No newline at end of file