VMware Cloud Community
vcpguy
Expert
Expert
Jump to solution

create vmotion via cmd line

Hi,

I want to create the Vmotion setup, vswitch, assigning Ipaddress, nic card from the commandline( esxcfg-cmds)

can this be done ?

Thanks

----------------------------------------------------------------------------- Please don't forget to reward Points for helpful hints; answers; suggestions. My blog: http://vmwaredevotee.com
0 Kudos
1 Solution

Accepted Solutions
glynnd1
Expert
Expert
Jump to solution

For 3.5 it is something like this:

echo "Configuring vSwitch0 for two NICs supporting Service Console & VMotion in an active/standby & standby/active"

echo "Adding second NIC to vSwitch0"

esxcfg-vswitch -U vmnic0 vSwitch0

vmware-vim-cmd internalsvc/refresh_network

esxcfg-vswitch -L vmnic0 vSwitch0

esxcfg-vswitch -L vmnic2 vSwitch0

echo "Creating VMotion portgroup"

esxcfg-vswitch --add-pg VMotion vSwitch0

esxcfg-vswitch --vlan 473 --pg VMotion vSwitch0

echo "Configuring VMotion IP setting"

esxcfg-vmknic --add VMotion --ip 10.142.173.1XXXX --netmask 255.255.255.0

echo "Enabling VMotion"

vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0

vmware-vim-cmd internalsvc/refresh_network

echo "Setting Service Console portgroup to active/standby"

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-active vmnic0 vSwitch0 "Service Console"

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-standby vmnic2 vSwitch0 "Service Console"

echo "Setting VMotion portgroup standby/active"

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-active vmnic2 vSwitch0 VMotion

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-standby vmnic0 vSwitch0 VMotion

vmware-vim-cmd internalsvc/refresh_network

View solution in original post

0 Kudos
4 Replies
glynnd1
Expert
Expert
Jump to solution

For 3.5 it is something like this:

echo "Configuring vSwitch0 for two NICs supporting Service Console & VMotion in an active/standby & standby/active"

echo "Adding second NIC to vSwitch0"

esxcfg-vswitch -U vmnic0 vSwitch0

vmware-vim-cmd internalsvc/refresh_network

esxcfg-vswitch -L vmnic0 vSwitch0

esxcfg-vswitch -L vmnic2 vSwitch0

echo "Creating VMotion portgroup"

esxcfg-vswitch --add-pg VMotion vSwitch0

esxcfg-vswitch --vlan 473 --pg VMotion vSwitch0

echo "Configuring VMotion IP setting"

esxcfg-vmknic --add VMotion --ip 10.142.173.1XXXX --netmask 255.255.255.0

echo "Enabling VMotion"

vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0

vmware-vim-cmd internalsvc/refresh_network

echo "Setting Service Console portgroup to active/standby"

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-active vmnic0 vSwitch0 "Service Console"

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-standby vmnic2 vSwitch0 "Service Console"

echo "Setting VMotion portgroup standby/active"

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-active vmnic2 vSwitch0 VMotion

vmware-vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-standby vmnic0 vSwitch0 VMotion

vmware-vim-cmd internalsvc/refresh_network

0 Kudos
khughes
Virtuoso
Virtuoso
Jump to solution

You might also want to bookmark this page for future reference. Its a handy little page when you need to build out things manually from the console.

  • Kyle

-- Kyle "RParker wrote: I guess I was wrong, everything CAN be virtualized "
petedr
Virtuoso
Virtuoso
Jump to solution

If you want to take a look other command line commands xtravirt has a good document on using the vimsh commands for ESX 3.5.

http://knowledge.xtravirt.com/white-papers/scripting.html

www.thevirtualheadline.com www.liquidwarelabs.com
petedr
Virtuoso
Virtuoso
Jump to solution

thanks for the helpful

www.thevirtualheadline.com www.liquidwarelabs.com
0 Kudos