• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • Unexplored Territory Podcast
  • HA Deepdive
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

Enable VMotion from the command-line

Duncan Epping · Dec 8, 2008 ·

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.

Related

Server ESX, Scripting, vmotion

Reader Interactions

Comments

  1. mastrboy says

    8 December, 2008 at 09:30

    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.

Primary Sidebar

About the Author

Duncan Epping is a Chief Technologist and Distinguished Engineering Architect at Broadcom. Besides writing on Yellow-Bricks, Duncan is the co-author of the vSAN Deep Dive and the vSphere Clustering Deep Dive book series. Duncan is also the host of the Unexplored Territory Podcast.

Follow Us

  • X
  • Spotify
  • RSS Feed
  • LinkedIn

Recommended Book(s)

Advertisements




Copyright Yellow-Bricks.com © 2025 · Log in