13 Replies Latest reply on Apr 25, 2012 12:09 PM by SuperSpike

    ESXi 4.1 scripted install

    esstokes1 Enthusiast


      In my kickstart file I have the following two firstboot statements:



      %firstboot --unsupported --interpreter=busybox --level=998


      #Add pNIC vmnic1,vmnic2 and remove vmnic0 to vSwitch0

      /usr/sbin/esxcfg-vswitch -L vmnic1 vSwitch0

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

      /usr/sbin/esxcfg-vswitch -U vmnic0 vSwitch0




      1. set multipath policy to round-robin for EMC arrays

      /usr/sbin/esxcli nmp satp setdefaultpsp -s VMW_SATP_SYMM -P VMW_PSP_RR

      /usr/sbin/esxcli nmp satp setdefaultpsp -s VMW_SATP_CX -P VMW_PSP_RR


      echo "Configuring NTP"

      echo "restrict default kod nomodify notrap noquerynopeer" > /etc/ntp.conf

      echo "restrict" >> /etc/ntp.conf

      echo "server xxx.xxx.xxx.xxx" >> /etc/ntp.conf

      echo "driftfile /var/lib/ntp/drift" >> /etc/ntp.conf

      /sbin/chkconfig --level 345 ntpd on

      /etc/init.d/ntpd start



      mkdir -p /var/updates ; cd /var/updates

      wget http://xxx.xxx.xxx.xxx/os/esxi-4.1/updates/EMU-lpfc820-

      wget http://xxx.xxx.xxx.xxx/esxi-4.1/updates/SVE-be2net-2.102.404.0-offline_bundle-281453.zip


      /usr/bin/vim-cmd /hostsvc/maintenance_mode_enter

      sleep 10

      cd /var/updates

      for zipfile in `ls *.zip` ; do

        /usr/sbin/esxupdate --bundle=/var/updates/$ update


      /usr/bin/vim-cmd /hostsvc/maintenance_mode_exit

      sleep 10


      /usr/sbin/esxcfg-advcfg -s 64 /Disk/SchedNumReqOutstanding

      /usr/sbin/esxcfg-advcfg -s 1 /Disk/UseLunReset

      /usr/sbin/esxcfg-advcfg -s 0 /Disk/UseDeviceReset


      1. Set NFS advanced Configuration Settings

      /usr/sbin/esxcfg-advcfg -s 30 /Net/TcpipHeapSize

      /usr/sbin/esxcfg-advcfg -s 120 /Net/TcpipHeapMax

      /usr/sbin/esxcfg-advcfg -s 10 /NFS/HeartbeatMaxFailures

      /usr/sbin/esxcfg-advcfg -s 12 /NFS/HeartbeatFrequency

      /usr/sbin/esxcfg-advcfg -s 5 /NFS/HeartbeatTimeout

      /usr/sbin/esxcfg-advcfg -s 64 /NFS/MaxVolumes



      %firstboot --unsupported --interpreter=busybox --level=9999




      I can see the server run the 998.firstboot_001 script from the console and the server also runs the 9999.firstboot_002 script which performs a reboot.  The problem is these scripts are never moved out of /etc/vmware/init/init.d/ so they are being executed on every reboot which means the server is constantly rebooting.  Has anyone else seen this?  Is there a better way to reboot the server (the reboot is required for the esxupdate).