VMware Cloud Community
darren_boyd
Enthusiast
Enthusiast
Jump to solution

Enabling VMotion from command line

I have deployed ESX 3.0.1 build 35804 to a DL585G2 server via a kickstart file. I have written a small script to set up the network, however I cannot enable vmotion by this method. I am required to use the GUI.

I have attempted to 'echo 1 > /proc/vmware/config/Migrate/Enabled' however when I restart hostd (via service mgmt-vmware restart) the setting reverts to its previous value.

Has anyone successfully managed to enable/disable vmotion via command line?

0 Kudos
23 Replies
Dennis2
Contributor
Contributor
Jump to solution

This doesn't work in ESX 3.5 since internal ID:s for portgroups isn't listed with the command esxcfg-vswitch -l anymore

esxcfg-vswitch -l

ESX 3.0.x

ESX 3.5

0 Kudos
Dennis2
Contributor
Contributor
Jump to solution

The new solution in ESX 3.5 considering the new syntax of the command

4.5 Enable VMotion
Enable a VirtualNic to be used as the VMotion NIC. This can be useful when undertaking automated ESX builds. Thanks to Mike Laverick () for picking up the change between 3.0 and 3.5 for this.
USAGE vimsh -n -e "hostsvc/vmotion/vnic_set "
EXAMPLE vimsh -n -e "hostsvc/vmotion/vnic_set vmk0"

would be to first extract information from which vmkernel-nic the VMotion is configured on with

esxcfg-vmknic -l | awk '/VMotion/{print $1}'

0 Kudos
Engelsman
Enthusiast
Enthusiast
Jump to solution

Although it's an old thread. This is what I am using

-


#enable VMotion for ESX 3.0.x

VMPG=$(esxcfg-vswitch -l | grep VMotion | awk '{print $2}')

vimsh -n -e "/hostsvc/vmotion/vnic_set $"

-


#enable VMotion for ESX 3.5.x

VMK=$(esxcfg-vmknic -l |grep VMotion |awk '{print $1}')

vimsh -n -e "/hostsvc/vmotion/vnic_set $VMK"

-


0 Kudos
Courtney
Enthusiast
Enthusiast
Jump to solution

Correction for VMware 3.5 and a link to their document stating as such:

Link to VM KB article: vmware_vmkernel nic config

Summary of cmd needed:

{font:Arial}{size:10pt}{font:Courier New}vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0 {font}{size}{font}

Don't forget to set your default routes too as this ended up biting me!!

esxcfg-route -a default <ip_address>

Then you can validate it all by using:

vmkping -D

0 Kudos