is there a powershell script which gives me the jumbo frames set on the network cards of the esx servers. I would rather not use the esxcfg commands.
Is there a reason why you don't want to SSH to the host and run the 'esxcfg-vswitch -l' command? As long as you have remote SSH enabled on the host (either ESX or ESXi) you can grab the information quickly, and easily.
I'm sure you can (probably) do it with powerCLI, but you'll need to look up the commands you'll need to enter to do it (not using it here)... I'd just use putty to ssh into the host box and run the command... You could save the settings for each of your hosts, so that it makes loggin into each of them just a click, or two...
VMware VCP4
Consider awarding points for "helpful" and/or "correct" answers.
Hi Guv,
Both commandlets Set-VMHostNetworkAdapter and Set-VirtualSwitch have parameter MTU. It is possible to update the MTU setting of existing switch and network adapter.Actually same applies to New- commandlets, so you can create new switch and network adapter with MTU 9000.
See little example:
Get-VMHost <target host> | Get-VirtualSwitch -Name <name of switch> | Set-VirtualSwitch -MTU 9000 Get-VMhost | Get-VirtualSwitch -Name <name of switch> | Get-VMHostNetworkAdapter -VMKernel | Set-VMHostNetworkAdapter -MTU 9000
Regards,
Vitali
PowerCLI Team
I think changing the vswitch mtu values looks ok to do , the problems i have is changing the mtu value of the vmnic. Currently my port group name is vmkernal1, ip is 172.16.10.1, and subnet mask 255.255.255.0. The vmnic associated with this vswitch is vmnic1. So the below command :
Get-VMhost | Get-VirtualSwitch -Name | Get-VMHostNetworkAdapter -VMKernel | Set-VMHostNetworkAdapter -MTU 9000
this would change the vmnic mtu value to 9000.
I tried using the command :
Get-VMhost "esxserver1 | Get-VirtualSwitch -Name vswitch1 | Get-VMHostNetworkAdapter -VMKernel
but this gives me errors.
I want to know how in powershell how you can change the mtu value of a vmnic, given the below parameters:
esxserver - esxserver1
vswitch - vswitch1
portgroup- vmkernal1
vmnic - vmnic1
Any advice please
Hi again,
First about the errors, it is my mistake. I was convinced that Get-VMHostNetworkAdapter can take VirtualSwitch as filter parameter, but it can't. I will file a bug for this since it seems to be useful.
To obtain the target kernel adapter use call like this:
Get-VMHost "esxname" | Get-VMHostNetworkAdapter -VMKernel | where { $_.PortGroupName -eq 'your kernel port group' }
I think that setting value 9000 for MTU of the virtual switch and kernel network adapter is enough to enable jumbo frames. The MTU value applied on given virtual switch is in force for all physical nics connected to the same switch.
Vitali
PowerCLI Team