Powershell to the rescue – Setting MTU size on a vmkernel port

During an implementation of Cisco UCS – one of the vmkernel ports on a standard switch was acting funny – it wasn’t getting set to the desired  MTU of 9000.  What made it odd is other kernel ports on that same switch were setting themselves correctly.  To resolve this – PowerShell to the rescue.  A quick search of google lead me to a post by Martijn Smit.  His blog post came in very handy as it provided the context of setting MTU for either a port group a vSwitch  or a standard switch.  In my case I was only worried about setting it on a VMKernel port.

From your vcenter you can capture the appropriate vmk port you need to set.  From PowerCLI

$vmkernel = GetVMHostNetworkAdapter Name vmk0 VMHost (GetVMHost Name esxi01.lab.local)
SetVMHostNetworkAdapter VirtualNic $vmkernel MTU 9000
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s