Hi all,
I have one problem with my kickstart script install Semi-Interactive automated. i don't understand why is don't work
when my script started i have an error: my variable $ipnew, $subnet, $gatew, is not set, the prompt for set this variable not appears
Before installation starting, i needed to prompt windows for set variable, join my script : (i have create a custom ISO, and my KS.CFG in under the iso)
BOOT.CFG
bootstate=0
title=Loading ESXi installer
kernel=/tboot.b00
kernelopt=runweasel ks=cdrom:/KS.CFG
modules=/b.b00 --- /useropts.gz --- /k.b00 --- /chardevs.b00 --- /a.b00 --- /user.b00 --- /s.v00 --- /ata_pata.v00 --- /ata_pata.v01 --- /ata_pata.v02 --- /ata_pata.v03 --- /ata_pata.v04 --- /ata_pata.v05 --- /ata_pata.v06 --- /ata_pata.v07 --- /block_cc.v00 --- /ehci_ehc.v00 --- /weaselin.t00 --- /esx_dvfi.v00 --- /xlibs.v00 --- /ima_qla4.v00 --- /ipmi_ipm.v00 --- /ipmi_ipm.v01 --- /ipmi_ipm.v02 --- /misc_cni.v00 --- /misc_dri.v00 --- /net_be2n.v00 --- /net_bnx2.v00 --- /net_bnx2.v01 --- /net_cnic.v00 --- /net_e100.v00 --- /net_e100.v01 --- /net_enic.v00 --- /net_forc.v00 --- /net_igb.v00 --- /net_ixgb.v00 --- /net_nx_n.v00 --- /net_r816.v00 --- /net_r816.v01 --- /net_s2io.v00 --- /net_sky2.v00 --- /net_tg3.v00 --- /net_vmxn.v00 --- /ohci_usb.v00 --- /sata_ahc.v00 --- /sata_ata.v00 --- /sata_sat.v00 --- /sata_sat.v01 --- /sata_sat.v02 --- /sata_sat.v03 --- /sata_sat.v04 --- /scsi_aac.v00 --- /scsi_adp.v00 --- /scsi_aic.v00 --- /scsi_bnx.v00 --- /scsi_fni.v00 --- /scsi_hps.v00 --- /scsi_ips.v00 --- /scsi_lpf.v00 --- /scsi_meg.v00 --- /scsi_meg.v01 --- /scsi_meg.v02 --- /scsi_mpt.v00 --- /scsi_mpt.v01 --- /scsi_mpt.v02 --- /scsi_qla.v00 --- /scsi_qla.v01 --- /scsi_rst.v00 --- /uhci_usb.v00 --- /tools.t00 --- /xorg.v00 --- /imgdb.tgz --- /imgpayld.tgz
build=
updated=0
ISOLINUX.CFG
DEFAULT menu.c32
MENU TITLE ESXi-5.1.0-799733-standard Boot Menu
NOHALT 1
PROMPT 0
TIMEOUT 80
LABEL install
KERNEL mboot.c32
APPEND -c boot.cfg ks=cdrom:/KS.CFG
MENU LABEL ESXi-5.1.0-799733-standard ^Installer
LABEL hddboot
LOCALBOOT 0x80
MENU LABEL ^Boot from local disk
KS.CFG
# Accepte le contrat de licence
accepteula
# Installation sur le premier disk
autopart --firstdisk --overwritevmfs
# Definit clavier Francais
keyboard French
# Definit le mot de passe pour root
rootpw ****
install --firstdisk --overwritevmfs
# Les input pour "set" les variables
while [ "$fqdn" == "" ] ;do
header
echo "Merci d'entrer le FQFN complet:"
echo -n "Ex: QS0XXXX."
read fqdn
done
while [ "$ipnew" == "" ] ;do
header
echo -n "Entrer IP du serveur:"
read ipnew
done
while [ "$subnet" == "" ] ;do
header
echo ""
echo -n "Entrer le subnet:"
read subnet
done
while [ "$gatew" == "" ] ;do
header
echo ""
echo -n "Entrer IP de la Gateway:"
read gatew
done
while [ "$dns1" == "" ] ;do
header
echo ""
echo -n "DNS primaire:"
read dns1
done
while [ "$dns2" == "" ] ;do
header
echo ""
echo -n "DNS secondaire:"
read dns2
done
while [ "$vlanid" == "" ] ;do
header
echo ""
echo -n "Vlan du Service console:"
read vlanid
done
while [ "$Ipvmotion" == "" ] ;do
header
echo ""
echo -n "Ip du VMotion:"
read Ipvmotion
done
while [ "$VlanIDVMotion" == "" ] ;do
header
echo ""
echo -n "Vlan du VMotion:"
read VlanIDVMotion
done
## Verification de la valeur des variables ##
echo ""
echo -n "Resumer de la configuration:"
echo ""
echo ""
echo -n "Nom de la machine: $fqdn"
echo ""
echo -n "IP: $ipnew"
echo ""
echo -n "Subnet Mask: $subnet"
echo ""
echo -n "Gateway: $gatew"
echo ""
echo -n "Pri DNS: $dns1"
echo ""
echo -n "Sec DNS: $dns2"
echo ""
echo -n "Vlan ID du Service console: $vlanid"
echo ""
echo -n "Ip du VMotion: $Ipvmotion"
echo ""
echo -n "Vlan du VMotion: $VlanIDVMotion"
echo ""
echo ""
## Accepter ou pas les variables ##
while [ "$check1" != "true" ]
do
echo ""
echo -n "Les informations sont elles corrects (type y or n) ? "
read opt
case $opt in
"yes"|"y"|"no"|"n") check1="true"
;;
*) check=1"false"
;;
esac
done
if [ "$opt" != "yes" ] && [ "$opt" != "y" ] ; then
echo ""
echo "##############################################"
echo "ESXi 5.1 Installation FAILED !!!!! "
echo ""
echo "Merci de reboot et de relancer l'installation"
echo "##############################################"
read instfail
exit 1
fi
## Configuration du service console
network --device=vmnic0 --bootproto=static --ip=$ipnew --netmask=$subnet --gateway=$gatew --nameserver="$dns1,$dns2" --hostname=$fqdn --vlanid=$vlanid --addvmportgroup=0
%firstboot --unsupported --interpreter=busybox --level=9999
# 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
#rename du DataStore local
vim-cmd hostsvc/datastore/rename datastore1 "$datastore_$fqdn"
# enter maintenance mode
esxcli system maintenanceMode set -e true
# Modification des variables
esxcli system settings advanced set -o /UserVars/ESXiShellInteractiveTimeOut -i 3600
esxcli system settings advanced set -o /Net/BlockGuestBPDU -i 1
grep -i "vhv.enable" /etc/vmware/config || echo "vhv.enable = \"TRUE\"" >> /etc/vmware/config
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1
# Disable IPv6 for VMkernel interfaces
esxcli system module parameters set -m tcpip3 -p ipv6=0
# change the individual syslog rotation count
esxcli system syslog config logger set --id=hostd --rotate=20 --size=2048
esxcli system syslog config logger set --id=vmkernel --rotate=20 --size=2048
esxcli system syslog config logger set --id=fdm --rotate=20
esxcli system syslog config logger set --id=vpxa --rotate=20
# NTP CONFIGURATIONS ###
cat > /etc/ntp.conf << __NTP_CONFIG__
restrict default kod nomodify notrap noquerynopeer
restrict 127.0.0.1
server 0.ntp.agf.fr
__NTP_CONFIG__
/sbin/chkconfig ntpd on
# enable firewall
esxcli network firewall set --default-action false --enabled yes
# Configuration reseau
# Attachement des cartes vmnic0,vmnic1 au vSwitch0
esxcli network vswitch standard uplink add --uplink-name vmnic0 --vswitch-name vSwitch0
esxcli network vswitch standard uplink add --uplink-name vmnic1 --vswitch-name vSwitch0
# configuration des vPortGroup
esxcli network vswitch standard portgroup add --portgroup-name PR_102 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_102 --vlan-id 102
esxcli network vswitch standard portgroup add --portgroup-name PR_109 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_109 --vlan-id 109
esxcli network vswitch standard portgroup add --portgroup-name PR_112 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_112 --vlan-id 112
esxcli network vswitch standard portgroup add --portgroup-name PR_113 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_113 --vlan-id 113
esxcli network vswitch standard portgroup add --portgroup-name PR_114 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_114 --vlan-id 114
esxcli network vswitch standard portgroup add --portgroup-name PP_115 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_115 --vlan-id 115
esxcli network vswitch standard portgroup add --portgroup-name PR_116 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_116 --vlan-id 116
esxcli network vswitch standard portgroup add --portgroup-name PI_118 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PI_118 --vlan-id 118
esxcli network vswitch standard portgroup add --portgroup-name PR_122 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_122 --vlan-id 122
esxcli network vswitch standard portgroup add --portgroup-name PR_128 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_128 --vlan-id 128
esxcli network vswitch standard portgroup add --portgroup-name PR_131 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_131 --vlan-id 131
esxcli network vswitch standard portgroup add --portgroup-name PR_139 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_139 --vlan-id 139
esxcli network vswitch standard portgroup add --portgroup-name T0_140 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name T0_140 --vlan-id 140
esxcli network vswitch standard portgroup add --portgroup-name PI_140 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PI_140 --vlan-id 140
esxcli network vswitch standard portgroup add --portgroup-name PR_141 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_141 --vlan-id 141
esxcli network vswitch standard portgroup add --portgroup-name PR_150 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_150 --vlan-id 150
esxcli network vswitch standard portgroup add --portgroup-name PP_151 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_151 --vlan-id 151
esxcli network vswitch standard portgroup add --portgroup-name AP_151 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name AP_151 --vlan-id 151
esxcli network vswitch standard portgroup add --portgroup-name PP_156 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_156 --vlan-id 156
esxcli network vswitch standard portgroup add --portgroup-name PR_309 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_309 --vlan-id 309
esxcli network vswitch standard portgroup add --portgroup-name PR_313 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_313 --vlan-id 313
esxcli network vswitch standard portgroup add --portgroup-name PP_315 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_315 --vlan-id 315
esxcli network vswitch standard portgroup add --portgroup-name PR_315 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_315 --vlan-id 315
esxcli network vswitch standard portgroup add --portgroup-name PI_318 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PI_318 --vlan-id 318
esxcli network vswitch standard portgroup add --portgroup-name PR_318 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_318 --vlan-id 318
esxcli network vswitch standard portgroup add --portgroup-name PR_322 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_322 --vlan-id 322
esxcli network vswitch standard portgroup add --portgroup-name PP_325 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_325 --vlan-id 325
esxcli network vswitch standard portgroup add --portgroup-name PR_325 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_325 --vlan-id 325
esxcli network vswitch standard portgroup add --portgroup-name PR_331 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_331 --vlan-id 331
esxcli network vswitch standard portgroup add --portgroup-name T0_340 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name T0_340 --vlan-id 340
esxcli network vswitch standard portgroup add --portgroup-name PI_340 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PI_340 --vlan-id 340
esxcli network vswitch standard portgroup add --portgroup-name PR_340 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_340 --vlan-id 340
esxcli network vswitch standard portgroup add --portgroup-name PI_342 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PI_342 --vlan-id 342
esxcli network vswitch standard portgroup add --portgroup-name PR_342 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_342 --vlan-id 342
esxcli network vswitch standard portgroup add --portgroup-name PR_350 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_350 --vlan-id 350
esxcli network vswitch standard portgroup add --portgroup-name AP_351 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name AP_351 --vlan-id 351
esxcli network vswitch standard portgroup add --portgroup-name PP_351 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_351 --vlan-id 351
esxcli network vswitch standard portgroup add --portgroup-name PR_109 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_109 --vlan-id 109
esxcli network vswitch standard portgroup add --portgroup-name PR_112 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_112 --vlan-id 112
esxcli network vswitch standard portgroup add --portgroup-name PR_113 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_113 --vlan-id 113
esxcli network vswitch standard portgroup add --portgroup-name PR_114 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_114 --vlan-id 114
esxcli network vswitch standard portgroup add --portgroup-name PP_115 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_115 --vlan-id 115
esxcli network vswitch standard portgroup add --portgroup-name PR_116 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_116 --vlan-id 116
esxcli network vswitch standard portgroup add --portgroup-name PI_118 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PI_118 --vlan-id 118
esxcli network vswitch standard portgroup add --portgroup-name PR_122 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_122 --vlan-id 122
esxcli network vswitch standard portgroup add --portgroup-name PR_128 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_128 --vlan-id 128
esxcli network vswitch standard portgroup add --portgroup-name PR_131 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_131 --vlan-id 131
esxcli network vswitch standard portgroup add --portgroup-name PR_139 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_139 --vlan-id 139
esxcli network vswitch standard portgroup add --portgroup-name T0_140 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name T0_140 --vlan-id 140
esxcli network vswitch standard portgroup add --portgroup-name PI_140 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PI_140 --vlan-id 140
esxcli network vswitch standard portgroup add --portgroup-name PR_141 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_141 --vlan-id 141
esxcli network vswitch standard portgroup add --portgroup-name PR_150 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_150 --vlan-id 150
esxcli network vswitch standard portgroup add --portgroup-name PP_151 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_151 --vlan-id 151
esxcli network vswitch standard portgroup add --portgroup-name AP_151 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name AP_151 --vlan-id 151
esxcli network vswitch standard portgroup add --portgroup-name PP_156 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_156 --vlan-id 156
esxcli network vswitch standard portgroup add --portgroup-name PR_309 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_309 --vlan-id 309
esxcli network vswitch standard portgroup add --portgroup-name PR_313 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_313 --vlan-id 313
esxcli network vswitch standard portgroup add --portgroup-name PP_315 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_315 --vlan-id 315
esxcli network vswitch standard portgroup add --portgroup-name PR_315 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_315 --vlan-id 315
esxcli network vswitch standard portgroup add --portgroup-name PI_318 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PI_318 --vlan-id 318
esxcli network vswitch standard portgroup add --portgroup-name PR_318 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_318 --vlan-id 318
esxcli network vswitch standard portgroup add --portgroup-name PR_322 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_322 --vlan-id 322
esxcli network vswitch standard portgroup add --portgroup-name PP_325 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_325 --vlan-id 325
esxcli network vswitch standard portgroup add --portgroup-name PR_325 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_325 --vlan-id 325
esxcli network vswitch standard portgroup add --portgroup-name PR_331 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_331 --vlan-id 331
esxcli network vswitch standard portgroup add --portgroup-name T0_340 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name T0_340 --vlan-id 340
esxcli network vswitch standard portgroup add --portgroup-name PI_340 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PI_340 --vlan-id 340
esxcli network vswitch standard portgroup add --portgroup-name PR_340 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_340 --vlan-id 340
esxcli network vswitch standard portgroup add --portgroup-name PI_342 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PI_342 --vlan-id 342
esxcli network vswitch standard portgroup add --portgroup-name PR_342 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_342 --vlan-id 342
esxcli network vswitch standard portgroup add --portgroup-name PR_350 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PR_350 --vlan-id 350
esxcli network vswitch standard portgroup add --portgroup-name AP_351 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name AP_351 --vlan-id 351
esxcli network vswitch standard portgroup add --portgroup-name PP_351 --vswitch-name vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name PP_351 --vlan-id 351
# configure et active le vmnic0 + passage du vmnic1 en standby
esxcli network vswitch standard policy failover set --active-uplinks vmnic0 --standby-uplinks vmnic1 --vswitch-name vSwitch0
# configure failure detection + load balancing (could have appended to previous line)
esxcli network vswitch standard policy failover set --failback yes --failure-detection beacon --load-balancing portid --notify-switches yes --vswitch-name vSwitch0
# add vSwitch1
esxcli network vswitch standard add --ports 256 --vswitch-name vSwitch1
# Add vMotion Portgroup to vSwitch0, assign it VLAN ID ${VLANV} and create a VMkernel interface
esxcli network vswitch standard portgroup add --portgroup-name=VMotion --vswitch-name=vSwitch0
esxcli network vswitch standard portgroup set --portgroup-name=VMotion --vlan-id=$VlanIDVMotion
esxcli network ip interface add --interface-name=vmk1 --portgroup-name=VMotion
esxcli network ip interface ipv4 set --interface-name=vmk1 --ipv4=$Ipvmotion --netmask=$subnet --type=static --VlanID=$VlanIDVMotion
esxcli network ip interface ipv4 set -i=vmk1 --ipv4=$Ipvmotion --netmask=$subnet --type=static --VlanID=$VlanIDVMotion
vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-active=vmnic1 --nicorderpolicy-standby=vmnic0 vSwitch0 "VMotion"
# Enable vMotion on the newly created VMkernel vmk0
vim-cmd hostsvc/vmotion/vnic_set vmk1
Anyone have an idea?