I have the below Script to set the MTU to 9000
I need assistance to modify it in order to apply it only to specific cluster
Get-VMHost | Get-VMHostNetworkAdapter -VMKernel |
where{$_.Mtu -ne $mtuSize} |
Set-VMHostNetworkAdapter -Mtu $mtuSize -Confirm:$false
Try like this
$clusterName = 'cluster'
$mtuSize = 9000
Get-Cluster -Name $clusterName |
Get-VMHost |
Get-VMHostNetworkAdapter -VMKernel |
where{$_.Mtu -ne $mtuSize} |
Set-VMHostNetworkAdapter -Mtu $mtuSize -Confirm:$false
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this
$clusterName = 'cluster'
$mtuSize = 9000
Get-Cluster -Name $clusterName |
Get-VMHost |
Get-VMHostNetworkAdapter -VMKernel |
where{$_.Mtu -ne $mtuSize} |
Set-VMHostNetworkAdapter -Mtu $mtuSize -Confirm:$false
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Please note that depending on what you want to achieve, you may also need to set the MTU size on the vSwitches that the VMkernel adapters are connected to.
André