VMware Cloud Community
tdubb123
Expert
Expert

url deprecated kickstart

I am trying to convert my esx4 kickstart file to 5 and came across these errors

any idea what the fix is?

0 Kudos
5 Replies
a_p_
Leadership
Leadership

Some of the commands and options in your script may have changed with vSphere 5. Either attach the script to see how it currently looks like or take a look at e.g. http://pubs.vmware.com/vsphere-50/topic/com.vmware.ICbase/PDF/vsphere-esxi-vcenter-server-50-install... for valid commands and the differences between ESXi 4.x and 5.0.

André

0 Kudos
lamw
Community Manager
Community Manager

That's correct, it's defined in either the pxelinux.cfg or boot.cfg. You can take a look at this blog post on some tips/tricks for ESXi 5 kickstart including a fully working ks.cfg that you can use as an example http://www.virtuallyghetto.com/2011/07/automating-esxi-5x-kickstart-tips.html

0 Kudos
tdubb123
Expert
Expert

This is my script in progress that worked in esx4i

# VMware ESX5 template Kickstart file
# VMware Specific Commands
vmaccepteula
# root password
# auth --enableshadow --enablemd5
rootpw --iscrypted $1$vP/2Aaii$p3x/2htjd5BragreMltBZ/
# Network install type
install url http://[UDA_IPADDR]/[OS]/[FLAVOR]
network  --device=vmnic0 --bootproto=static --ip=[IPADDR] --netmask=[NETMASK] --gateway=[GATEWAY] --nameserver=[DNS1] --hostname=[HOSTNAME].xxx.com --addvmportgroup=0
# Clear partitions (clear partitions on local disk)
clearpart --firstdisk=local --overwritevmfs
# auto partition
autopart --firstdisk=local --overwritevmfs
# Reboot after install
reboot
%firstboot --unsupported --interpreter=busybox --level=998
#####################################################################################
esxcli network vswitch standard portgroup add --portgroup-name=vMotion --vswitch-name=vSwitch0
esxcli network ip interface add --interface-name=vmk1 --portgroup-name=vMotion
esxcli network ip interface ipv4 set --interface-name=vmk1 --ipv4=[VMKERNEL] --netmask=[NETMASK] --type=static
# attach vmnic4 to vSwitch0
esxcli network vswitch standard uplink add --uplink-name vmnic4 --vswitch-name vSwitch0
# Enable vMotion on the newly created VMkernel vmk1
vim-cmd hostsvc/vmotion/vnic_set vmk1
# Add new vSwitch for VM traffic, assign uplinks, create a portgroup and assign a VLAN ID
esxcli network vswitch standard add --vswitch-name=vSwitch1
esxcli network vswitch standard uplink add --uplink-name=vmnic1 --vswitch-name=vSwitch1
esxcli network vswitch standard uplink add --uplink-name=vmnic3 --vswitch-name=vSwitch1
esxcli network vswitch standard portgroup add --portgroup-name=Production --vswitch-name=vSwitch1
esxcli network vswitch standard portgroup set --portgroup-name=Production --vlan-id=10
#####################################################################################
# Storage
vim-cmd hostsvc/datastore/rename datastore1 $(hostname -s)-local
# Generate a new scratch directory for this host on a Datastore
scratchdirectory=/vmfs/volumes/$(hostname -s)-local/.locker-$(hostname 2> /dev/null)-$(esxcfg-info -b 2> /dev/null)
# Create the scratch directory
mkdir -p $scratchdirectory
# Change the advanced configuration option
vim-cmd hostsvc/advopt/update ScratchConfig.ConfiguredScratchLocation string $scratchdirectory
# enable & start remote ESXi Shell  (SSH)
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh
# enable & start ESXi Shell (TSM)
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1
# ntp
### NTP CONFIGURATIONS ###
cat > /etc/ntp.conf << __NTP_CONFIG__
restrict default kod nomodify notrap noquerynopeer
restrict 127.0.0.1
server 0.vmware.pool.ntp.org
server 1.vmware.pool.ntp.org
__NTP_CONFIG__
/sbin/chkconfig --level 345 ntpd on
# Brocade drivers install
%firstboot --unsupported --interpreter=busybox --level=9999
# Enter Maintenance mode before drivers install
vim-cmd hostsvc/maintenance_mode_enter
# Download drivers to /tmp
cd /tmp
chmod +x post_install.cfg
ash post_install.cfg
sleep 10
reboot
#vim-cmd hostsvc/maintenance_mode_enter
%post --unsupported --interpreter=busybox
0 Kudos
tdubb123
Expert
Expert

how do I add the post install script in esxi 5 kickstart?

%firstboot --unsupported --interpreter=busybox --level

does not work anymore

0 Kudos
lamw
Community Manager
Community Manager

%post section does not exists in ESXi in general, this can be taken care of by using %firstboot stanza. Please refer to the ESXi installation documentation for all the available pxe and kickstart options that are valid.

0 Kudos