VMware Cloud Community
burvil
Enthusiast
Enthusiast
Jump to solution

Scripted installation not taking parameters?

UPDATED after fixing problem --

I have a kickstart installation that works fine for our RHEL kickstart installations, and I'm trying to get fully working for ESXi installs.  I have a working DHCP and TFTP service that works properly, and the images are served out via HTTP.  I have PXE boot menu where I choose what configuration and OS I want, where for ESXi 6.0, I have:

LABEL ESXi 6.0 (VSAN - VMware ISO)

                       KERNEL /vsan/6.0_vmw/mboot.c32

                       APPEND -c /vsan/6.0_vmw/boot.cfg

MENU LABEL ESXi 6 install (VSAN)

where VMware-Esxi-6.0.0.iso is the ISO I downloaded from the Dell site, that has the Dell storage drivers.  The esxi_default.cfg is as follows:

# Accept the VMware End User License Agreement

vmaccepteula

# Set the root password for the DCUI and Tech Support Mode

rootpw password-is-here

# Choose the first discovered disk to install onto

clearpart --alldrives --overwritevmfs

# The installation media is in the CD-ROM drive

install --firstdisk=usb --overwritevmfs

# Changes (i.e. prompting user) will occur after modules loaded, but before installation starts.

%pre --interpreter=busybox

#Redirects the output to /dev/ttyl and changes to tty1 virtual console.

exec < /dev/tty1 > /dev/tty1 2>&1

chvt 1

I put this together based on the Vsphere install doc at http://pubs.vmware.com/vsphere-60/index.jsp#com.vmware.vsphere.install.doc/GUID-870A07BC-F8B4-47AF-9....  Note that I put firstdisk=usb because I want to install on the SD card.

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

ISSUE #1:

I have tried kickstarting (i.e. rebooting the server, so there's no caching) changing the line in the PXE menu mentioned earlier:

1. append iso initrd=VMware-Esxi-6.0.0.iso raw ks=http://10.26.113.10/ks/vmware/esxi_default.cfg

2. append initrd=VMware-Esxi-6.0.0.iso raw ks=http://10.26.113.10/ks/vmware/esxi_default.cfg

3. append iso initrd=VMware-Esxi-6.0.0.iso raw

4. ks=http://10.26.113.10/ks/vmware/esxi_default.cfg

Of these,

#4 doesn't work (got an error that I didn't supply a disk image)

#1, 2, 3 all seem to result in the same thing, i.e. I get "Welcome to the VMware ESXi 6.0.0 Installation" screen, and get prompted to accept the EULA, etc., i.e. that the parameters above aren't working, and are getting ignored. Any thoughts as to why?

----------------------

UPDATE: Per my update above, this wasn't needed.  However, I did need to specify the following in the boot.cfg for the ESXi files.  Specifically, I had to copy the ESXi files from the ISO, then modify boot.cfg to:  a) modify the path of the files, since I have a vsan directory, b) append the ks= parameter:

kernel=/vsan/6.0_vmw/tboot.b00

kernelopt=runweasel ks=http://10.26.113.10/ks/vmware/esxi_default.cfg

build=

modules=/vsan/6.0_vmw/b.b00 --- /vsan/6.0_vmw/jumpstrt.gz --- /vsan/6.0_vmw/useropts.gz --- /vsan/6.0_vmw/k.b00 --- /vsan/6.0_vmw/chardevs.b00 --- /vsan/6.0_vmw/a.b00 --- <snip>

This is part of PXE chaining required, since ESXi requires a different version of pxelinux; I had to install a separate instance of pxelinux, and have a menu choice in my original pxelinux install to redirect to the new pxelinux instance.

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

ISSUE #2:

I'd like to use a script I have now that, as part of the %post installation for RHEL installs, the kickstart process will query a URL, which will cause the user to be prompted for a hostname, and the script at the URL returns the netmask, gateway, etc., and fills in the appropriate values to configure the network on the new server.  I'd like to do the same for ESXi.

- Is that possible with either the busybox of python shell?  I think they're pretty barebones install; not sure if it has full functionality.

- Would this be possible in the %post section of the .cfg file, or would I have to put it in %firstboot section?

-----------------

UPDATE:  I got this to work per http://www.virtuallyghetto.com/2015/10/how-to-prompt-for-user-input-during-an-interactive-or-script...

0 Kudos
1 Solution

Accepted Solutions
burvil
Enthusiast
Enthusiast
Jump to solution

See my updated description for this post.  ESXi requires an older version of pxelinux, I think probably because they forked off of the Redhat, i.e. in ESXi 4, it was a lot more compatible with Linux, and I think was based on RHEL.  Not anymore.

I got around this by having a menu choice in my non-ESXi PXE install point to the directory for the ESXi install, i.e.

LABEL Vmware installs and upgrade

                       MENU LABEL ^VMware ESXi

                       COM32 pxechn.c32

                       APPEND /vmware/pxelinux.0 -p /vmware/

                       TEXT HELP

All vmware install/upgrade

                       ENDTEXT

I wouldn't know about compiling against the new code base.  I looked into that, and it seems I'd run into too many dependencies to be worth my time.

View solution in original post

7 Replies
burvil
Enthusiast
Enthusiast
Jump to solution

After talking to VMware support, I realized that I had to update the esxcli_default.cfg, which now looks like:

# Accept the VMware End User License Agreement

vmaccepteula

# Set the root password for the DCUI and Tech Support Mode

rootpw password

# Choose the first discovered disk to install onto

# The installation media is in the CD-ROM drive

installorupgrade --firstdisk=usb --overwritevmfs

# Set the network to DHCP on teh first network adapater

network --bootproto=dhcp --device=vmnic0

paranoid

# A sample post-install script

%post --interpreter=python --ignorefailure=true

import time

stampFile = file('/finished.stamp', mode='w'

stampFile.write( time.asctime() )

#reboot when done

reboot

I tried doing another install, and after hitting shift+o at boot and specifying the location of ks.cfg file, it went through then install, but I got an error message "User-supplied %post script failed. (Error code 256)", and there was no /finished.stamp file after it booted up.  I also checked in /var/log/esxi_install.log, and didn't find any error after the parsing of the arguments that showed any sort of error.  Any thoughts on why that failed?

So, while I was able to get further on this, I still had to interrupt with shift+o; it wasn't very automated.  In looking at the VMware documentation, I need to use the mboot.c32 from the installation ISO, but when I try to install after that change, I get an error ""failed to load com32 file mboot.c32".  I am using syslinux 6.0.3.  Any thoughts on why I'm getting this?

Also, any thoughts on issue #2?

0 Kudos
burvil
Enthusiast
Enthusiast
Jump to solution

I understand this may be due to our using syslinux 6.0.3 (latest version), and the com boot files there changed between versions 3 and 5.  Since we upgraded to the latest version to fix bugs, we can't go back to 3.08.  We may need to do gPXE chaining, which I’m looking into. 


1. Does anybody know if ESXi 6.0 is based on syslinux 3.08? 

2. What are your current scripted install (kickstart) servers running for the version of syslinux?

0 Kudos
burvil
Enthusiast
Enthusiast
Jump to solution

Making some progress...  I am trying to replicate what’s in the Vsphere documentation center, at http://pubs.vmware.com/vsphere-60/topic/com.vmware.ICbase/PDF/vsphere-esxi-vcenter-server-60-install....   Currently, I am further than I was before, where I have installed syslinux 3.86, since ESXi is compiled with 3.86.  I have put in the following, as it’s what in page 50 of the link above:

DEFAULT menu.c32

MENU TITLE ESXi 6 Boot Menu - per Vsphere 6 documentation center

NOHALT 1

PROMPT 0

TIMEOUT 10

LABEL install

                       KERNEL mboot.c32

                       APPEND -c boot.cfg

MENU LABEL ESXi 6 ^Installer

LABEL hddboot

   LOCALBOOT 0x80

   MENU LABEL ^Boot from local disk

And the system will try to boot, and say:

Loading -c... failed!

No files found!

boot:

However, I have the boot.cfg in the locations I could think could be right:

[root@cm-di-msdc02 pxelinux.cfg]# pwd

/var/lib/tftpboot/pxelinux.cfg

[root@cm-di-msdc02 pxelinux.cfg]# diff ../boot.cfg boot.cfg

[root@cm-di-msdc02 pxelinux.cfg]# ls -l ../boot.cfg boot.cfg

-r-xr-xr-x 1 root root 1819 Aug 13 21:22 ../boot.cfg

-r-xr-xr-x 1 root root 1819 Aug 13 21:22 boot.cfg

Is there a way to test at the boot: prompt?   How can I get past this error?

0 Kudos
TimMann
VMware Employee
VMware Employee
Jump to solution

It looks like you are inadvertently using the mboot.c32 plugin that comes with syslinux/pxelinux. That's the wrong plugin; you need the mboot.c32 that comes with ESXi. Get it from the latest version of ESXi that you're trying to boot -- newer versions of mboot are backward compatible with older versions of ESXi. You will find our mboot.c32 in the root directory of the ESXi install CD.

The reason our documentation says to use syslinux 3.86 is that ESXi's mboot.c32 plugin is built against the syslinux v3/v4 plugin API and specifically tested against 3.86. The newer plugin API from syslinux v5 or v6 is incompatible with plugins built against the older API.

I am trying to get someone to work on porting our mboot to the newer syslinux API to make it easier for customers like you who are PXE booting multiple different OSes and want to use the latest syslinux. But no promises when/if that will happen.

Could you please comment in this thread if you have success with the correct mboot.c32?

0 Kudos
rspoto
Contributor
Contributor
Jump to solution

I know this post is quite old, but this is exactly the frustration I'm having at the moment.  My entire PXE environment is based on 6.04 (booting w/ lpxelinux) to support a wide variety of needs.  Being unable to use the mboot.c32 from 3.8.6 against it is frustrting.

Has any progress been made on an mboot.c32 file compiled against the newer code base?

Thanks!

0 Kudos
burvil
Enthusiast
Enthusiast
Jump to solution

See my updated description for this post.  ESXi requires an older version of pxelinux, I think probably because they forked off of the Redhat, i.e. in ESXi 4, it was a lot more compatible with Linux, and I think was based on RHEL.  Not anymore.

I got around this by having a menu choice in my non-ESXi PXE install point to the directory for the ESXi install, i.e.

LABEL Vmware installs and upgrade

                       MENU LABEL ^VMware ESXi

                       COM32 pxechn.c32

                       APPEND /vmware/pxelinux.0 -p /vmware/

                       TEXT HELP

All vmware install/upgrade

                       ENDTEXT

I wouldn't know about compiling against the new code base.  I looked into that, and it seems I'd run into too many dependencies to be worth my time.

freeandopensour
Contributor
Contributor
Jump to solution

This thread helped me more than all of the documentation, errors, and blog posts I have read.

Using pxechn.c32, you can link to a separate set of syslinux 3.86 files to deploy multiple versions or kickstarts of ESXi from syslinux 6.03.  This saved me from creating a separate server with 3.86.

0 Kudos