VMware Cloud Community
Fogel
Contributor
Contributor

ESX35 - Can't set nic teaming policy in kickstart script

Hey everyone,

I've been trying the last few days to get a working kickstart script and it's going pretty nicely so far. The only thing I can't seem to get working is the vswitch nic teaming policy. The command is pretty straightforward but I can't get it to work in the kickstart script. If I execute it on root access, no problems, it's working just fine.

Here's my kickstart script :

url --url ftp://XX.XX.XX.246/VMware/ESX35/Source

rootpw --iscrypted $1$gsieWgya$xHLRVepxQxt5eFnFNkvha0

bootloader --location=mbr

timezone America/Montreal

skipx

install

text

network --bootproto static --ip XX.XX.XX.209 --netmask 255.255.255.0 --gateway XX.XX.XX.1 --nameserver XX.XX.XX.158 --hostname XXXX.XXX --addvmportgroup=0 --vlanid=0

lang en_US

langsupport --default en_US

keyboard us

mouse none

reboot

firewall --disabled

#Xtravirt Default Partitioning

#Hp hardware set as default. Replace cciss with cciss for other server types

clearpart --all --initlabel --drives=cciss/c0d0

part /boot --fstype ext3 --size 250 --ondisk cciss/c0d0 --asprimary

part / --fstype ext3 --size 5000 --ondisk cciss/c0d0 --asprimary

part swap --size 1000 --ondisk cciss/c0d0 --asprimary

part None --fstype vmkcore --size 100 --ondisk cciss/c0d0

part /var/log --fstype ext3 --size 2000 --ondisk cciss/c0d0

part /tmp --fstype ext3 --size 1000 --ondisk cciss/c0d0

vmaccepteula

vmlicense --mode=server --server=27000@XXXX.XXX --edition=esxFull --features=backup

%packages

@base

%post

cat > /tmp/esxcfg.sh <<EOF1
#!/bin/sh

vmware-vim-cmd hostsvc/net/vswitch_setpolicy --nicteaming-policy loadbalance_ip vSwitch0
EOF1

#Make esxcfg.sh eXcutable
chmod +x /tmp/esxcfg.sh

#Backup original rc.local file
cp /etc/rc.d/rc.local /etc/rc.d/rc.local.bak

#Make esxcfg.sh run from rc.local and make rc.local reset itself
cat >> /etc/rc.d/rc.local <<EOF

cd /tmp

/tmp/esxcfg.sh

mv -f /etc/rc.d/rc.local.bak /etc/rc.d/rc.local

EOF

Can someone point me in the right direction?

Thanks in advance

Mario

0 Kudos
4 Replies
kjb007
Immortal
Immortal

Have you verified that the script is running after the server is back up? Is there a /tmp/esxcfg.sh file? Does /etc/rc.d/rc.local have the original information in it, or does it have the script name inside?

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
0 Kudos
Fogel
Contributor
Contributor

Hey KjB,

How can I check if the script is still running?

The file /tmp/esxcfg.sh exists. I can run the script and the nic teaming policy is applied successfully. The /etc/rc.d/rc.local file has been reset as the script would have it do.

I usually have a lot more options on that kickstart script, SSH root access, vSwitch/portgroups scripts and everything is done after the nic teaming part. Everything else is applied correctly. Only the nic teaming doesn't work.

Thanks!

0 Kudos
hharold
Enthusiast
Enthusiast

I having the same issue. During scripted install we wnat to use vmware-vim-cmd to create active / passive nics:

# Wait 2 minutes for the hostd-daemon to startup

+ sleep 2m+

+ # Refresh Network settings+

+ /usr/bin/vmware-vim-cmd hostsvc/net/refresh+

+ /usr/bin/vmware-vim-cmd internalsvc/refresh_network+

+ # Configure default NIC Priority Order for vSwitch0+

+ /usr/bin/vmware-vim-cmd hostsvc/net/vswitch_setpolicy --nicorderpolicy-active=vmnic0 --nicorderpolicy-standby=vmnic3 vSwitch0+

This does not work, after redirecting the output to a log-file, we discovered that vmware-vim-cmd gives an error message:

  • Failed to connect: Crypo Exception: error:02001002:system library:fopen:No such file or directory:unable to load /etc/vmware/ssl/rui.key*

This file is not present during installation, but afterwards it is.

Fooling the system, by placing an empty file did not solve it.

Anyone any ideas?

0 Kudos
pto
Contributor
Contributor

Was a solution ever found for this? I'm running into the same error on a ESX 4.0 scripted install when trying to put the host in maintenance mode as part of the post installation script.

Failed to connect: Crypo Exception: error:02001002:system library:fopen:No such file or directory:unable to load /etc/vmware/ssl/rui.key*

0 Kudos