I want to modify all of my 400+ esxi hosts with modified line in the vpxa.cfg file. I want to change the threadstacksizekb to 256 from 128
<Config>
<vmacore>
<threadPool>
<ThreadStackSizeKb>256</ThreadStackSizeKb>
</threadPool>
</vmacore>
</Config>
I usually use PCLI to do the majority of my tasks and this is no different. Help me PowerCLI community, you are my only hope 😜 /vStarwars
This is almost the same question as in Editing vpxa.cfg. Take a look at the answers provided there.
Ah, I figured it out... same way I scripted replacing the welcome & motd file.
#edit, cant get the script to display right
See Some ways to enter PowerCLI code under the new forum SW to learn some ways to insert PowerCLI code in posts in this community.
#VPXA.cfg mod #Import NetApp Powershell CMDLETS Import-Module DataonTap #Capture all ESXi hosts $VMHosts = Get-VMHost #Capture Date/Time of Execution $FileDate = get-date -format yyyyMMdd"_"HHmm #Capture ESXi host creds Write-Host please enter ESXi credentials $Creds = Get-Credential #Options $readVPXA = $true Foreach($vmh in $VMHosts){ $startSSH = $false Write-Host "Modifying ESXi Host:"$vmh.Name #Start the SSH Service if($VMH | Get-VMHostService | Where { $_.Key -match "TSM" -and $_.Running -ne "true"}){ $VMH | Get-VMHostService | Where { $_.Key -match "TSM"} | Start-VMHostService -Confirm:$false | Out-Null $startSSH = $true } #Store old files with time/date Write-Host "Backing up config file" invoke-nassh -name $VMH.Name -Credential $Creds "cp -p /etc/vmware/vpxa/vpxa.cfg /etc/vmware/vpxa/vpxa.cfg.old_$FileDate" | Out-Null #Modifying the vpxa.cfg Write-Host "Modifying VPXA.CFG with modified ThreadStackSizeKB" Invoke-NaSsh -Name $VMH.Name -Credential $Creds "sed -i -e's/<ThreadStackSizeKb>128</<ThreadStackSizeKb>256</' /etc/vmware/vpxa/vpxa.cfg" | Out-Null if($readVPXA){ Write-Host "Here is the modified line on the vpxa.cfg" Invoke-NaSsh -Name $VMH.Name -Credential $Creds "cat /etc/vmware/vpxa/vpxa.cfg | grep -i ThreadStackSize" } Write-Host "" #Stop the SSH Service if it was started by this script if($startSSH){ $VMH | Get-VMHostService | Where { $_.Key -match "TSM"} | Stop-VMHostService -Confirm:$false | Out-Null $startSSH = $false } }
FINALLY!... lol thanks for that post