PXE Boot for ESXi5.x deployment on RHEL6.5

Posted by ronald on juli 20, 2014 in Nieuws |

Install necessary packages

 

Install PXE boot stuff

mount /dev/cdrom /mnt
/mnt/Packages
rpm -ivh syslinux-4.02-8.el6.x86_64.rpm mtools-4.0.12-1.el6.x86_64.rpm
Install http server for kickstart file
rpm -ivh httpd-2.2.15-29.el6_4.x86_64.rpm apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm  httpd-tools-2.2.15-29.el6_4.x86_64.rpm  apr-util-1.3.9-3.el6_0.1.x86_64.rpm apr-1.3.9-5.el6_2.x86_64.rpm
umount /mnt

Prepare the tftp boot directory for PXE boot

In my case I change the tftpboot directory to /tftpboot
cd /tftpboot/
mkdir -p pxelinux.cfg
cp /usr/share/syslinux/pxelinux.0 /tftpboot/
cp /usr/share/syslinux/menu.c32 /tftpboot/

 

Prepare ESXi iso image

# copy content esx install iso
mkdir -p /tftpboot/esxi5.1.2
mount -o loop ESXi-5.1.2-1483097-IBM-20140305.iso /mnt
cp -var /mnt/* /tftpboot/esxi5.1.2/

cd /tftpboot/esxi5.1.2/
vi /tftpboot/esxi5.1.2/boot.cfg
Remove all / with vi commando :1,$s/\///g

 

Create a default PXE start file

vi /tftpboot/pxelinux.cfg/default
DEFAULT menu.c32
MENU TITLE ESX server PXE Boot Menu
NOHALT 1
PROMPT 0
TIMEOUT 1200

LABEL hddboot
LOCALBOOT 0x80
MENU LABEL ^Boot from local disk 0
LABEL deploy ESXi
KERNEL esxi5.1.2/mboot.c32
APPEND -c esxi5.1.2/boot.cfg ks=http://ipaddresswebserver/ks.cfg
MENU LOCAL ^Deploy ESXi”
LABEL manual ESXi install
KERNEL esxi5.1.2/mboot.c32
APPEND -c esxi5.1.2/boot.cfg
MENU LOCAL ^ manual ESXi install

 Create a default kickstart file

vi /var/www/html/ks.cfg

vmaccepteula” > /var/www/html/ks_$macaddress.cfg
# generate with  openssl passwd -1
rootpw –iscrypted \$1\$ANP7EE9q\$5QOi7ryY40AlX0lOQJTPm1
clearpart –firstdisk=usb-storage
install –firstdisk=usb-storage”
network –bootproto=dhcp –device=vmnic0
reboot

%firstboot
# Enable SSH and the ESXi shell
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell
esxcli network firewall ruleset set -e true -r httpClient

Copyright © 2012-2018 Dutch Ronaldo All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.