netf
Contributor
Contributor

Scripted installation NIC issue.

Hi guys,

I am having problems with a ESX 4 scripted installation ( manual text / gui install works just fine).

I use following pxeboot file

- SNIP -

default menu.c32

menu ESX Boot Menu

timeout 30

label scripted

menu label Scripted Installation

kernel vmlinuz-install-vmware4

append ksdevice=vmnic0 initrd=initrd-install-vmware4.img vmkopts=debugLogToSerial:1 mem=512M ks=http://XXX.XX.XX.X/ks/ks.cfg quiet

- SNIP -

After kernel and initrd image is loaded I get following error message:

" No COS NICs have been added by the user"

Any help?

Thanks,

Piotr

0 Kudos
12 Replies
lamw
Community Manager
Community Manager

Try adding IPAPPEND 2 at the end of your statement if you have more than one NIC on your host, it might try to boot off the other which may or may not be configured.

Take a look here for more information:

http://pubs.vmware.com/vsp40/wwhelp/wwhimpl/js/html/wwhelp.htm#href=install/c_about_pxe_config_files...

http://pubs.vmware.com/vsp40/wwhelp/wwhimpl/js/html/wwhelp.htm#href=install/c_scripted_installation_...

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
netf
Contributor
Contributor

Hi

Thanks for your feedback ... however result is exactly the same "No COS NICs...".

Please find updated pxeboot file:

default menu.c32

menu ESX Boot Menu

timeout 30

label scripted

menu label Scripted Installation

kernel vmlinuz-install-vmware4

append initrd=initrd-install-vmware4.img vmkopts=debugLogToSerial:1 mem=512M ks=http://XXX.XX.XX.X/ks/$.cfg quiet

ipappend 2

--

Any other things I might try? If you need a more details please let me know.

Thanks,

Piotr

0 Kudos
netf
Contributor
Contributor

Hi,

Ok, anserwing my own question. The problem is with VMware using its own MACs for the VMNICs.

So ESX host was PXE booting on a MAC that it supposed to but later on it tried to fetch the IP address configuration on a comlpetly different virtual MAC.

The question is ... is tehre a way that we can force ESX 4.0 to use real MAC addresses instead of its own? ... otherwise I find quite difficult to automate the whole process

Thanks,

Piotr

0 Kudos
admin
Immortal
Immortal

Hi netf,

Does the installation get stuck here. Or does it proceed.

Thanks

0 Kudos
netf
Contributor
Contributor

Hi ann_86

Installation get stuck there as it can't fetch VMware ESX files. They are located on remote http server so proper IP configuration is a must.

Interesting thing is that every single boot ESX advertises itself with different virtual MAC

Thanks,

Piotr

0 Kudos
yaojian
Contributor
Contributor

Hi, I encounter the same issue with script to install esx4.0, but I ignore the error and add follwing command to the ks.conf.

**************************************************************************************************************************************************************

vim ks.conf

accepteula

keyboard us

auth --enablemd5 --enableshadow

install url

reboot

rootpw --iscrypted $1$x/DuHjcR$m0It0maJ6M9nW

timezone Asia/Shanghai

network --addvmportgroup=true --device=vmnic0 --bootproto=dhcp

#Partitioning Information

clearpart --all --initlabel --firstdisk --overwritevmfs

part '/boot' --fstype=ext3 --size=1100 --onfirstdisk

part 'none' --fstype=vmkcore --size=110 --onfirstdisk

part 'Storage1' --fstype=vmfs3 --size=8604 --grow --onfirstdisk

virtualdisk 'esxconsole' --size=7604 --onvmfs='Storage1'

part 'swap' --fstype=swap --size=600 --onvirtualdisk='esxconsole'

part '/var/log' --fstype=ext3 --size=2000 --onvirtualdisk='esxconsole'

part '/' --fstype=ext3 --size=5000 --grow --onvirtualdisk='esxconsole'

***

%post --interpreter=bash

echo "### Configuring ESX Firewall to allow all ports incoming and outgoing traffic" >> /root/ri.log

esxcfg-firewall --AllowIncoming >> /root/ri.log

esxcfg-firewall --AllowOutgoing >> /root/ri.log

echo "" >> /root/ri.log

echo "### Configuring sshd to allow root login - see /etc/ssh/sshd_config" >> /root/ri.log

sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config

cat /etc/ssh/sshd_config |grep PermitRootLogin >> /root/ri.log

echo "" >> /root/ri.log

echo "Changing MAC of vswif0 to match that of installation nic" >> /root/ri.log ########## change MAC########

%post --nochroot

cp /mnt/sysimage/bin/awk /sbin

sed -i '/^MACADDR/d' /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-vswif0

echo "MACADDR=`ifconfig vmnic0 |grep HWaddr |awk '{print $5}'`" >> /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-vswif0

cat /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-vswif0 |grep MACADDR >> /mnt/sysimage/root/ri.log

#ntp settings

excfg-firewall --disable

chkconfig ntpd on

cat > /etc/ntp.conf <<EOF

restrict default kod nomodify notrap nopeer noquery

restrict -6 default kod nomodify notrap nopeer noquery

server ******

In /tftp/pxelinux/vm file

label 10

MENU LABEL ^10) VMWare 4.0 Remote Install

kernel /pxelinux/vm/vm40/vmlinuz

append initrd=/pxelinux/vm/vm40/initrd.img vmkopts=debugLogToSerial:1 mem=512M ksdevice=vmnic0 ks=nfs:192.168.1.1:/install/vmware/4.0/kickstart/ks.cfg quiet

0 Kudos
netf
Contributor
Contributor

Hi

Found out where the problem is. Basically during an install for some reason IP is being assigned to the vswif0 interface.

That's why I can see virtual MAC being advertised in a DHCP log files and etc.

When I set my PXE conf file like that :

-- SNIP --

default menu.c32

menu ESX Boot Menu

timeout 30

label scripted

menu label Scripted Installation

kernel vmlinuz-install-vmware4

append initrd=initrd-install-vmware4.img ksdevice=vmnic0 ip=172.16.12.132 netmask=255.255.255.0 gateway=172.16.12.1 nameserver=172.16.11.250 vmkopts=debugLogToSerial:1 mem=512M ks=http://172.16.10.2/ks/$.cfg

-- SNIP --

Installation proceeds and finishes fine.

Of course this is not a solution to this problem so the question is ... as I understand this correctly installation should happen on physical interface? Any ideas why it keeps trying to perform it on a vswif0 interface?

Thanks,

Piotr

0 Kudos
netf
Contributor
Contributor

OK guys,

The solution is to add IPAPPEND 1 to the pxe boot file.

Now it works fine for me ... I hope it might help someone as well.

Thanks,

Piot

0 Kudos
Galed
Contributor
Contributor

Thank you so much for posting this!

I was having the same problem and couldn't figure out how to automate the whole installation.

your solution saved me from making an ugly patch.

0 Kudos
tdubb123
Expert
Expert

I still see VMware using its own mac address requesting for dhcp address. why is that? Why can it use the physical vmnic0 address?? my dhcp can only take static mac address ip reservation. how do I have kickstart esx4 use the vmnic0 physical mac for ip request? I added the IPAPPEND=1 but no luck

0 Kudos
vinayak111
Contributor
Contributor

No Cos nics problem is resolved by using Build 14 from http://www.rtfm-ed.co.uk/vmware-content/ultimate-da/

0 Kudos
JDLangdon
Expert
Expert

vinayak111 wrote:

No Cos nics problem is resolved by using  Build 14 from http://www.rtfm-ed.co.uk/vmware-content/ultimate-da/

While it may have been resolved in Build 14, this error is re-apearing in Build 17.

Has anyone found a solution?

0 Kudos