Tuesday, February 23, 2010

Configuring VMkernel port with an MTU of 9000 bytes

When configuring a vSphere4 host with a VMKernel port for iSCSI connectivity it is important to note that you cannot configure an MTU of 9000 bytes using the vSphere client. 

In addition you cannot create the VMKernel port using the vSphere client and then modify the MTU of the port via the service console.  You must create the VMKernel port with a MTU of 9000 bytes via the service console from the beginning.

I've included a sample script that will create an iSCSI port group and a VMKernel port with an MTU of 9000 bytes.  There are additional options that can be specified when using the esxcfg-vswitch and esxcfg-vmknic commands but I have only included those that are necessary for this example.


Please take note that the virtual switch has also been configured with an MTU of 9000 bytes.  This can be completed after the vSwitch has been created using the vSphere client or you can create the vSwitch using the command line, your choice.  In this example the vSwitch was created using the vSphere client and then modified using the service console.

Sample script to configure VMKernel port with an MTU of 9000 bytes

#!/bin/bash
#
# Delete the automatically created VM Network portgroup
esxcfg-vswitch -D "VM Network" vSwitch0
#
# Change the mtu to 9000 bytes on vSwitch
#
esxcfg-vswitch -m 9000 vSwitch0
#
# Add iSCSI port group to vSwitch
#
esxcfg-vswitch -A iSCSI vSwitch0
#
#Change the vlan id on the iSCSI portgroup to vlan 211
#
esxcfg-vswitch -p iSCSI -v 200 vSwitch0
#
#Add a vmkernel port to the iSCSI portgroup with an IP address and a 9000 byte MTU
#
esxcfg-vmknic -a vmk0 -i 192.168.200.200 -n 255.255.255.0 -m 9000 -p iSCSI
#
# List the vmkernel ports to verify that vmk0 has 9000 byte MTU
#
esxcfg-vmknic -l

No comments: