VMWare: Setting up PXE deployment for ESXi 5

From Define Wiki
Revision as of 12:37, 21 February 2013 by David (talk | contribs)
Jump to navigation Jump to search

Copy over the ISO files

Copy over the ISO on to an area on the tftp server root (in this case: /var/lib/tftpboot)

mount -o loop VMware-VMvisor-Installer-5.1.0-799733.x86_64.iso /mnt/vmware
rsync -a /mnt/vmware/ /var/lib/tftpboot/images/vmware/
chmod +w /var/lib/tftpboot/images/vmware/*

Create a kickstart file

Create a file called ks.cfg to automate the installation

# file: /var/www/cobbler/ks_mirror/VMWare-x86_64/ks.cfg

#
# Sample scripted installation file
#

# Accept the VMware End User License Agreement
vmaccepteula

# Set the root password for the DCUI and Tech Support Mode
rootpw Boston2013

# reboot after installation
reboot

# Install on the first local disk available on machine
install --firstdisk --overwritevmfs

# Set the network to DHCP on the first network adapter
network --bootproto=dhcp --device=vmnic0

# 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

# A sample post-install script
%post --interpreter=python --ignorefailure=true
import time
stampFile = open('/finished.stamp', mode='w')
stampFile.write( time.asctime() )

Edit the boot.cfg file

Here's an example one (remove the / for all files and add a prefix>

bootstate=0
title=Loading ESXi installer
prefix=/images/vmware
kernel=tboot.b00
kernelopt=ks=http://172.28.0.2/cobbler/ks_mirror/VMWare-x86_64/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

Setup the PXE boot file

Added to the default file so VMWare can be selected - use the 01-MAC if you want to set for specific systems

# section in the file /var/lib/tftpboot/pxelinux.cfg/default
LABEL vmware
        kernel /images/vmware/mboot.c32
        MENU LABEL Vmware-5.1.0
        append -c /images/vmware/boot.cfg