Need help with ESXi kickstart script for automated scripted install

I am installing ESXi with an automated usb install via a kickstart script. The ks.cfg file is as the one listed below.
As of now, the installer installs the ESXi on the USB drive that I use for booting and installing. Seems like the installer doesn't find the RAID5 storage that the host has and chooses the usb instead. I am lalso assuming that the clearpart line below is clearing all available disks, including the usb disk. I don't want that.

Any suggestions?

accepteula
clearpart --alldrives --overwritevmfs  
install --firstdisk=local --overwritevmfs
rootpw dposdpos
network --bootproto=static --device=vmnic0 --addvmportgroup=0 --ip=172.2.12.12 --netmask=255.255.0.0 --gateway=172.20.15.2 --hostname=AB-ESXiHost1 --vlanid=100 --nameserver=8.8.8.8


%post --interpreter=busybox --ignorefailure=true
#Get the config file:
cd /ovf
#Using test configuration(test-config.txt) until later - so this is commented out:
#wget --user=user--password=Secret1 http://172.20.15.2/servers.txt

# Gather information from configuration file:
ESXiHostname=`more /ovf/test-config.txt | grep esx1 | cut -d';' -f1`
ESXiIpAddress=`more /ovf/test-config.txt | grep esx1 | cut -d';' -f2`
ESXiSubnet=`more /ovf/test-config.txt | grep esx1 | cut -d';' -f3`
ESXiGateway=`more /ovf/test-config.txt | grep esx1 | cut -d';' -f4`
ESXiSubnetID=`more /ovf/test-config.txt | grep esx1 | cut -d';' -f5`
ESXiVLAN=`more /ovf/test-config.txt | grep esx1 | cut -d';' -f6`

# Set the IP address configuration on the host:
esxcli system hostname set --host=$ESXiHostname
esxcli network ip interface ipv4 set --interface-name vmnic0 --type static --ipv4 $ESXiIpAddress --netmask $ESXiSubnet
esxcli network vswitch standard portgroup set -p "Management Network" --vlan-id $ESXiVLAN
esxcli network ip route ipv4 add --gateway $ESXiGateway --network $ESXiSubnetID

# Set route as a permament route:
/etc/rc.local.d/local.sh

# Copy the ovf tool to the correct location:
cp -R /ovf /vmfs/volumes/datastore1/

esxcli system shutdown reboot -d 120 -r "Host post install setup done! Rebooting.."

Open in new window

LVL 2
itniflAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
is your RAID 5 storage controller, on the HCL, and already presented to the OS, as a RAID 5 volume ? (virtual disk, or logical disk)

have you tried also changing the order, it tries to install to storage

--firstdisk(=<disk-type1>,[<disk-type2>, ...])

Partitions the first eligible disk found. The order of the eligible disks is set to:

1 locally attached storage (local)
2 network storage (remote)
3 usb disks (usb)
You can change the ordering of the disks by using a comma separated list appended to the argument.

see here

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2004582
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
itniflAuthor Commented:
I have been struggling with this setting (--firstdisk) in various ways now. Tried it these ways:
--firstdisk
--firstdisk=local
And now testing:
--firstdisk=p420i,local

p420i is the raid controller that the raid5 volume is on.
I have deleted the raid 5 disk and set it up again. According to the documentation, this is exactly what they do when the host is installed manually. I will try to install it again with the last mentioned setting above, see if I can find some log files and then perhaps try to install manually to see if the disk raid array is discovered then.

I also have the option of specifying the disk to use --disk=identifier
But I am not sure what identifier that would be or where to find it. And also I suppose this identifier is different from system to system, even if all the hosts are HP G8? So no real point in using it, I guess.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
it's the disk identifier, you can see when ESXi is installed.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

itniflAuthor Commented:
OK thanks. Looks like the usb disk is being listed as first available local storage. I found this when I booted with a regular installer. I have no idea why it is not being listed as usb storage. Because it is taking the place as first local storage, the real first local storage is not being used. I can see that the real local storage is labeled as HP iLO. I guess I will try to use --firstdrive=HP, or could I use the identifier that is shown there not only on this systems, but all systems?

Listed as local storage
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
what is the boot order on the server set to?
0
itniflAuthor Commented:
It is set to "External DriveKeys First" - change it and explicitly choose to boot from usb at startup instead of automatically?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
it's a bit odd, it states remote ?
0
itniflAuthor Commented:
Yes, the RAID states as remote. The internal SD card that is almost 8 GB states as local number two. I guess on second thought that I should be using the local SD card for the ESXi install and the raid for a datastore.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
I would recommend the use of an SD card or USB flash drive for installation of the OS.

It's much easier to expand a datastore, when it just has a VMFS datastore, and not combined with the OS.
0
itniflAuthor Commented:
Yes, absolutely. I misunderstood the initial setup, SD card it is!
Right before I left work yesterday, It seemed as if the following was functional and did what I wanted:
clearpart --firstdisk=HP --overwritevmfs  
install --firstdisk=HP --overwritevmfs

Open in new window

Here the SD card is chosen, since it is the first local storage with the vendor name HP.
I will look further into the boot sequence and why the usb drive is listed as local storage.
I would like to clear all partitions on all drives except the USB drive. I am assuming that clearpart --alldrives --overwritevmfs also clears the USB drive since it is listed as local storage. I guess I could use --ignoredrives=, but I would not know what to identify the USB with. I am also unsure if that identifier changes if a different USB stick is used a different time for the installation process.
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2004582
0
itniflAuthor Commented:
Looks like things are working as they should with:
clearpart --firstdisk=HP --overwritevmfs  
install --firstdisk=HP --overwritevmfs
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VMware

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.