Just had a chat with someone on-line about a scripted install, as of ESX 3.5 the way to enable VMotion via the command-line changed. So for anyone looking for this particular command:
/usr/bin/vmware-vim-cmd "hostsvc/vmotion/vnic_set vmk0"
In this example “vmk0” is the first vmkernel. This is one of the things that changed, so no portgroup id’s anymore. And if you need to do anything via the command-line that doesn’t seem to be possible with the normal commands: vmware-vim-cmd. Definitely the way to go.
mastrboy says
you need a little more to create a vmotion interface from the command-line, i have written i script to handle it before:
————————————-
# Add vmotion portgroup to vSwitch0
esxcfg-vswitch -l | grep “VMotion” >/dev/null
if [ “$?” != “0” ]; then
esxcfg-vswitch -A VMotion vSwitch0
fi
# Add vmkernel vmotion interface to vmotion portgroup
# remember to change IP later, as this sets the VMotion to DHCP
esxcfg-vmknic -l | grep “VMotion” >/dev/null
if [ “$?” != “0” ]; then
esxcfg-vmknic -a VMotion -i DHCP
sleep 10
fi
# Activate vmotion and set enable migration
#/usr/bin/vimsh -n -e ‘hostsvc/vmotion/vnic_set vmk0’
VMOTION_VMK=`esxcfg-vmknic -l|grep vmk[0-9]| awk -F” ” ‘{ print $1 }’`
sub_message “Enable migration for VMotion port: $VMOTION_VMK”
vmware-vim-cmd hostsvc/vmotion/vnic_set $VMOTION_VMK
esxcfg-advcfg -s 1 /Migrate/Enabled >/dev/null
#Refresh network to reflect changes.
vmware-vim-cmd internalsvc/refresh_network
————————————-
This script will to all the vmotion work.