VMware Cloud Community
Bhanta
Contributor
Contributor

vmware-vim-cmd command not working

Hi all,

i seem to be having an issue in enabling vmotion from my ks.cfg file when trying to do a scripted esx4 u1 build. As a result i was hoping that somebody could give me a few pointers in what i may be doing wrong and alernative things to try.

The commands which i am running in the "post" section of my ks.cfg file is as follows:

/usr/sbin/esxcfg-vswitch -a vSwitch_VLAN2

/usr/sbin/esxcfg-vswitch -A VMotion vSwitch_VLAN2

/usr/sbin/esxcfg-vswitch -L vmnic2 vSwitch_VLAN2

/usr/sbin/esxcfg-vswitch -L vmnic3 vSwitch_VLAN2

/usr/sbin/esxcfg-vmknic --add --ip=$vmotionipnew --netmask=255.255.255.0 VMotion

/usr/sbin/esxcfg-route -a default

service mgmt-vmware restart

sleep 60

/usr/bin/vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0

however when the builds completes vmotion isn't enabled. The ip address, subnet etc is assigned fine and I have confirmed that vmk0 is the correct one as i ran "esxcfg-vmknic -l" and also checked in vi client afterwoods. What is strange is that if i login via ssh after the build completes and run the "/usr/bin/vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0" command, then vmotion works fine and is enabled.

Not sure if it has anything to do with it but i noticed the following in /var/log/esx_install.log:

Failed to connect: Cannot connect to host localhost: Connection refused

Stopping sshd: ESC[60G[ESC[0;31mFAILEDESC0;39m

Generating SSH1 RSA host key: ESC[60G[ESC[0;32m OK ESC0;39m

Generating SSH2 RSA host key: ESC[60G[ESC[0;32m OK ESC0;39m

Generating SSH2 DSA host key: ESC[60G[ESC[0;32m OK ESC0;39m

Starting sshd: ESC[60G[ESC[0;32m OK ESC0;39m

I first thought that it may have something to do with firewall settings in my ks.cfg script but then wasn't sure as ssh sems to be open as i can connect to the box via ssh afterwoods.

The firewall command i run in the beging of my ks.cfg file is: firewall --allowOutgoing --allowIncoming

Hopefully somebody can shed some light on what the problem may be???

0 Kudos
2 Replies
Troy_Clavell
Immortal
Immortal

maybe the the below instead?

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

0 Kudos
Bhanta
Contributor
Contributor

Thanks troy...i tried that but it didnt work either.

0 Kudos