[VMware] New Ways to set vMotion, fault Tolerance Logging, etc.

Back to Blog

[VMware] New Ways to set vMotion, fault Tolerance Logging, etc.

Hello guys!

scripting-platforms

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
SetVMotion()
{
# Function variables, if not defined uses standard values
portGroupName=$1
if [ ! -z $2 ]; then mtu=$2; else mtu=1500; fi
vmkIPs=$myVMIP1,$myVMIP2
# For every port group with that name, a vmk will be generated and configured for VMotion
i=1
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
“6.0.0”|”5.5.0″)
vmk=`esxcli –formatter=csv network ip interface list | grep -i $portGroup | awk -F “,” ‘{print $5}’`
;;
“5.0.0”|”4.1.0″)
vmk=`esxcli –formatter=csv network ip interface list | grep -i $portGroup | awk -F “,” ‘{print $4}’`
;;
*);;
esac
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 ))
done
}

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

Here

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to Blog