Scripted installation is a new feature for ESXi which is introduced with the release of vSphere 4.1. In this article I’m describing the setup of my home lab in which I use this new feature. Please be advised that this article assumes some basic understanding of Windows and ESX and gives you some guidelines which you can alter for your own specific needs.
There are a few ingredients we need to get this ESXi Scripted Installation to work:
- ESXi Source Repository (HTTP in this article)
- PXELinux
- TFTP Server
- DHCP Server
ESXi Source Repository
1. Install IIS on the Windows Server that will be serving the HTTP repository.
2. Create a ESXi directory in the wwwroot (for example d:\Inetpub\wwwroot\ESXi)
3. Copy all the files from the ESXi ISO to the \ESXi folder (do not copy the .ISO itself but only the files in the .ISO)
4. Start the IIS Manager (Start, All Programs, Administrative Tools, Internet Information Services IIS Manager
5. Right-click the “Default Website” and select “Properties”
6. Click on the “HTTP Headers”-tab and select “MIME Types”
7. Click “New” and Add:
- Extension: *
- MIME Type: All
8. Now Click OK, OK, OK and exit the IIS Manager
PXELinux
1. Create a PXEboot directory (e.g. d:\PXEboot)
2. Create a subdirectory called ESXi (e.g. d:\PXEboot\ESXi)
3. Download and place pxelinux.0 in the d:\PXEboot
4. Copy the 8 files listed below from the ESXi ISO to the d:\PXEboot directory
- cim.vgz
- ienviron.vgz
- install.vgz
- mboot.c32
- menu.c32
- sys.vgz
- vmkboot.gz
- vmkernel.gz
5. Create the directory d:\PXEboot\pxelinux.cfg
6. Copy the isolinux.cfg from the ESXi ISO to d:\PXEboot\pxelinux.cfg (please note that this is a directory)
7. Open the d:\PXEboot\pxelinux.cfg\isolinux.cfg with Notepad++ or VIM (or any other tool that doesn’t cause the line feed/carriage return problem with Linux files) and make the following adjustments:
- Add the IIS directory name in front of all 8 file references (so in this case “ESXi/”)
- Add “ks=http://x.x.x.x/ESXi/ks.cfg” (if you want an interactive installation, skip this line)
- Additionally more bootstrap commands can be added as part of the “ks=…” line, see the ESXi Installable and vCenter Server Setup Guide (page 41)
8. Save the file
9. Rename the file to default (make sure it has got no file extension)
Alternately you can also use the following naming convention which is described in the ESXi Installable and vCenter Server Setup Guide (page 33)
Filename for the PXE Configuration File
For the filename of the PXE configuration file, choose one of the following:
- 01-mac_address_of_target_ESXi_host. For example, 01-23-45-67-89-0a-bc
- The target ESXi host IP address in hexadecimal notation.
- defaultThe initial boot file, pxelinux.0 (or gpxelinux.0) tries to load a PXE configuration file. It tries with the MAC address of the target ESXi host, prefixed with its ARP type code (01 for Ethernet). If that fails, it tries with the hexadecimal notation of target ESXi system IP address. Ultimately, it tries to load a file named default.
10. Create the d:\Inetpub\wwwroot\ESXi\ks.cfg file (this is the Kickstart Script which contains the installation details)
11. Open the ks.cfg with with Notepad++ or VIM and add the following lines to it (which need to be altered for your specific needs):
All the available options can be found in the ESXi Installable and vCenter Server Setup Guide (page 41)
TFTP Server
Now it’s time to get the TFTP Server running. You can use your favorite TFTP program or follow the instructions on this site
DHCP Server
The last step is to get the DHCP server installed and configured. In my home environment I’ve got an Internet Router which acts as DHCP server for my internal network. Since I prefer to use this DHCP server which isn’t capable of DHCP Options I decided to create a secondary DHCP server based on a Windows 2003 Server which is capable of DHCP options.
Please see the overview below to get an understanding of my setup.
I connected this secondary DHCP server to an isolated network within VMware Workstation (vmnet2). Consequently this means that whenever I want to deploy an ESXi Host I first need to attach it to vmnet2 and after deployment I need to change it to the bridged network.
1. Install the DHCP Service.
2. Create a DHCP Scope and active it.
3. Right-click Scope Options and select “Configure Options”
4. Scroll down the Available Options and configure
- 066 Boot Server Host Name with your DHCP Server IP address
- 067 Bootfile Name with pxelinux.0 (we placed this file earlier on in the d:\PXEboot directory)
Test the Scripted Installation
It’s now time to test the scripted environment by starting your Target ESXi Host, if PXE works it will show the screen below where it will start downloading the source files.
Current Scripted Installation Limitations
Please note the current limitations of Scripted Installations:
As outlined in this VMware KB article.
The post Setting up vSphere ESXi 4.1 Scripted Installation appeared first on VirtualKenneth's Blog - hqVirtual | hire quality.