Hi,
I want to create the Vmotion setup, vswitch, assigning Ipaddress, nic card from the commandline( esxcfg-cmds)
can this be done ?
Thanks
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
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
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
thanks for the helpful