Tuesday, August 2, 2011

How to – ESXi installation


How to – ESXi installation


Summary Checklist
  • Check Virtualisation Technology is enabled in the BIOS
  • Download and install latest version of ESXi
  • Patch
  • Configure (static IP, DNS, NTP, vSwitch, root password and license)
  • Install VMA
  • Configure Hardware Health Monitoring
Step 1: Installation:
  • Check that “virtualization technology” is enabled in the BIOS
  • If you need to store files greater than 256GB then I would recommend creating 2 virtual disks in the RAID controller BIOS. One for the OS and one to use as a data store. Note that by default the installation of ESXi will format the virtual disk with a 1MB block size.
  • Remember to check that virtualisation support is enable in the BIOS.
Where possible download the vendors version of ESXi. For example Dell provide their own customized ISO that contains Dell specific settings for SNMP etc.
(Alternatively you can use the Dell Uniform Server Configurator – you will still need the Dell ESXi ISO however.
After downloading the ISO from the Dell Website I have booted the server off it and installed ESXi.
After reboot you will get a screen similar to the below showing the current IP address of the ESXi box. In this case it has picked up an IP address from DHCP.

Step 2 – Patching

I recommend running the VMware vSphere Host Update utility to install the latest patches.

Step 3 – Configure

If you haven’t got the Vmware VI client installed on your PC already you will then want to download the VI client to enable you to manage this server. You can get this by opening a web browser and entering in the IP of the ESXi server (as shown in the diagram above).
Click on the link highlighted above and install the VI client. Note that this downloads the client from the web and not from this server. It may take a few minutes.
Once installed open the vi client and connect to the ESXi server IP as shown below. Note the default username is root with no password.
You may now want to customise your install.

Set static IP:

Note that if the static IP is different you will need to re-launch the vi client and connect to the new IP.

Configure DNS:

Add other NICs to vSwitch:

This will improve performance and add a degree of fault tolerance with the network cards.

Setup NTP:

Note that VMs will likely pickup the time from the ESXi server so it is important the time is correct

Change Root Password:

License VMware:

You will need to Registerwith Vmware and they will email you a license. Once you have this you can enter this on the below screen.

Step 4 – Post Installation

I recommend installing the vMA and setting up hardware monitoring. Please click on the hyperlinks for more information.
Please Click any of the following link

Monitoring Standalone ESX\ESXi Server hardware with the VMA


Monitoring Standalone ESX\ESXi Server hardware with the VMA



The below article explains how to setup a perl script to generate a daily email showing the hardware status of your VMware ESX/ESXi servers. In the below example we are using a VMA to run the perl scripts but you could also do this as a scheduled task on a windows host (with the vmware vsphere client installed)

If you haven’t setup the vMA please see my article on this setup-the-vsphere-management-assistant

Step 1 – Upload the Esx-health.pl script to your VMA server

I currently use the excellent esx-health.pl script originally developed by William Lam with additional modifications from James Pearce.
Cut and paste the code from http://blog.peacon.co.uk/wiki/Esx-health.pl_code into a notepad document and save as Esx-health.pl (Be sure you read and agree to the terms of use.)
Then copy this perl script to your VMA. I use Veeam Backup & FastSCP for this.

Step 2 – Execute code

Connect to the VMA and change to the directory where you copied the Esx-health.pl script
Navigate to the directory where you have copied the perl script and make sure you have execure permissions by entering:
chmod +x Esx-health.pl

Execute the below command:
./Esx-health.pl –server –username root –mailhost –maildomain –mailfrom ESXMonitor@ –mailto
Note – I find issues when pasting hypens (i.e. “-”) if you get an error running this command try deleting and retyping the hypen. Weird but seems to work.
Note that the command is case sensitive
You will be prompted for the password for the ESX server.
You should shortly receive the health check email
If you don’t receive this email then it may be due to the SMTP server not being setup to allow relays from the VMA’s IP

Step 3 – Schedule the script to run

In the below example I am scheduling the perl script to run everyday.
  • Logon to the VMA and enter the command crontab – e
  • Enter the command to run the perl script. The below command will run daily at 08:01
  • 01 08 * * * ./Esx-health.pl –server –username root –password –mailhost –maildomain –mailfrom ESXMonitor@ –mailto
  • Once you have entered this press CTRL + C to exit
  • Then type :wq to save and quit
Note – I haven’t found a way to send to more than 1 email receipient. If you want to send to multiple recipients then I recommend setting up a separate cron job for each
  • You can verify your entry is listed by running crontab –l
Note – To avoid passing the root password in plaintext you can use vifastpass
Please Click any of the following link

Setup the vSphere Management Assistant


Setup the vSphere Management Assistant



The below article describes the initial stpes in setting up a vSpehre Management Asssitant appliance.

Step 1 – Download and Install


  • Go to the Vmware website and download the latest version of the VMA appliance
  • This comes as a .zip file. Extract this file. You should get the files below
  • You can then create the VMA appliance using the .ovf file
  • Once the VMA files have finished uploading to your ESX server you can then power on the newly created VM.
  • Connect to the console of the new VM and run through the various setup options specifying IP addresses etc.

Step 3- Set Time Zone and Keyboard


Use the “date” command to view the current date, time and time zone info. If you need to change these enter the commands

Set Time Zone:
sudo rm /etc/localtime
sudo ln -s /usr/share/zoneinfo/GMT /etc/localtime
(If your timezone is not GMT browse the zoneinfo directory for other timezones)

You can set the time with the below command
Sudo date –set “28 Jan 2010 18:00:00″
(note there is a double hyphen)
Set Keyboard
sudo nano /etc/sysconfig/keyboard
(Choose the appropriate keyboard option – in the below case its “uk”)


Step 3 – Add to Active Directory (optional)


If desired you can add the VMA to your Active Directory Domain. Enter the below on the VMA console
sudo domainjoin-cli join
You will need to reboot

Step 4 – Enable the vi-user account


By default the vi-user account cannot be used until you have specified a password.
sudo passwd vi-user

Step 5 – Add standalone ESX\ESXi server


You can add target servers running virtual centre 4.0 + and ESX\ESXi3.5+
To add a standalone ESX\ESXi server run the below command
vifp addserver
You will be prompted for the root username and password. You can verify the target servers in use with the command
Vifp listservers
Please Click any of the following links