Search This Blog

Showing posts with label esxi. Show all posts
Showing posts with label esxi. Show all posts

2015-02-02

ESXi 5.1 PXE Install

ESXi PXE Install is very similar to any other kind of automated PXE deployment.

There are a few finicky components you'll have to deal with but overall it's fairly straight forward.

This is assuming you already have PXELINUX fully installed and configured along with DHCP and TFTP Server

  1. Download the ISO
  2. Mount the iso (I'm mounting in BSD)
  3. mdconfig -a -t vnode -f isoimage.iso -u 1 mount -t cd9660 /dev/md1 /mnt/iso/
  4. Create a directory to store the raw iso files
  5. mkdir -p /images/esxi/5.1/1065491/dell-a03/ I like to organize my images via. MajorVersion-Build-SpecialInfo
  6. Rsync the iso contents over
  7. rsync -av /mnt/iso/ /images/esxi/5.1/1065491/dell-a03/
  8. unmount the iso
  9. umount /mnt/iso mdconfig -d -u 1
  10. Create an "isolinux.cfg" file which basically is just used to point to the files required to boot up and run the kernel/kickstart files. This file will exist typically under the pxelinux.cfg directory either as the file called "default" or will match the mac-address of the machine you would like to image
  11. /images/kickstart/ESXI-5.1-1065491-dell-a03.ks DEFAULT install LABEL install KERNEL images/esxi/5.1/1065491/dell-a03/mboot.c32 APPEND -c images/esxi/5.1/1065491/dell-a03/boot.cfg MENU LABEL Dell ESXi-5.1-Update 1-1065491(A03) ^Installer As you can see mine is fairly simple with no menu.c32 as this file I dont want to have any options. I just want to copy this file over and have it boot up the correct references files ex. KERNEL $path to mboot.c32
  12. Modify the boot.cfg file so that it does not reference the tftp root directory thanks to http://brain.serenity-networks.com/networking-computers/vmware/esxi-5-5-5-pxe-installation-via-syslinux
  13. sed -e "s#/##g" -e "3s#^#prefix=/`basename $PWD`/\n#" -i.bak boot.cfg The above line will not only remove preceeding / it will also add a prefix= parameter where we can specify the path to our files.
  14. Then you will modify the prefix parameter with the path to your files on tftp. In my case it would be "/images/esxi/5.1/1065491/dell-a03/"
  15. bootstate=0 title=Loading ESXi installer prefix=images/esxi/5.1/1065491/dell-a03/ kernel=tboot.b00 kernelopt=ks=ftp://ftp/images/kickstart/scripts/ESXI-5.1-1065491-dell-a03.ks modules=b.b00 --- useropts.gz --- k.b00 --- chardevs.b00 --- a.b00 --- user.b00 --- s.v00 --- misc_cni.v00 --- net_bnx2.v00 --- net_bnx2.v01 --- net_cnic.v00 --- net_tg3.v00 --- scsi_bnx.v00 --- scsi_bnx.v01 --- net_bna.v00 --- scsi_bfa.v00 --- ima_be2i.v00 --- scsi_be2.v00 --- scsi_lpf.v00 --- net_igb.v00 --- net_ixgb.v00 --- scsi_mpt.v00 --- scsi_mti.v00 --- ima_qla4.v00 --- net_qlcn.v00 --- scsi_qla.v00 --- scsi_qla.v01 --- 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 --- ipmi_ipm.v00 --- ipmi_ipm.v01 --- ipmi_ipm.v02 --- misc_dri.v00 --- net_be2n.v00 --- net_e100.v00 --- net_e100.v01 --- net_enic.v00 --- net_forc.v00 --- net_nx_n.v00 --- net_qlge.v00 --- net_r816.v00 --- net_r816.v01 --- net_s2io.v00 --- net_sky2.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_fni.v00 --- scsi_hps.v00 --- scsi_ips.v00 --- scsi_meg.v00 --- scsi_meg.v01 --- scsi_meg.v02 --- scsi_mpt.v01 --- scsi_mpt.v02 --- scsi_rst.v00 --- uhci_usb.v00 --- tools.t00 --- dell_con.v00 --- xorg.v00 --- imgdb.tgz --- imgpayld.tgz build= updated=0

References:
Example kickstart config from yellow-bricks: http://www.yellow-bricks.com/2011/07/19/esxi-5-0-and-scripted-installs/
Kickstart valid parameters: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2004582
Example kickstart from william lam: http://www.virtuallyghetto.com/2011/07/automating-esxi-5x-kickstart-tips.html
Blog to show how to structure boot.cfg: http://brain.serenity-networks.com/networking-computers/vmware/esxi-5-5-5-pxe-installation-via-syslinux/
Vmware documentation on PXE Install: https://pubs.vmware.com/vsphere-50/index.jsp#com.vmware.vsphere.install.doc_50/GUID-B9DB94CA-4857-458B-B6F1-6A688726AED0.html

2012-02-14

Tunneling vSphere Client in Windows

Using tunneling over SSH you can forward the multiple ports needed to access the vSphere client used to administrate ESX or ESXi hosts.

Requirements:
  • SSH jumpbox (from this jumpbox you should have access to the ESX/ESXi machine)
  • PuTTY or Cygwin

So basically we are binding the following ports: 443, 902, and 903 to our localhost using PuTTy in this tutorial.

Steps:

  1. Open up PuTTy and configure the settings to look as follows where destIP=your destination IP address of the ESX box
  2. Go back to the session tab and type the hostname/IP address of your SSH jumpbox. Alternatively you could open up cygwin and type the following: ssh -L 443:destIP:443 -L 902:destIP:902 -L 903:destIP:903 user@jumpboxIP
  3. Edit the hosts file in windows C:\Windows\system32\drivers\etc\hosts (this is required as esxi relies on dns name and uses local resolution).

    Add the entry:
    127.0.0.1    ESXiHostname
  4. Open up vSphere client and login with the hostname of the remote ESX box

Common Errors:
Unable to connect to the MKS: Failed to connect to server :902

Occurs if you are not properly forwarding port 902 903

2012-02-11

Customizing an VMware ESXi5 installation disc for unattended install

This explains the workflow of creating a customized ESXi5 installation disc using a Windows PC. VMware has documentation on this workflow using a linux machine here.

1) Download the ESXi iso.
2) Extract the iso using your favourite iso extractor to c:\esxi. I used 7zip.
3) Create a KS.CFG file in c:\esxi with your Kickstart config. Documentation of ESXi5 kickstart commands is here.
4) Modify c:\esxi\ISOLINUX.CFG. Append "ks=cdrom:/KS.CFG" to APPEND. Your LABEL install should look like this:
LABEL install
KERNEL mboot.c32
APPEND -c boot.cfg ks=cdrom:/KS.CFG
MENU LABEL ESXi-5.0.0-20111104001-custom ^Installer

You can also add multiple LABEL install blocks to specify different KS.CFG files or no kickstart at all.
**When ESXi mounts the CD during setup, all files are capitalized. So even if your kickstart cfg file is ks.cfg you have to put KS.CFG.

Now you have to burn your customized setup onto a disc.
1) Download and extract cdrtools for windows from here.
2) Run this command to create the iso (case senstive):
mkisofs.exe -relaxed-filenames -J -R -o custom_esxi.iso -b ISOLINUX.BIN -c c:\esxi\boot.cfg -no-emul-boot -boot-load-size 4 -boot-info-table c:\esxi
3) Burn custom_esxi.iso to disc with any utility. I used the Windows 7 built-in iso burner.


Common Errors:
Not specifying boot.cfg in mkisofs
kernel= must be set in /boot.cfg
Fatal error: 32 (Syntax)
Using imgburn
“No DEFAULT or UI configuration directive found”
OR
ata-pata.v00 not found

ks.cfg was not capitalized in isolinux.cfg
cannot find kickstart file on cd-rom with path -- /ks.cfg

2010-12-20

Patching ESXi single host

For ESXi 4.0 and below, patching can be done with vSphere Host Update Utility.

For ESXi 4.1, vSphere Host Update Utility is no longer supported. Patch using command line:

1) Download patch bundles from VMware's support website: www.vmware.com/patch/download/

2) Upload the patch bundles to your datastore. (You can use vSphere client to do this.)

3) Put the ESXi host into maintenance mode.

4) SSH into the ESXi box. This blog shows how to enable SSH on ESXi 4.1.

5) CD to the datastore and use esxupdate --bundle to patch ESXi:
cd /vmfs/volumes/datastore0/patches
esxupdate --bundle ./ESXi410-201011001.zip update