ESXi

 View Only
  • 1.  Kickstart File Not Working

    Posted Nov 06, 2019 08:47 AM

    Hi. Can anybody explain what is wrong with this kickstart file?  6.7

    ESXi 6.7 U2 HPE Customized ( Nested ESXi)

    Section 2 Post Installation absolutely not working besides this one

    ### Set Search Domain

    esxcli network ip dns search add --domain=o365.az

    ### ESXi Installation Script

    ### Hostname: LAB-ESXi01A

    ### Author: M. Buijs

    ### Date: 2017-08-11

    ### Tested with: ESXi 6.0 and ESXi 6.5

    ##### Stage 01 - Pre installation:

        ### Accept the VMware End User License Agreement

        vmaccepteula

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

        rootpw VMware1!

        ### The install media (priority: local / remote / USB)

        install --firstdisk=local --overwritevmfs --novmfsondisk

        ### Set the network to DHCP on the first network adapter

        network --bootproto=static --device=vmnic0 --ip=172.18.18.235 --netmask=255.255.255.0 --gateway=172.18.18.254 --nameserver=192.168.126.21,192.168.151.254 --hostname=ESXv6.o365.az --addvmportgroup=0

        ### Reboot ESXi Host

        reboot --noeject

    ##### Stage 02 - Post installation:

        ### Open busybox and launch commands

        %firstboot --interpreter=busybox

       ### Set Search Domain

        esxcli network ip dns search add --domain=o365.az

        ### Add second NIC to vSwitch0

        esxcli network vswitch standard uplink add --uplink-name=vmnic1 --vswitch-name=vSwitch0

        ###  Disable IPv6 support (reboot is required)

        esxcli network ip set --ipv6-enabled=false

        ### Disable CEIP

        esxcli system settings advanced set -o /UserVars/HostClientCEIPOptIn -i 2

        ### Enable maintaince mode

        esxcli system maintenanceMode set -e true

        ### Reboot

        esxcli system shutdown reboot -d 15 -r "rebooting after ESXi host configuration"



  • 2.  RE: Kickstart File Not Working

    Posted Mar 13, 2020 08:53 AM

    Hi,

    I'm having the same issue.

    I have a relatively simple kickstart file that works always with 6.5

    and only "sometimes"  with 6.7.

    When it doesn't work, it hasn't executed anything at the %firstboot section.

    kickstart.log file is empty in either case (success or not)

    weird think is I have 2 types of install, with 10Gbit nics and with 1Gbit nics.  The 10Gbit nics version works nearly always and the 1Gbit nics version works nearly never.

    But in both cases it sometime works and sometimes doesn't.

    I already increased the sleep value but that doesn't change anything.



  • 3.  RE: Kickstart File Not Working

    Posted Feb 14, 2023 01:59 PM

    Anyone overcome this issue?

    It is happening on both 7.X and 8.X as well...

     

     



  • 4.  RE: Kickstart File Not Working

    Broadcom Employee
    Posted Feb 14, 2023 03:28 PM

    Not working is a pretty generic statement even from the original post ... 

     

    If you're going to use ESXCLI commands in %firstboot, YOU need to ensure hostd is actually ready before issuing commands. In all of my kickstart examples on my blog (williamlam.com), I always run the following first

    # Ensure hostd is ready
    while ! vim-cmd hostsvc/runtimeinfo; do
    sleep 10
    done

    If that has already been done, then you need to debug further and see which commands are failing and is it related to a timing issue or something else. Firstboot scripts are typically stored in /tmp IIRC, but this is all reference in install logs which is /var/log/esxi_install.sh, so you can check whether there's syntax issue/etc. I personally have ran into issues where it was simple typos, so best thing to do is to test in a Nested ESXi env (if that is possible) to validate your kickstart is fully functional before applying it to a physical system, it'll save you ton of head aches and much easier to debug



  • 5.  RE: Kickstart File Not Working

    Posted Feb 14, 2023 05:30 PM

    Hi,

    Thanks for replying!

    Basically the server is completely installed, and when I enable the ESXi Shell, it get stuck like this forever:

    roynaim_0-1676395467317.png

     

    I am using esxcli commands in my KS script:

    roynaim_1-1676395719818.png

    Do I need to change something?

    And I'm trying to test with a nested but having issue with that at the moment, so working with a physical server...

     

     



  • 6.  RE: Kickstart File Not Working

    Broadcom Employee
    Posted Feb 14, 2023 08:36 PM

    How are you enabling the ESXi Shell? I don't see that in your kickstart ... and by default, both SSH/ESXi Shell is disabled by default and the screen you're showing is expected.

    You would need the following (enable AND start service) for SSH and/or ESXi Shell

    # enable & start SSH
    vim-cmd hostsvc/enable_ssh
    vim-cmd hostsvc/start_ssh
    
    # enable & start ESXi Shell
    vim-cmd hostsvc/enable_esx_shell
    vim-cmd hostsvc/start_esx_shell

     



  • 7.  RE: Kickstart File Not Working

    Posted Feb 15, 2023 01:44 PM

    Hi,

    So I connected to the ESXi GUI and tried to enable them, but they keep failing after I start them, need to investigate,

    I think something with the script is messing it up,

    When I deploy the ISO without any KS script, they can be manually started, when using the script, they keep failing.

    I'll make some trial and error with the KS to see which lines are causing the issue...

     

    Besides that,

    I have LACP on the NICs (as you can see from the script),

    Do you know how I can include all NICs to be activates / included in the LACP?



  • 8.  RE: Kickstart File Not Working

    Posted Feb 21, 2023 01:49 PM

    OK, I figured out the problem with the ESXI Shell and SSH,

    For some reason, when using the Kickstart script, the timeouts are set to 0,

    This is causing the services to start and immediately stop,

    After changing the timeout they started working.



  • 9.  RE: Kickstart File Not Working

    Posted Jun 19, 2023 12:29 PM

    Hello all,

     

    I am also having an issue with the kickstart file. It will do the "vmaccepteula", but nothing else in the ks.cfg file. In the file I set the root password with "rootpw" Is there an order of operations to be followed? Does the install take extra time to complete all the commands? Do I need to reboot the machine after the install? What am I doing wrong? 

     

    Including the "ks.cfg" file for your review. *Note - all [redacted] entries have data I cannot share in them, but there are viable IPv4 addresses and viable passwords.

     

    ___ks.cfg___

    vmaccepteula

    install --firstdisk --overwritevmfs

    keyboardType US Default

    network --bootproto=static --ip=[redacted] --netmask=255.255.255.0 --gateway=[redacted] --hostname=testesxi --nameserver=10.1.8.28

    rootpw [redacted]

     

    reboot

    ___EOF__

     

    --

    Jam



  • 10.  RE: Kickstart File Not Working

    Posted Jun 20, 2023 12:09 AM
      |   view attached

    Hi,

    SO I had multiple - connectivity related issues:

    1. my NICs are configured as LACP, so had to change the BOOT file to set the network (including VLAN),

    2. The KS file I'm using is on a network share, which allows me changing the hostname and run, this way I don't need to change it after.

     

    I suggest, first create the file, and inject it to the ISO, and run from there, this way you can avoid any networking issues,

    Once this is successful, you can repoint it to NFS share (if needed)

    Attached is the latest I use (I believe), private data removed.

    In ESX 8.X they made a change with the non-supported CPU, but you probably don't need it.

    Hope that would help

     

     

     

    Attachment(s)

    txt
    MINE8X-SHARED.txt   1 KB 1 version


  • 11.  RE: Kickstart File Not Working

    Posted Jun 20, 2023 08:23 PM

    Hello all,

    In my post from 06-19-2023 05:28 AM, I was wrong. After doing further testing, it does not do the "vmaccepteula". If there is a Kickstart cfg file present, it will just not ask any configuration questions. It will not pass any config data on to the install. Also, from what I can tell, the file can be completely blank, and I will get the same behavior. If there is NO cfg file, I will get the setup questions. If I give it a bad filename or a filename that does not exist, I will get an error during the PXE-Kickstart-Install.

     

    Just adding clarity.

     

    Thank you for looking into this in advance.

     

    --

    James