Project

General

Profile

VMware ESXi » History » Version 10

« Previous - Version 10/23 (diff) - Next » - Current version
Corey Osman, 12/27/2011 10:32 PM


How to Provision a VMware ESXi server using foreman

Although puppet will not run under ESX server we can still use foreman to kickstart the server using PXE.

Summary of what you need to do:
  1. Copy iso contents of ESXi to your media directory
  2. Copy the esx boot files to your tftp directory
  3. Create a ESX Installation Medium in Foreman
  4. Create a ESX operating system in foreman
  5. Create a ESX partition table (optional) template
  6. Create a ESX kickstart template in foreman
  7. Create a ESX pxe or gpxe template for ESX in foreman

Copy iso contents of ESXi to your media directory (example only)
mkdir /mnt/iso1
mkdir -p /var/www/html/repos/vmware/esxi4.1/  
mount -o loop esxi-iso-file.iso /mnt/iso1  (example for RHEL based distros)
rsync -avz /mnt/iso1/ /var/www/html/repos/vmware/esxi4.1/

Copy the esx boot files to your tftp directory (must have all of these)
cp /var/www/html/repos/vmware/esxi4.1/mboot.c32 /var/lib/tftpboot/boot/vmware/
cp /var/www/html/repos/vmware/esxi4.1/vmkboot.gz /var/lib/tftpboot/boot/vmware/
cp /var/www/html/repos/vmware/esxi4.1/vmkernel.gz /var/lib/tftpboot/boot/vmware/
cp /var/www/html/repos/vmware/esxi4.1/sys.vgz /var/lib/tftpboot/boot/vmware/
cp /var/www/html/repos/vmware/esxi4.1/cim.vgz /var/lib/tftpboot/boot/vmware/
cp /var/www/html/repos/vmware/esxi4.1/ienviron.vgz /var/lib/tftpboot/boot/vmware/
cp /var/www/html/repos/vmware/esxi4.1/install.vgz /var/lib/tftpboot/boot/vmware/

Create the installation medium based on where you put your esx4.1 iso contents
  1. Create new medium
  2. vmware
  3. path: http://192.168.1.88/repos/vmware/esxi$version/ (example only)
  4. OS: ESXi4.1 (can define later after making operating system)

Create a ESX operating system in foreman (Example only)
  1. More-->Operating Systems-->New
  2. Name: ESXi
  3. Major: 4
  4. Minor 1
  5. OS Family: Redhat (there is no vmware yet)
  6. Arch: x86_64
  7. Choose any partition tables if you defined any (can do later)
  8. Choose the vmware installation media (can do later)
  9. Name: esxi4.1 (name whatever you need to)
  10. Operating System: ESXi 4.1
  11. Layout: (Something like the following)
    part '/boot'  --fstype=ext3 --size=1100  --ondisk=mpx.vmhba0:C0:T0:L0
    part 'none'  --fstype=vmkcore --size=110  --ondisk=mpx.vmhba0:C0:T0:L0
    part 'datastore1'  --fstype=vmfs3 --size=9004 --grow  --ondisk=mpx.vmhba0:C0:T0:L0
    virtualdisk 'esxconsole' --size=8004 --onvmfs='datastore1'
    
    part 'swap'  --fstype=swap --size=1000 --onvirtualdisk='esxconsole'
    part '/var/log'  --fstype=ext3 --size=2000 --onvirtualdisk='esxconsole'
    part '/'  --fstype=ext3 --size=5000 --grow --onvirtualdisk='esxconsole'
    

Create a Partition table in Foreman (optional)

Create a ESX kickstart template in foreman
h3. Create a ESX pxe or gpxe template for ESX in foreman