vSphere / Lab For Beginners: Part 1 – Installing ESXI To USB

This post is all about how to install the first part of any vSphere / HomeLab setup.  the basic ESXi client.  It’s intended for beginners who haven’t used vSphere before or those who know a little but are installing on their own for the first time.

Assumptions

This guide assumes that you’re installing on to a physical piece of hardware that will boot from a USB key. Although the process is pretty much the same for SD cards, local storage etc).  It also assumes that you’re installing from an ISO image and no optical drive.

All software used in this guide can be obtained with a free trial licence so you get going  quickly and have a limited playa round.

For advice on choosing hardware suitable for a lab or test environment check out the Open Home Lab project (community run) or ‘Part 0’ of this series for information on the kit this lab weas built on.

Note: This guide was based off vSphere 6.0 however.  This processw is the same for vSphere 6.5 based installs of ESXi.  Differences are called out and noted.

What You’ll Need

For this part of the guide you’ll need:

  • Aa blank USB key (8GB or more, 16GB recomended [for logs])
  • An installed copy of VMware Workstation (Windows) or Fusion (Mac)
  • An ESXi Install.iso image
  • Some shared storage (iSCSI via a NAS shown in guide).
    • any NFS share would also be viable but not shown here.
  • 2 x ‘computers’ to act as hosts for ESXI and run our workloads
    • These will run ESXi from USB.

Trial versions of the software can be downloaded form VMware’s website.

What Are We Going To Do?

The aim here is to install ESXi 6.0 (the beating heart of vSphere) on to a USB stick and then get our hosts to boot  ESXi from that.  We’re then going to set the hosts up so they can communicate and have access to some shared storage.  Then they will be ready to run VMs.

Step 1: Create a Blank VM In Workstation

Open up VMware Workstation and create a new VM  from File > New Virtual Machine.  This bring up a handy Wizard.

SnapCrab_NoName_2016-6-9_16-38-43_No-00

Workstation provides an option to attach an ISO to a new VM and boot straight to it when it’s created.  This is perfect for Installing ESXi as, with a few clicks, we’ll have the installer booted and ready to go without any faff!.

Select Installer disc image (.iso): as the option and then browse to the ESXi .iso file you have downloaded from VMware. It’ll probably have an unfriendly name. e.g. VMware-VMvisor-Installer-6.0.0.update02-3620759.x86_64.iso. Click Next.

SnapCrab_NoName_2016-6-9_16-39-2_No-00

Now name the VM something friendly (its not being kept so dont worry too much). and, if you can, make the location somewhere fast and local to speed up install times.  Click Next.

SnapCrab_NoName_2016-6-9_16-39-30_No-00

This VM isn’t going to do much apart from boot an ISO image (we’re installing to USB remember) so make the disk size 2GB and click Next.

SnapCrab_NoName_2016-6-9_16-39-43_No-00

Make sure you tick the Power on this VM after createion option and click Finish.

SnapCrab_NoName_2016-6-9_16-39-54_No-00

The VM used to boot the ESXi installer will now be created, turn itself on, and then load the installer program.  Probably less than 30 seconds!.

Step 2: Install ESXi to USB Stick

When you open a console to you’re VM you should probablu see something like this.  Notice there is a countdown timer so, if you’ve been a biy slow, the default option will already have been selected for you…

SnapCrab_NoName_2016-5-24_11-37-58_No-00

Once you’ve selected you want to install ESXi you’ll be presented with a chance to back out.  Don’t! Go forth and install (Enter).

SnapCrab_NoName_2016-5-24_11-40-19_No-00

Before you go any further you’ll want to ensure that you’ve plugged in your USB key that you with to install ESXi on to and connected it to the VM via VM > Removable Devices > [Your USB Drvice] > Connect.USB Connect

Accept the EULA, you know there’s nothing important contained in it right? (Press F11).

SnapCrab_NoName_2016-5-24_11-40-36_No-00

Now you have to start paying attention.  Use the cursor keys to select the USB key from the list If it’s not shown check that you’ve connected the key to the host via the VM menu. Press Enter.

SnapCrab_NoName_2016-5-24_11-40-59_No-00

The installer will now scan the disk to see if it’s blank or already has something on it.  Wait a few moments.

SnapCrab_NoName_2016-5-24_11-41-18_No-00

In My case I already had ESXi installed on this USB stick so I got the warning shown below (sorry about that).  I chose Install as I wanted to show this as if it were a blank drive going forward.

SnapCrab_NoName_2016-5-24_11-41-55_No-00

You should now select a keyboard layout.  Ensure you get this right as it’s a total pain if you set a password down the line and then change the keyboard layout. Press Enter.

SnapCrab_NoName_2016-5-24_11-42-13_No-00

Now enter a password for the root account.  This should be secure as it give total access to ESXi. Press Enter.

SnapCrab_NoName_2016-5-24_11-42-36_No-00

ESXi will now do some checks to work out what it needs to configure during the install. Just wait a moment.

SnapCrab_NoName_2016-5-24_11-42-51_No-00

Now is your final choice to back out.  Check it’s going to install to the correct device (you memorised the HBA number from earlier right?).  Press F11 to begin the install.

SnapCrab_NoName_2016-5-24_11-44-19_No-00

The isntall will begin and progress will be shown.  It only takes about 10 mins to a normal (slow) USB stick.

SnapCrab_NoName_2016-5-24_11-44-29_No-00

At the end of the process you’ll be greeted with a success screen as shown below. Remove your USB key and turn off the VM in workstation.  You don’t need to press Enter to reboot as we’re done with the VM now.  We just care about the contents of the USB stick.

SnapCrab_NoName_2016-5-24_11-51-9_No-00

Step 3: Booting ESXi and Initial Configuration

NOTE: Going forward I’m using a host with no monitor attached.  Instead I have an Intel vPro CPU installed allowing me to use Intem AMT KVM to view the servers boot process.  If you’re intalling to a regular computer ensure you can see the servers output and have a working keyboard to hand before continuing.

NOTE: Most systems are not set to boot from USB by default.  You should chnage the boot priotory in your systems BIOS / UEFI at this point.

Insert the USB key in to your server / computer / host / PC and power it on.  ESXi will load (take about 10 mins) and then will present you with a screen as shown below.

SnapCrab_NoName_2016-5-24_14-53-25_No-00

The first thing you must do after installing ESXI is get the basic management network configured.  This is the initial IP  and NIC assignment that ESXi uses to send all traffic between hosts, VMs and your system.  By default it’s set to DHCP and you dont want your IP address changing all the time!

Press F2 to bring up the logon prompt.  Enter root as the username and the password you set in step 2. Press Enter.  If your log on was ucessful nothing wil appear to happen (yes really).  Press F2 again.

SnapCrab_NoName_2016-5-24_14-53-41_No-00

The system customisation screen will now be displayed.  This is the area that, in the event of a massive SNAFU in configuration you will always come back to in order to fix things (generally networking).

At this stage we are interested in Configuring the Management Network.  So, select this opeion and press Enter.

SnapCrab_NoName_2016-5-24_14-57-9_No-00

This shows the Configure Management Network screen.  We’ll need to configure all of these options but, to start, select Network Adapters. Press Enter.SnapCrab_NoName_2016-6-13_13-30-45_No-00

This is where you can select the NIC that you want to use for the basic management network.  You can select more than one for failover if required but advanced configiuration is far easier from within Virtual Center (covered later).

In this example there are three NICs in my host (onboard lan and an intel Dual port PT adapter [the onces labelled “J6B2….”).  Select the most appropriate one for your system. Press Enter to return to the Configure Management Network screen.

SnapCrab_NoName_2016-5-24_15-1-40_No-00

Now select IPv4 Configuration. Press Enter.  This brings up the network settings screen for the NIC assigned to the management network (previous step).  As noted when we booted the host this will be set to DHCP as default.  It is recomended to change this to static and then configure the network settings based on your environment.

The example below shows my setup.  Press Enter. You will rturn to the Configure Management Network screen.

SnapCrab_NoName_2016-5-24_15-1-55_No-00

Select IPv6 Configuration and disable IPv6 (restart required).  I’m doing this to simplify things later on and remote and long format IPv6 addresses from troubleshooting steps.  If you want to use IPv6 there is no reason why you can’t leave it on. Press Enter. You will return to the the Configure Management Network screen.

SnapCrab_NoName_2016-5-24_15-2-5_No-00

Select DNS Configuration and enter information relevent for your network.  In the example below the primary and secondary DNS entries are my Acrive Directory servers.  It’s crucial that the primary DNS server actually EXISTS at this point.  So, in your environment this may be your internet router.  You should also set the Hostname at this point.  Press Enter.  You will return to the Configure Management Network screen.

SnapCrab_NoName_2016-5-24_15-2-24_No-00

Select Custom DNS Suffixes and enter the suffix you are creating for your lab.  This doesn’t have to exist at the moment but if you’re planning on building a domain on the lab enter here what you’re calling the domain.  In my case lab.local. Press Enter.  You will return to the Configure Management Network screen.

SnapCrab_NoName_2016-5-24_15-2-57_No-00

Now we have finished configuring the Management Network. Press Escape and the following confirmation should appear.  Press Y to reboot the ESXi host.

NOTE: If you chose to leave IPv6 ENABLED you will simple be asked to Restart the Management Network.  Again, press Y and wait a second.

SnapCrab_NoName_2016-5-24_15-3-13_No-00

The host will now restart (a process that takes about 10 mins

SnapCrab_NoName_2016-5-24_15-3-23_No-00

Once the host has rebooted you wil have to log in again to be presented witht he main options screen.  We’re going to skip over some of the options here  as they relate to tests or service restarts.  Select Troubleshooting Options. Press Enter.

SnapCrab_NoName_2016-5-24_14-57-9_No-00

This display the Troubleshoting Mode Options screen.  Select Enable SSH and Press Enter. this allows us to connect to the ESXi host using PuTTY or similar (iTerm on Mac).  This is handy in a lab as it enables cut-paste of commands.

NOTE: This is only being enabled here as we’re building a lab and it’s useful.  This should obviously not be enabled in a production environment unless there is actuall a problem.

Press Esc to return to the main menu and log out.

SnapCrab_NoName_2016-5-24_16-3-6_No-00

This is the basic configuration of ESXi done.  It will now be reachable via https://<IP Address>.  From here you can download the vSphere client for Windows to gain access and install Virtual center.  However, this is useless if you’re on a Mac and the Windows client is going to be replaced soon.  There is a better way….

Step 3: Install the ESX UI Utility

That better way is the ESXi Embedded Host Client.  This is an HTML 5 based management component that isntalls directly on to the host and allows management and configuration of the ESXi hosts from any modern web browser.

NOTE: As of vSphere 6.0U2 this is included as part of the main install and the following step is not technically required.  However, I would always install the latest version and I even came across a bundles version that would not allow me to configure iSCSI until I had upgraded.

Download it here: VMware Embedded Host Client

Essentially, this is a plug-in for ESXi.  These are known as “VIBs” (vSphere Installation Bundle).  Once You’ve downloaded the file and extracted it we need to install it.  The easiest way to do this is to copy the VIB over to the ESXi host using WinSCP.  Place it in simple to get to location (such as /tmp/).

Now, as we enabled SSH in the previous step we can open a PuTTY session to the esxi host and install the  UI utility.

I ran the command esxcli ssoftware vib install -v /tmp/esxui-signed-3843236.vib

SnapCrab_NoName_2016-5-24_16-15-24_No-00

Output from that command should look something like the screenshot below.

SnapCrab_NoName_2016-5-24_16-16-3_No-00

Once finished you can enter the url https://<IP of ESXi>/ui/ and you’ll get the lovley new html5 interface.  VMware have intimated that this is the way everything is going in the next version of vSphere but, for the moment, this remains an unsupported method of connection.  IMO it works and is FAR better than the old method.

SnapCrab_NoName_2016-5-24_16-20-24_No-00

You’ll want to log in at this point.  Use the username root and the password you set up earlier. Click Login.

SnapCrab_NoName_2016-5-24_16-16-37_No-00

Welcome to ESXi!

SnapCrab_NoName_2016-6-13_16-29-24_No-00.png

Step 4: Configure Time Synchronisation

ESXi and the rest of the vSphere infrastructure relies heavily on time synchronisation for proper and reliable operation.  Becasue of this it should be configured now before anything else is configured.  This needs to done per installed host.

Click  Manage in the left pane under the host and select the system tab and select Time & Date option.  Select Edit Settings.Screen Shot 2016-07-26 at 22.00.20

Select the Use Network Time Protocol option.  Change the NTP service startup policy and NTP servers to as shown below and click Save.

Screen Shot 2016-07-26 at 22.00.55

Back in the main area select the Actions button and expand NTP service option.  Select start.Screen Shot 2016-07-26 at 22.01.19

NTP will now start and time will be configured on the ESXi server.  Repeat for all installed ESXi server you have.

Step 5: Configure Storage

Once we’re at this point we have a functioning ESXi system with networking but we are still missing one crucial piece of the puzzle. Storage!

Note: vSphere shines and is most useful with shared storage (it’s a requirement for anything vaguley real world) but there is nothing to stop you playing around with one host and locak storage.  You just wont be able to do much.

For the lab to be useful we’ll have to configure some shared storage.  You can use a SAN, NFS shares or iSCSI without issue.  For this lab I’m going to be demonstrating iSCSI running from a Synology NAS (DS1513+).  However, if you dont have iSCSI capability use NFS from whatever share you feel like.  I’ll write an NFS section later.  I’m not going to go over how to set up your storage as that is generally device specific.  We are going to start from within the ESXi Host UI and configure from there.

Example Setup Details

Going forward my example setup consists of 4 iSCSI targets each representing a datastore.  These are called Datastore1, Datastore2, Datastore3 and ISO Store.  These reside on A synology NAS presenting iSCSI over 192.168.2.200 (note the different subnet to the management network).  This is to ensure segregation of storage traffic from data traffic.  It also allows me to monitor my system more easily.

iSCSI Configuration Process

Log on to the ESXi UI via the URL https://<IP Address of ESXi>/ui/ log in as root user with the password you set earlier.  On the left pane, select storage.

SnapCrab_NoName_2016-5-24_16-51-17_No-00

In the right hand pane select the Adapters tab and notice that there is only one adapter listed.  This is the USB adapter (if you have a host with a physical HBA this will probably be listed here at this stage, I don’t).  Click the Configure iSCSI item.

SnapCrab_NoName_2016-5-24_16-51-23_No-00

This brings up the screen to configure a new Adapter for iSCSI.  For now Enable iSCSI and click the Save Configuration button.

SnapCrab_NoName_2016-5-24_16-51-29_No-00

Notice that this now adds another adapter in the list.SnapCrab_NoName_2016-6-13_17-30-43_No-00

iSCSI requires a network connection over a vmkernel port to function correctly and, as mentioned at the start, I am running iSCSI on a seperate subnet.  This requires a little network configuration before we start.  Fronm the left pane, select Networking.

SnapCrab_NoName_2016-6-14_9-55-6_No-00

Select the Virtual Switches tab and then click the Add Virtual Standard Switch item.

SnapCrab_NoName_2016-6-14_9-55-15_No-00

Call it something relevent (such as Storage) and select an uplink (NIC).  I’ve chosen the 2nd NIC in my system. leave everything else as standard. Click Add.

SnapCrab_NoName_2016-5-24_16-52-48_No-00

Switch to the Port Groups tab select the new vSwitch and click the Add Port Group item.

SnapCrab_NoName_2016-6-14_9-57-19_No-00

Call this Storage and assign it to the Storage virtual switch.  Click Add.  This essentially, binds the uplink to the portgroup to the switch to create a dedicated path way for storage traffic.

SnapCrab_NoName_2016-5-24_16-54-32_No-00

Finally, we need to create a VMkernel NIC. VMware uses these to pass certain types of traffic within the system.  There is already one created for management by default (called vmk0) but we need to create one for storage traffic.Select the VMkernel NIC’s tab and select the Add VMkernel NIC item.

SnapCrab_NoName_2016-5-24_16-57-13_No-00

Select the Storage Port Group and change the IPv4 Settings to Static.  You’ll need to click the little arrow to actually show the fields to enter the address. Now add in the networking information for the port.  You will need an IP address on the same subnet as the iSCSI storage as well as the subnet information and gateway.  You do not need to specify the type of traffic for the kernel port when configuring for storage.  Click Create.

SnapCrab_NoName_2016-6-14_10-15-22_No-00

Now head back to the storage information by selecting Storage from the left pane.  Select the Adapters tab and select the Configure iSCSI item to bring back up the configuration screen.

SnapCrab_NoName_2016-6-14_10-23-19_No-00

Click the Add Port Binding item in the Network Port Bindings  section and select the storage (vmk1) interface we just created.

SnapCrab_NoName_2016-6-14_10-32-50_No-00

Now select the Add Dynamic Targets from the Dynamic targets section.  Add in the IP address of the iSCSI server.and click Save Configuration.  In my case this is the IP address of the network port on my NAS which handels iSCSI traffic.  The port is default at 3260 inless you’ve configured your iSCSI server with something different.

SnapCrab_NoName_2016-6-14_10-34-18_No-00

Click Save Configuration. VMware should rescan all your adapters and, if configured correctly. you should see your iSCSI LUNS listed in the Devices tab.

SnapCrab_NoName_2016-5-24_17-1-38_No-00

Finally, select the datastores tab and click refresh.  This should refresh the screen and show that there are now datastores available to the ESXi Host.

SnapCrab_NoName_2016-6-14_10-42-0_No-00

Wrap Up

That’s it.  You now have an ESXi host ready to be used for creating VMs and your lab.  At this point I would recomend repeating the steps above for all the other physical hosts you have.  Then you are in the position where you can install Virtual Center and really start to use the softwares power.  I’ve got a sectionon how to isntall  the VCSA in Part 2 of this beginners guide.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s