Hello guys!


I’m back on my blog after changing my job and generally having been very busy over the last two years.

Today I want to tell you guys about change in esxcli (which happened sometime in the last two years) which allows you to set vMotion, Management and for example fault tolerance Logging on a vmkernel interface in VMware ESXi.

In the past you had to do this with vim-cmd for fault tolerance and vmotion and had to use some other tricks to get this working with the mangement traffic.

Now however this is a simple esxcli command.

Here are the functions for vmotion that I’ve (re-)written for my esxi staging appliance.

# Configuring vMotion
# Function variables, if not defined uses standard values
if [ ! -z $2 ]; then mtu=$2; else mtu=1500; fi
# For every port group with that name, a vmk will be generated and configured for VMotion
for portGroup in `esxcli –formatter=csv network vswitch standard portgroup list | grep -i $portGroupName | awk -F “,” ‘{print $2}’`; do
esxcli network ip interface add -p $portGroup -m $mtu
case $esxVersion in
vmk=`esxcli –formatter=csv network ip interface list | grep -i $portGroup | awk -F “,” ‘{print $5}’`
vmk=`esxcli –formatter=csv network ip interface list | grep -i $portGroup | awk -F “,” ‘{print $4}’`
vmkIP=`echo $vmkIPs | awk -F “,” ‘{print $’$i’}’`
esxcli network ip interface ipv4 set -i $vmk -I $vmkIP -N $myVMMask -t static
esxcli network ip interface tag add -i $vmk -t VMotion
i=$(( $i + 1 ))

The command in bold can be found in the latest documentation: