12 Replies Latest reply on Apr 26, 2011 5:54 AM by JDLangdon

    Scripted installation NIC issue.

    netf Novice

       

      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

       

       

        • 1. Re: Scripted installation NIC issue.
          lamw Guru
          Community WarriorsVMware Employees

          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.html#1_14_10_15_4_9_1

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

           

           

           

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

          William Lam

          VMware vExpert 2009

          VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

          vGhetto Script Repository

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

          http://twitter.com/lamw

           

          http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg

           

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

          • 2. Re: Scripted installation NIC issue.
            netf Novice

            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

            • 3. Re: Scripted installation NIC issue.
              netf Novice

               

              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

               

               

              • 4. Re: Scripted installation NIC issue.
                Novice

                Hi netf,

                 

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

                 

                Thanks

                • 5. Re: Scripted installation NIC issue.
                  netf Novice

                   

                  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

                   

                   

                  • 6. Re: Scripted installation NIC issue.
                    yaojian Lurker

                    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 http://192.168.1.1/4.0/  

                     

                     

                     

                    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

                    • 7. Re: Scripted installation NIC issue.
                      netf Novice

                       

                       

                       

                       

                      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

                       

                       

                      • 8. Re: Scripted installation NIC issue.
                        netf Novice

                         

                        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

                         

                         

                        • 9. Re: Scripted installation NIC issue.
                          Galed Lurker

                           

                          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.

                           

                           

                          • 10. Re: Scripted installation NIC issue.
                            tdubb123 Master

                            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

                            • 11. NO COS NICS Error removed
                              vinayak111 Novice

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

                              • 12. Re: NO COS NICS Error removed
                                JDLangdon Master

                                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?