ESXi scripted installation fails to dynamically identify host via remote kickstart URL
search cancel

ESXi scripted installation fails to dynamically identify host via remote kickstart URL

book

Article ID: 440457

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

During a silent scripted installation of VMware ESXi, administrators are unable to uniquely identify the target host when requesting a remote kickstart file via the ks=https://... boot parameter. The installer does not natively support variable substitution (e.g., {MACADDRESS}) or provide HTTP headers equivalent to RedHat's kssendmac functionality.

Symptoms include:

  • Inability to dynamically serve host-specific configurations (IP, Hostname, Root Password) from a centralized web server.

  • HTTP GET requests for the kickstart file lack unique hardware identifiers in the headers or query strings.

  • The installer fails to automatically discover ks.cfg on secondary virtual media or CD-ROMs without manual boot parameter intervention.

 

Environment

VMware ESXi 7.x, 8.x
VMware Cloud Foundation (VCF)

Cause

The ESXi weasel installer architecture does not scan local hardware or perform network-stack variable substitution prior to requesting the kickstart configuration file.

Resolution

To achieve dynamic host identification for scripted installs, use one of the following two validated methodologies:

Method 1: iPXE Variable Substitution (Recommended for Network Installs) Utilize an iPXE bootloader to intercept the hardware MAC address and inject it into the boot command line before the ESXi kernel takes control.

  1. Configure your iPXE script:

    Bash
     
    #!ipxe
    set mac ${net0/mac}
    kernel http://<SERVER_IP>/tboot.b00
    imgargs tboot.b00 ks=https://<SERVER_IP>/ks.php?mac=${mac}
    boot
    
  2. Configure the web server to parse the mac query string and return a customized ks.cfg.


Method 2: Two-Stage Kickstart (%include Method) Use a generic "Stage 1" kickstart file to identify the host and download the "Stage 2" configuration.

  1. Create a primary kickstart with a %pre section:

    Bash
     
    vmaccepteula
    rootpw --iscrypted <PASSWORD>
    install --firstdisk --overwritevmfs
    
    %pre --interpreter=busybox
    # Identify MAC address
    MAC=$(localcli network nic list | grep vmnic0 | awk '{print $4}')
    # Download specific configuration
    wget -O /tmp/host_specific.cfg "https://<SERVER_IP>/get_ks.php?mac=$MAC"
    
    # Include the downloaded directives
    %include /tmp/host_specific.cfg
    
  2. Ensure the remote server provides the specific network and hostname directives in the host_specific.cfg response.

Additional Information

Installation and Upgrade Scripts Used for ESXi Installation