9 Replies Latest reply on Jul 19, 2011 9:33 AM by John Landells

    Provisioning ESXi4.0 : Kickstart file ignored in unattended ESXi4.0 installation

    Florian Lavoillotte

      I already set up pxe server to provision both linux and windows Operating systems and it works fine either for 32bits and 64 bits systems.
      The thing is I also have to provision ESXi4.0 servers and here comes the tricky part. It is stated in the user guide that it is impossible to make a provision job to use a ESXi4.0 boot image. The way indicated in this document is to assign a ESX boot image to the device to be provisioned. Using this method allows to pxe boot and execute ESX kernel. The installation sequence is still waiting for user inputs (accepting license, partitionning...). Besides, no kickstart file is created.
      I used a different approach.
      I boot with a gentoo x64 boot image and then swith to a esx installation. I managed to do so by creating a provision job using a gentoo x64 boot image and a ESX4 system package I created. I had of course to modify the command line boot field of the provision job.
      When provisioning new server, here's the sequence :
      1 - Gentoo booting
      2 - BMI execution on gentoo OS
           -> Generates the kickstart file and posting it on the pxestore root directory
           -> Switches boot
      3- ESX booting using the generated kickstart file.
      But then the kernel executes and waits for installation user inputs such as AcceptEula or partitioning

      What tells me that I'm heading the right way is the method I'm using leads to the generation of a kickstart file (first step to a unattended installation)

      The only thing is that I'm still stuck on answering installation questions
      It seems to me like the kickstart file is not accessible or just ignored even though I can access it without any problem using http.
      3 different file contents are indicated below :

           1) Gentoo pxelinux.cfg file
           2) Generated kickstart file
           3) ESX pxelinux.cfg file
      1) Gentoo pxelinux.cfg file
      # Perform a local boot by default 
      default inst 
      
      default64 linux64 
      
      # Always prompt
      prompt 1
      
      # Display the bootup message
      display pxeboot.msg
      
      # Boot automatically after 300 seconds
      timeout 1
      
      label local
      localboot 0
      # The rest of this file is machine-generated
      
      label linux64
      kernel RH5x64/gentoo
      append initrd=RH5x64/gentoord.gz root=/dev/ram0 init=/linuxrc loop=/image.squashfs looptype=squashfs cdroot=1 real_root=blroot vga=769
      label inst
      kernel RH5x64/gentoo
      append initrd=RH5x64/gentoord.gz root=/dev/ram0 init=/linuxrc loop=/image.squashfs looptype=squashfs cdroot=1 real_root=blroot vga=769
      
      2) Generated kickstart file
      accepteula
      keyboard fr-latin1
      serialnum --esx=012C1-AEJD4-58L39-089HH-1DP2H
      network --bootproto=dhcp --device=00:0C:29:87:FC:BE
      bootloader --location=mbr
      clearpart --alldrives --overwritevmfs
      part Storage1 --fstype=vmfs3 --size=7000 --ondisk=Storage1
      part /boot --fstype=ext3 --size=2000 --ondisk=/boot
      part None --fstype=vmkcore --size=1000 --ondisk=vmkcore
      part / --fstype=ext3 --size=7000 --onvirtualdisk=/
      part swap --fstype=swap --size=2000 --onvirtualdisk=swap
      firewall --allowIncoming --allowOutgoing
      timezone --utc Europe/Paris
      rootpw --iscrypted $1$FGFGFGFG$9eAqf87xEAVA6mq9Vjl/Q1
      install url http://10.142.22.221/pxestore/ESX/ESX4
      auth --useshadow --enablemd5
      reboot
      %packages
      %post
      cp /etc/rc.d/rc.local /etc/rc.d/rc.local.bak
      echo "chmod +x /root/provscript" >> /etc/rc.d/rc.local
      echo "/root/provscript" >> /etc/rc.d/rc.local
      touch /root/provscript
      echo "/etc/init.d/iptables stop " >> /root/provscript
      echo "cd /root;lwp-download http://10.142.22.221/pxestore/ESX/RHAS3SUSE9/rscd.sh >> http.log " >> /root/provscript
      echo "cd /tmp;lwp-download http://10.142.22.221/pxestore/ESX/RHAS3SUSE9/nsh-install-defaults nsh-install-defaults >> http.log " >> /root/provscript
      echo "sh /root/rscd.sh -silent " >> /root/provscript
      echo "echo BLAdmins:BLAdmin rw,map=root > /usr/lib/rsc/users " >> /root/provscript
      echo "/etc/init.d/iptables start " >> /root/provscript
      echo "cd /root;lwp-download http://10.142.22.221/pxestore/bmilinux.tar bmilinux.tar >> http.log " >> /root/provscript
      echo "cd /root" >> /root/provscript
      echo "tar -xvf bmilinux.tar">> /root/provscript
      echo "chmod +x bmilinux">> /root/provscript
      echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root">> /root/provscript
      echo "cd /root;./bmilinux 10.170.218.23 9831 00-0C-29-87-FC-BE" >> /root/provscript
      echo "rm -f /root/bmilinux" >> /root/provscript
      echo "rm -f /root/bmilinux.tar" >> /root/provscript
      echo "rm -f /root/libblssl.so.0.9.8" >> /root/provscript
      echo "rm -f /root/libblcrypto.so.0.9.8" >> /root/provscript
      echo "rm -f /root/random.byt" >> /root/provscript
      echo "mv /etc/rc.d/rc.local /etc/rc.d/rc.local.tmp" >> /root/provscript
      echo "mv /etc/rc.d/rc.local.bak /etc/rc.d/rc.local" >> /root/provscript
      echo "rm -f /etc/rc.d/rc.local.tmp" >> /root/provscript
      3) ESX pxelinux.cfg file
      # Perform a local boot by default 
      default inst 
      
      default64 linux64 
      
      # Always prompt
      prompt 1
      
      # Display the bootup message
      display pxeboot.msg
      
      # Boot automatically after 300 seconds
      timeout 1
      
      label local
      localboot 0
      # The rest of this file is machine-generated
      
      label linux64
      kernel ESX4/mboot.c32
      append initrd=ESX4/vmkboot.gz lang=en_US devfs=nomount ramdisk_size=16384 ESX4/vmkboot.gz --- ESX4/vmkernel.gz --- ESX4/sys.vgz --- ESX4/cim.vgz --- ESX4/ienviron.tgz --- ESX4/image.tgz --- ESX4/install.tgz quiet network ipappend 2 ks=http://x.x.x.x/pxestore/00-0C-29-E7-54-E9 ksdevice=00:0C:29:3E:4C:EF mem=512M
      label inst
      kernel ESX4/mboot.c32
      append initrd=ESX4/vmkboot.gz lang=en_US devfs=nomount ramdisk_size=16384 ESX4/vmkboot.gz --- ESX4/vmkernel.gz --- ESX4/sys.vgz --- ESX4/cim.vgz --- ESX4/ienviron.tgz --- ESX4/image.tgz --- ESX4/install.tgz quiet network ipappend 2 ks=http://x.x.x.x/pxestore/00-0C-29-E7-54-E9 ksdevice=00:0C:29:3E:4C:EF mem=512M