VMware vSphere

 View Only
  • 1.  Finding the correct install disk for my kickstart file

    Posted Feb 28, 2017 08:11 AM

    Hi,

    we are going to install some Dell T330 which have internal harddisk and a SD Card module. Our goal is to install ESXi6.5 on the SD Card with a pxe installation and a ks.cfg file.

    One big problem is to define the target installation disk in the kickstart file:

    The "install --firstdisk=local --overwritevmfs" option in the ks file does not work since firstdisk=local is interprated as the local harddisk.

    I also tried "install --firstdisk=usb-storage --overwritevmfs", but this one fails with the error, that such disk does not exist.

    So what would be the right parameter for the "install..." option?

    I did a manual install and took a screenshot that shows how esx intereprets the storage.

    See the screenshot attached.

    Any help would be appreciated,

    Chris



  • 2.  RE: Finding the correct install disk for my kickstart file
    Best Answer

    Posted Feb 28, 2017 10:05 AM

    Ok I solved it myself now using the %pre and %include sections:

    %include /tmp/DiskConfig

    network --bootproto=dhcp --device=vmnic0
    reboot

    %pre --interpreter=busybox
    DISK=`ls /vmfs/devices/disks|grep Internal_Dual_SD|grep -v :`
    echo "install --disk=$DISK --overwritevmfs --novmfsondisk">/tmp/DiskConfig



  • 3.  RE: Finding the correct install disk for my kickstart file

    Posted Apr 03, 2018 10:07 PM

    Am having the same issue.

    Can you help understand what does %per and %include do ?



  • 4.  RE: Finding the correct install disk for my kickstart file

    Posted Nov 24, 2023 07:54 AM

    Thanks for this help, im not used the same filter for me but i search the smaller disk

     

    disk=`du /vmfs/devices/disks/* | grep -v : | grep -v "^0" | sort -n | head -n 1 | awk -F/ '{print $(NF)}'`

     



  • 5.  RE: Finding the correct install disk for my kickstart file

    Posted Feb 07, 2025 02:06 PM

    Hi all, 

    I am trying to force install on the largest disk (RAID6 with 2 virtual disks).

    Inspired by these posts and a bit of playing around I came up with:

    du -s /dev/disks/* | sort -nr | head -n1 | awk -F / '{print $(NF)}'

    which when run in the shell will return the correct "naa.xxx" name. 

    Can anyone help with adding this to the KS file.

    At the minute I get errors:

    1. Unknown argument  "$(NF)}"
    2. --disk= specified, but drive "du -s /dev/disks/* | sort -nr | head -n1 | awk -F / '{print" was not found

    Top of my current KS.CFG file is below.

    vmaccepteula
    
    rootpw SuperS3ecretP@ss
    
    #clearpart --disk --overwritevmfs
    install --disk='du -s /dev/disks/* | sort -nr | head -n1 | awk -F / '{print $(NF)}'' --overwritevmfs
    
    #Keyboard
    keyboard 'United Kingdom'
    
    #Host Network Settings
    network --bootproto=static --device=vmnic1 --addvmportgroup=1 --ip=10.0.0.120 --netmask=255.255.255.0 --gateway=10.0.0.20 --nameserver=10.0.0.1 --hostname=xxx
    
    #Reboot
    reboot --noeject

    Thanks,

    Mike




  • 6.  RE: Finding the correct install disk for my kickstart file

    Posted Feb 07, 2025 05:16 PM

    @SilentT could you provide an example of this line in your wider KS file?

    I am trying to use 

    du -s /dev/disks/* | sort -nr | head -n1 | awk -F / '{print $(NF)}' 

    to install ESXi onto the larger of two RAID6 drives.

    When I run the command in the shell it works as I expect and returns the correct naa.xxxxx

    disks="$(du -s /dev/disks/* | sort -nr | head -n1 | awk -F / '{print $(NF)}')" 
    echo $disks

    but, when I try to incorporate this into my KS file, it fails.

    Any ideas?

    Thanks,

    Mike




  • 7.  RE: Finding the correct install disk for my kickstart file

    Posted Feb 10, 2025 03:04 AM

    You execute this command on %pre and you write it on /tmp and it be include

    accepteula
    
    
    # Clean all partition for clean any existant OS
    clearpart --alldrives --overwritevmfs
    
    
    #Install Now its Dinamic generated in %pre for find the smaller disk 
    #install --firstdisk=$disk --novmfsondisk --overwritevmfs
    
    %include /tmp/DiskConfig
    
    %pre --interpreter=busybox
    # Delete all partition of all disk
    for disk in `ls /vmfs/devices/disks/* | grep -v : `; do partition_ids=$(partedUtil get $disk | tail -n +2| awk '{print $1}'); for partition_id in $partition_ids; do partedUtil delete $disk $partition_id ; done done
    
    #Search Smaller Disk
    disk=`du /vmfs/devices/disks/* | grep -v : | grep -v "^0" | sort -n | head -n 1 | awk -F/ '{print $(NF)}'`
    
    # Write Install command with dynamic disk and include it
    echo "install --disk=$disk --novmfsondisk --overwritevmfs" > /tmp/DiskConfig