Category Archives: VMware

Intel NUC As A ESXi Host (part 4)

Introduction

My home lab uses a Synology Diskstation DS1813+ for its iSCSI storage.  It’s used for both the virtual machine storage and any ISO files that I need for the VMs.

 

Table Of Contents

This will be a multi-part post, as it covers a lot of topics…

  1. NUC Specs, and build information,
  2. Building a custom ESX image that includes drivers for the NUC’s network card and SSD,
  3. DHCP, PXE booting and automatic installation scripts,
  4. Synology configuration for VMware datastores,
  5. Networking, VLANs and getting it to work,
  6. Installing ESXi
  7. Any other configuration,
  8. Final (random) thoughts.

 

Synology Configuration

Within the Synology DSM, open Storage Manager, and select iSCSI LUN. Click Create and follow the wizard to create a new LUN and iSCSI Target for your VMware datastore.

Syno-iSCSI-1   Syno-iSCSI-2   Syno-iSCSI-3   Syno-iSCSI-4

 I have two LUNs and Targerts configured…

  • Data – 2Tb for all the virtual machines,
  • ISOs – 690Gb for any ISO images

 storage

 

 

 

Intel NUC As A ESXi Host (part 3)

Introduction

In this part, we’ll look at the settings need to get your NUCs to automatically install and configure.

 

Table Of Contents

This will be a multi-part post, as it covers a lot of topics…

  1. NUC Specs, and build information,
  2. Building a custom ESX image that includes drivers for the NUC’s network card and SSD,
  3. DHCP, PXE booting and automatic installation scripts,
  4. Synology configuration for VMware datastores,
  5. Networking, VLANs and getting it to work,
  6. Installing ESXi
  7. Any other configuration,
  8. Final (random) thoughts.

 

Requirements

You will need a server that can handle TFTP and Web requests.  Since I am using a Synology Diskstation for my iSCSI storage needs, this can also handle both TFTP and Web.  If you don’t have a TFTP server, you can use the free TFTP tool from SolarWinds.

 

DHCP Settings

In order for PXE booting to work, you need to create an entry in your DHCP server for the NUCs, and make sure the PXE settings are correct.  I already have a Windows 2008 R2 server running DHCP for my home network, so these steps will reflect this.  Most home routers should allow you to add the two required setings.

In your DHCP Scope Options window, add the following two options…

  • Option 66 : Boot Server Host Name – Add the name of IP of your TFTP server
  • Option 67 : Bootfile Name – enter “pxelinux.0

While you are in your DHCP settings, add an IP reservation for your NUCs.  This will help with the auto configuration later.  To do this, you will need IP addresses that is not being used, and should ideally be outside your DHCP Scope.  You will also need the MAC addresses from the bottom of your NUCs.

You will also need to give your NUCs a name.  I have gone for the simple route of calling them ESX1, ESX2 and ESX3.

 

TFTP Server / PXE Booting

Now that your have your DHCP setup, we can extract the files from the ISO image we created in Part 2.   Extract them to a know location, and setup your TFTP server to point to these files.

Once extracted, you should have two folders called efi and upgrade.  There should also be about 90 files in the root.   Create a new folder called pxelinux.cfg and create a plain text file called default (no file extension)

Copy and paste the following into the default file…

DEFAULT menu.c32
MENU TITLE ESXi-5.5 Boot Menu
NOHALT 1
PROMPT 0
TIMEOUT 20
LABEL install
KERNEL mboot.c32
APPEND -c boot.cfg
APPEND ks=http://[enter-web-server-here]/esx-auto-build.cfg
MENU LABEL ESXi-5.5 ^Installer
LABEL hddboot
LOCALBOOT 0x80
MENU LABEL ^Boot from local disk

Make sure you enter the name or IP address of your web server in the correct place.  Don’t change anything else, unless you really have to.

The last remaining file is called pxelinux.0.  To be honest, I can’t remember where I got this from, but it’s required and important.  To download file file, unzip it and copy it to the same TFTP folder as the ISO files.

 

Automatic Installation Script

The installation script is a large file that automates the configuration of ESXi once it has been installed.  I have separated this script out to another blog post as it would make this page very long indeed.

Intel NUC As A ESXi Host (part 2)

Introduction

This is part two is the continuing saga of my home lab build.

 

Table Of Contents

This will be a multi-part post, as it covers a lot of topics…

  1. NUC Specs, and build information,
  2. Building a custom ESX image that includes drivers for the NUC’s network card and SSD,
  3. DHCP, PXE booting and automatic installation scripts,
  4. Synology configuration for VMware datastores,
  5. Networking, VLANs and getting it to work,
  6. Installing ESXi
  7. Any other configuration,
  8. Final (random) thoughts.

 

Building A Custom ESXi Installation Image

This is actually the easy part.  I use the fantastic ESXi-Customizer-PS PowerShell script from Andreas Peetz at the v-front blog.  This script does all the hard work of downloading the latest version of ESXi and saving it as a ZIP file.  You can then run the script again to convert the ZIP file into an ISO and inject the required drivers.

Before you start, make sure you have installed the latest version of the VMware PowerCLI software on a Windows XP or better PC, and have downloaded Andreas script.

Steps Required

  1. Open the VMware vSphere PowerCLI window (there should be an icon on your desktop),
  2. Change to the folder you copied ESXi-Customizer-PS.ps1 script,
  3. Run the following command…
.\ESXi-Customizer-PS.ps1 -v55 -ozip

ESXi-Customizer-PS-1

  1.  When complete, run this command…
.\ESXi-Customizer-PS.ps1 -vft -load sata-xahci,net-e1000e -izip [filename-downloaded-above]

ESXi-Customizer-PS-2

  1.  When complete, you will have a single ISO image and the downloaded ZIP file, called something like this…

ESXi-Customizer-PS-3

This process will take a few minutes, depending on the speed of your internet link and the computer you are running this on.  The ISO should contain the two drivers required for the NUCs, and will be ready to go to install on your NUCs

 

There are a few ways to install ESXi on to your NUCs, the way I do it is to use PXE booting.  This allows me to plug in a new NUC and switch it on.  Almost everything else is automated.

Intel NUC As A ESXi Host (part 1)

Introduction

D54250WYKWhen deciding on my home lab, I wanted something small, quiet and powerful.  Fortunately, the Intel NUC fits that bill for me.  It’s not a perfect option, as they only have one network port and are limited to 16Gb RAM.

The configuration I am using here may not be the best, it may not even be right for you – but it works for me and I am happy with it.  If you like to add your thoughts or comments, please do.

 

Table Of Contents

This will be a multi-part post, as it covers a lot of topics…

  1. NUC Specs, and build information,
  2. Building a custom ESX image that includes drivers for the NUC’s network card and SSD,
  3. DHCP, PXE booting and automatic installation scripts,
  4. Synology configuration for VMware datastores,
  5. Networking, VLANs and getting it to work,
  6. Installing ESXi
  7. Any other configuration,
  8. Final (random) thoughts.

 

NUC Specs

The following list shows the components I have for each of my three NUCs…

  • Intel Wilson Canyon NUC D54250WYK – Link
  • Crucial 8GB DDR3 PC12800-1600MHz SoDimm
  • Intel 30GB 525 Series SATA 6GB/s 25nm mSATA SSD

 

The install of VMware ESXi doesn’t take up much space, so a 30Gb SSD is fine for my needs.  If you want to install Windows or Linux on it at a later date, you might want to invest in a larger drive.  Some models of NUC are built to hold a 2.5inch drive at the bottom, so this may be another option for you.

 

Since the NUC will take a maximum of 16Gb of RAM, we might as well take it all.  Male sure you use the correct RAM for the model you are buying.  For the one I am using, the RAM has to be the 1.35 volts type.

 

Once your NUC is built, we need to create an installation image to put on it.

Don’t forget however, make sure you download and install the very latest BIOS update for your particular NUC model.  For the three NUCs I have, the download page is here.

ESX Auto Build Script

Introduction

As part of my Intel NUC As A ESXi Host series, the following script helps to automate almost all the configuration steps needed for me to quickly provision a new NUC server, or to rebuild an existing one.

It performs the following basic steps…

  • Set root password,
  • Enables the ESXi SSH Shell, and disables the warning associated with it,
  • Renames the local datastore name to be “Local – [hostname]“,
  • Sets up all the networking virtual switches and VLANs that I need,
  • Enables vMotion,
  • Enables and configures the software iSCSI adapter,
  • Puts the host into maintenance mode before the final reboot

I’ll go through the script in detail below.

 

The Script

vmaccepteula
rootpw [enter-password-here]
keyboard 'United Kingdom'
install --firstdisk --overwritevmfs
network --bootproto=dhcp
reboot

%firstboot --interpreter=busybox

# Enable & start remote ESXi shell
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh

# Enable & start ESXi shell
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell

# Suppress ESXi shell shell warning and set time-out
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1
esxcli system settings advanced set -o /UserVars/ESXiShellInteractiveTimeOut -i 3600

# Rename local data store
vim-cmd hostsvc/datastore/rename datastore1 "Local - $(hostname -s)"

# Configure networking and disable IPv6
esxcli network ip set --ipv6-enabled=false
esxcli network vswitch standard portgroup add -p "Live" -v vSwitch0
esxcli network vswitch standard portgroup add -p "Private" -v vSwitch0
esxcli network vswitch standard portgroup set -p "Private" -v 42
esxcli network vswitch standard portgroup remove -p "VM Network" -v vSwitch0

# Enable vMotion on adapter
vim-cmd hostsvc/vmotion/vnic_set vmk0

# Enable and configure iSCSI software adapter
esxcli iscsi software set --enabled=true
sleep 5
iscsi_adapter=$(esxcli iscsi physicalnetworkportal list | grep vmhba | awk '{print $1}')
esxcli iscsi networkportal add -A ${iscsi_adapter} -n vmk0
esxcli iscsi adapter set -A ${iscsi_adapter} -a $(hostname -s)
esxcli iscsi adapter param set -A ${iscsi_adapter} -k HeaderDigest -v required
esxcli iscsi adapter param set -A ${iscsi_adapter} -k DataDigest -v required
esxcli iscsi adapter discovery sendtarget add -A ${iscsi_adapter} -a [iscsi-target-address-here]
esxcli storage core adapter rescan -A ${iscsi_adapter}

# Enter maintenance mode, then reboot
esxcli system maintenanceMode set -e true
esxcli system shutdown reboot -d 10 -r "Rebooting"

 

Detailed Line-By-Line Descriptions

  • Line 1 : Accept the VMware End User Licence Agreement
  • Line 2 : Set the master ROOT password for this ESXi host
  • Line 3 : Set keyboard to British English, United Kingdom – the correct type of English.
  • Line 4 : Install ESXi to the first drive, overwriting anything it finds
  • Line 5 : Use DHCP to obtain an IP address for the network
  • Line 6 : Reboot
  • Line 8 : Set the command interpreter to ‘BusyBox’ for the following instructions
  • Line 10-16 : Enable and start SSH and the ESXi Shell
  • Line 18-20 : Disable the SSH warning, and set the shell timeout to 1 hour
  • Line 23 : Rename the local datastore name to “Local – [hostname]”
  • Line 25-30 : Set up networking.  I use two networks…
    • LIVE : For all the virtual machines that are available on my live home network
    • PRIVATE :  For all the virtual machines that are only available to each other, and can’t be accessed from anywhere.
      • This network also uses a different VLAN to help separate the network traffic – VLAN 42.
  • Line 33 : Enable vMotion on the interface
  • Line 35-44 : Enable the software iSCSI adapter and configure it.  Perform a adapter rescan too
  • Line 47 : Put host into maintenance mode
  • Line 48 : One final reboot, ready for homelab production