Enable Jumbo Frame Support in vSphere Using PowerCLI in 30 Seconds. :)

This applies to virtual switches that have already been created.

I was trying to do this earlier this evening and found a few articles that talked about various methods to enable jumbo frame support on a vSwitch.  After reading some of the ‘hacks’ that are being used, I decided to dig into PowerCLI.  Amazingly enough, the solution is so simple that maybe it’ll get some of the people working with vSphere to move into PowerCLI further.  Here’s the 30 second or less solution to the issue.  As I wrote above, this applies for a vSwitch that’s already been created, but you can create a vSwitch with all the specifications you need from PowerCLI as well just the New-VirtualSwitch commandlet.

> $vs = Get-VirtualSwitch –name vSwitchX
> Set-VirtualSwitch –VirtualSwitch $vs –mtu 9000

> Get-VirtualSwitch –name vSwitchX

If you’re not familiar with PowerShell, get familiar with it. 🙂 It’s an excellent product and is expandable so many IT products are moving toward a PowerShell interface for its ease of use.

[ad#Google Adsense-1]

The first command is: $vs = Get-VirtualSwitch –name vSwitchX.  This command sets a variable $vs equal to the result of the commandlet Get-VirtualSwitch.  The parameter –name is the actual name given to the virtual switch.

The second command is: Set-VirtualSwitch –VirtualSwitch $vs –mtu 9000.  The Set-VirtualSwitch commandlet allows you to make changes to a virtual switch that has already been created.  The parameter –VirtualSwitch accepts an instance of a virtual switch as defined previously in the variable as $vs.  You cannot use the virtual switch name here, but must pass in an actual object representing the virtual switch (ie. from the first command).  The second parameter –mtu allows you to set the frame size, in this case 9000 which is a typical jumbo frame size.

The third command: Get-VirtualSwitch –name vSwitch simply prints out information on the screen about the virtual switch named, allowing you to view some of the statistics.  Since $vs is still equal to the instance (object) that you’ve been working with, you could also simply type $vs at the command prompt to get the vSwitch statistics.

Of course prior to this you need to connect to the vSphere host using the Connect-VIServer command and get a list of the commands by using the Get-VICommand.  Good luck and appreciate the command prompt. 🙂

You can download PowerShell from Microsoft for free: http://www.microsoft.com/downloads/details.aspx?familyid=c6ef4735-c7de-46a2-997a-ea58fdfcba63&displaylang=en (This is the Vista package).

It comes preinstalled with Windows 7, Server 2008, and Server 2008 R2.

You can download vSphere PowerCLI from VMware here: http://communities.vmware.com/community/vmtn/vsphere/automationtools/powercli?sourceid=ie7&rls=com.microsoft:en-us:IE-SearchBox&ie=&oe=

You may need to create a VMware account to pull it down, I just can’t remember whether it asked me to login or not.

Make sure your switches and storage devices support jumbo frames.

Good luck!


One thought on “Enable Jumbo Frame Support in vSphere Using PowerCLI in 30 Seconds. :)”

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s