VCAP5-DCA Objective 9.1 – Install ESXi hosts with custom settings

Knowledge

  • Identify custom installation options
  • Identify ESXi Image Builder requirements

Skills and Abilities 

  • Create/Edit Image Profiles
  • Install/uninstall custom drivers
  • Configure advanced boot loader options
  • Configure kernel options
  • Given a scenario, determine when to customize a configuration

Create/Edit Image Profiles

Official Documentation:

vSphere Installation and Setup Guide, Chapter 6 “Using vSphere ESXi Image Builder CLI”,  page 123.

The ESXi Image Builder CLI is a set of PowerCLI cmdlets that you can use to manage vSphere image profiles and VIB packages, such as driver VIBs and update VIBs. You can also use Image Builder cmdlets to export an image profile to an ISO or offline depot ZIP file that you can use to install ESXi with a customized set of updates, patches, and drivers.
Understanding Image Builder

You can use the vSphere® ESXi™ Image Builder CLI to manage software depots, image profiles, and software packages (VIBs). Image profiles and VIBs specify the software you want to use during installation or upgrade of an ESXi host.
Image Builder Overview

The Image Builder PowerCLI supports management of vSphere image profiles and VIBs.

You can manage VIBs and image profiles with vSphere Image Builder. VIBs are software packages, and image profiles specify a set of software packages. See “Software Depots and Their Components,” on page 124.

You use Image Builder cmdlets for managing the software to deploy to your ESXi hosts in several different scenarios.

Create image profiles foruse by Auto Deploy. Use Image Builder to create an image profile that defines the VIBs that AutoDeploy uses to provision hosts.
Add custom third-partydrivers to existing image

profile and export to ISO.

To add third-party driver or extension custom VIBs to your ESXi hosts, useImage builder to clone the base image provided by VMware, add the custom

VIBs, and export to ISO.

Perform upgrades. If you upgrade from a 4.0 or 4.1 system that includes custom extensions ordrivers, you can use Image Builder to create an image profile that includes the

vSphere 5.0 base VIB and the custom extensions. Export the custom image

profile to an ISO you can install or to a ZIP that you can use with vSphere

Update Manager.

Create custom imageswith reduced footprint. Some customers require a minimal footprint image. These customers can clonethe ESXi base image profile and remove VIBs using Image Builder.

The Image Builder PowerCLI cmdlets take image profiles and VIBs as input and produce different outputs.

Input. Image profiles and VIBs that are located in a software depot are used as inputto PowerCLI cmdlets running on a Windows client.
Output. PowerCLI cmdlets create custom image profiles that can be exported to ISO oran offline depot ZIP file. ISO images are used for installation. The ZIP depot

can be used by vSphere Update Manager or by esxcli software vib

commands to update or install images. Image profiles are also used in vSphere

Auto Deploy rules to specify the software to provision ESXi hosts with.

Image Builder Architecture



Create an Image Profile 

Cloning a published profile is the easiest way to create a custom image profile. Cloning a profile is especially useful if you want to remove a few VIBs from a profile, or if you want to use hosts from different vendors and want to use the same basic profile, but want to add vendor-specific VIBs. VMware partners or large installations might consider creating a profile from scratch.

Administrators performing this task must have some experience with PowerCLI or Microsoft PowerShell.

Prerequisites

  • Install the VMware PowerCLI and all prerequisite software. See “Image Builder Installation and Usage,” on page 130.
  • Verify that you have access to the software depot that contains the image profile you want to clone.
  • If you encounter problems running PowerCLI cmdlets, consider changing the execution policy. See “Using Image Builder Cmdlets,” on page 130.

Procedure

  1. At the PowerShell prompt, add the depot that contains the profile you want to clone to the current session.
Depot Type Cmdlet
Remote depot Run Add-EsxSoftwareDepot -DepotUrl depot_url.
ZIP file
  • Download the ZIP file to a local file path.
  • Run Add-EsxSoftwareDepot -DepotUrl C:\file_path\offlinebundle.zip

The cmdlet returns one or more SoftwareDepot objects.

  1. (Optional) Run the Get-EsxImageProfile cmdlet to find the name of the profile that you want to clone.
    Get-ESXImageProfile
    You can use filtering options with Get-EsxImageProfile.
  2. Run the New-EsxImageProfile cmdlet to create the new profile and use the -CloneProfile parameter to specify the profile you want to clone.
    New-EsxImageProfile -CloneProfile My_Profile -Name “Test Profile 42”
    This example clones the profile named My-Profile and assigns it the name Test Profile 42. You must specify a unique combination of name and vendor for the cloned profile.

Add VIBs to an Image Profile

You can add one or more VIBs to an image profile if that image profile is not set to ReadOnly. If the new VIB depends on other VIBs or conflicts with other VIBs in the profile, a message is displayed at the PowerShell prompt and the VIB is not added.

You can add VIBs from VMware or from VMware partners to an image profile. If you add VMware VIBs, the Image Builder PowerCLI performs validation. If you add VIBs from two or more OEM partners, no errors are reported but the resulting image profile might not work. Install VIBs from only one OEM vendor at a time. 

NOTE You might be able to add VIBs even if the resulting image profile is invalid.

Administrators performing this task must have some experience with PowerCLI or Microsoft PowerShell.
Prerequisites

  • Install the VMware PowerCLI and all prerequisite software. See “Install Image Builder PowerCLI and Prerequisite Software,” on page 130.
  • If you encounter problems running PowerCLI cmdlets, consider changing the execution policy. See “Using Image Builder Cmdlets,” on page 130.

Procedure

  1. Run Add-EsxSoftwareDepot for each depot you want to work with.
Depot Type Cmdlet
Remote depot Run Add-EsxSoftwareDepot -DepotUrl depot_url.
ZIP file
  • Download the ZIP file to a local file path.
  • Run Add-EsxSoftwareDepot -DepotUrl C:\file_path\offlinebundle.zip

The cmdlet returns one or more SoftwareDepot objects.

  1. Run Get-EsxImageProfile to list all image profiles in all currently visible depots.
    Get-EsxImageProfile
    The cmdlet returns all available profiles. You can narrow your search by using the optional arguments to filter the output.
  2. Clone the profile and make changes to the clone if the image profile is read only.
    New-EsxImageProfile -CloneProfile My_Profile -Name “Test Profile 42” Image profiles published by VMware and its partners are read only.
  3. Run Add-EsxSoftwarePackage to add a new package to one of the image profile.
    Add-EsxSoftwarePackage -ImageProfile My_Profile -SoftwarePackage partner-package
    The cmdlet runs the standard validation tests on the image profile. If validation succeeds, the cmdlet returns a modified, validated image profile. If the VIB that you want to add depends on a different VIB, the cmdlet displays that information and includes the VIB that would resolve the dependency. If the acceptance level of the VIB that you want to add is lower than the image profile acceptance level, an error results. Change the acceptance level of the image profile to add the VIB.
  4. (Optional)Change the acceptance level of the image profile if an error about acceptance level problems displays.
    VIB acceptance levels are set during VIB creation and cannot be changed.

The image profile includes the new VIB.

Install/uninstall custom drivers

Official Documentation:

VMware KB 2005205 “Installing async drivers on ESXi 5.0”.
This article provides the different methods for installing asynchronous driver releases on multiple versions of VMware ESXi 5.0, 5.1, and 5.5. For more information about installing a specific async driver release, see the /doc/README.txt file within the async driver release zip file.

Async drivers are developed by third-party vendors and are subjected to the VMware certification process. They are released in a ESXi software package called a vSphere Installation Bundle (VIB). To download async drivers signed by VMware, visit VMware Downloads.
Prior to a new ESXi installation

An ESXi 5.x fresh installation using a CD or ISO does not provide any option to inject an async driver. Instead, you must use Image Builder to inject the async driver into a new CD or ISO image. For more information, see the Using vSphere ESXi Image Builder CLI section of the vSphere Installation and Setup Guide.

Note: These steps are necessary if the async driver is required for the ESXi server to have network connectivity.

To add async drivers to the ESXi installation ISO:

  1. Launch the vSphere 5.x PowerCLI command line.
  2. Download a copy of the ESXi offline bundle depot and async driver zip file.
  3. Extract the contents of the async driver zip file and identify the offline-bundle.zip files(s).
  4. Use the Add-ESXSoftwareDepot commandlet to add both the ESXi offline bundle and async offline bundle as depots.
    For example:
    Add-EsxSoftwareDepot C:\path\to\new-async-driver-offline-bundle.zip, C:\path\to\esxi-offline-bundle.zip
    Example for ESXi 5.0:
    Add-EsxSoftwareDepot C:\path\to\new-async-driver-offline-bundle.zip, C:\path\to\VMware-ESXi-5.0.0-469512-depot.zip
    Example for ESXi 5.0 Update 1:
    Add-EsxSoftwareDepot C:\path\to\new-async-driver-offline-bundle.zip, C:\path\to\update-from-esxi5.0-5.0_update01.zip
    The output appears similar to:
    Depot Url
    ———
    zip:C:\path\to\new-async-driver-offline-bundle.zip?index.xml
    zip:C:\VMware-ESXi-5.0.0-469512-depot.zip?index.xml
  5. Verify that the async driver is now available as a software package.
    For example:
    Get-EsxSoftwarePackage
    The output appears similar to:
    Name Version Vendor Release Date
    ——————- ——- ———- ————
    driver-package-name 1.2.3.4 vendorname mm/dd/yyyy
  6. Clone an existing image profile:
  7. Use the Get-EsxImageProfile commandlet to list available image profiles.
    For example:
    Get-EsxImageProfile
    The output appears similar to:
    Name Vendor Last Modified Acceptance
    ————————– —— ————- —————
    ESXi-5.0.0-456551-standard VMware mm/dd/yyyy PartnerSupported
    ESXi-5.0.0-456551-no-tools VMware mm/dd/yyyy PartnerSupported
  8. Clone an existing available image profile by specifying a new name for the profile.
    For example:
    New-EsxImageProfile -CloneProfile “ESXi-5.0.0-456551-standard” -name “NewAsyncProfile” -Vendor “MyCorp”
    The output appears similar to:
    Name Vendor Last Modified Acceptance Level
    ————— —— ————- —————-
    NewAsyncProfile MyCorp mm/dd/yyyy PartnerSupported
  9. Use the Add-EsxSoftwarePackage commandlet to add the async driver to the new image profile, specifying the package name from step 5.
    For example:
    Add-EsxSoftwarePackage -ImageProfile “NewAsyncProfile” -SoftwarePackage “driver-package-name”
    The output appears similar to:
    Name Vendor Last Modified Acceptance Level
    ————— —— ————- —————-
    NewAsyncProfile VMware today PartnerSupported
  10. Export the new image profile. Run the Export-EsxImageProfile command to export the image profile as an ISO.
    For example:
    Export-EsxImageProfile -ImageProfile “NewAsyncProfile” -ExportToISO -filepath C:\NewAsyncProfile.iso
  11. If necessary, burn the ISO to a new CD. Use the CD or ISO to boot the server and install ESXi. Follow the normal installation procedures.

Existing ESXi installation using esxcli and offline bundle async driver zip file

You can install async drivers on an existing ESXi host from a specific VIB file, from a depot URL, from an offline bundle, or using an image profile. For more information, see Upgrading and Migrating Your Hosts – Performing the Upgrade or Migration in the vSphere Upgrade Guide.

The offline bundle zip file is copied to the ESXi host using the datastore browser, and is installed using the esxcli utility in the ESXi shell.

Note: This requires remote ESXi network connectivity using the vSphere Client.

To install the async drivers:

  1. Extract the contents of the async driver zip file.
  2. Identify the offline-bundle.zip file(s).
  3. Log into the ESXi host using the vSphere Client with administrator privileges, such as root.
  4. Using the Datastore Browser, upload the offline-bundle.zip file(s) to an ESXi host’s datastore.
  5. Enter the host into maintenance mode.
  6. Log in as root to the ESXi console through SSH or iLO/DRAC.
  7. Copy the offline-bundle.zip to /var/log/vmware folder by running the below command
    cp offline-bundle.zip /var/log/vmware
  8. Run this command to install drivers using the offline bundle (this requires an absolute path):
    esxcli software vib install –d /path/offline-bundle.zip
    For example:
    esxcli software vib install –d /var/log/vmware/offline-bundle.zip
    Note: If this command fails, unzip the file and try running the same command. Use localcli instead of esxcli if the hostd is not responding.
    For example
    localcli software vib install –d /var/log/vmware/offline-bundle.zip
  9. Reboot the ESXi host.
  10. You can run the below command to confirm that the VIB is installed successfully or not
    esxcli software vib list | grep -i <vib_name>
  11. Exit maintenance mode.

Note: An ESX host can be updated remotely using the esxcli utility, which is part of the vSphere CLI. For more details on using esxcli, see the vSphere Command-Line Interface Documentation page.

Existing ESXi installation using esxcli and async driver VIB file

You can install async drivers on an existing ESXi host from an async driver VIB file. The VIB file is copied to the ESXi host using the datastore browser, and installed using esxcli in the ESXi shell.

Note: This requires remote ESXi network connectivity using the vSphere Client.

To install the async drivers:

  1. Extract the contents of the async driver zip file.
  2. Identify the offline-bundle.zip file(s).
  3. Extract the contents of the offline-bundle.zip file(s).
  4. Identify the async-driver.vib file(s).
  5. Log into the ESXi host using the vSphere Client with administrator privileges, such as root.
  6. Using the Datastore Browser, upload the async-driver.vib file(s) to an ESXi host’s datastore.
  7. Enter the host into maintenance mode.
  8. Log in as root to the ESXi console through SSH or iLO/DRAC.
  9. Run this command to install drivers from the VIB file (this requires an absolute path):
    esxcli software vib install –n /path/async-driver.vib
    For example:
    esxcli software vib install –n /vmfs/volumes/datastore/async-driver.vib
    Note: Use localcli instead of esxcli if the hostd is not responding. For example
    localcli software vib install –n /vmfs/volumes/datastore/async-driver.vib
  10. Reboot the ESXi host.
  11. To confirm if the VIB is installed successfully, run the command:
    esxcli software vib list | grep -i vib_name
  12. Exit maintenance mode.

Note: An ESX host can be updated remotely using the esxcli utility, which is part of the vSphere CLI. For more information on using esxcli, see the vSphere Command-Line Interface Documentation page.
Existing ESXi installation using VMware Update Manager

You can install async drivers on an existing ESXi host using VMware Update Manager. For more information, see Using vSphere ESXi Image Builder CLI in the vSphere Installation and Setup Guide.

Note: Async drivers are developed by third-party vendors and are subjected to VMware certification. Third-party vendors provide recommendations/suggestions to upgrade their drivers/firmware for specific versions of ESXi/ESX. Therefore, VMware does not include these async drivers automatically in Update Manager.

To install the async drivers:

  1. Extract the contents of the async driver zip file.
  2. Identify the offline-bundle.zip file(s).
  3. From vCenter Server, go to Home > Update Manager.
  4. Click the Patch Repository tab.
  5. Click the Import Patches link at the top right of the screen.
  6. Click Finish. The async driver is added to the patch repository.
  7. Create a Host Extension baseline and remediate the ESXi host. For more information, see the Update Manager Administration Guide.
  8. Reboot the ESXi host once the remediation is complete.

Note: This guide can be found on the vSphere Update Manager Documentation page.

Configure advanced boot loader options

Official Documentation:

vSphere Installation and Setup Guide, Chapter 4 “Installing, Upgrading, or Migrating Hosts Using a Script”, Section “Enter Boot Options to Start an Installation or Upgrade Script”, page 48.

You can start an installation or upgrade script by typing boot command-line options at the boot command line.

At boot time you might need to specify options to access the kickstart file. You can enter boot options by pressing Shift+O in the boot loader. For a PXE boot installation, you can pass options through the kernel opts line of the boot.cfgfile. See “About the boot.cfg File,”on page 58 and “PXE Booting the ESXi Installer,”on page 19.

A ks=… option must be given, to specify the location of the installation script. Otherwise, a scripted installation or upgrade will not start. If ks=… is omitted, the text installer will proceed.
Procedure

  1. Start the host.
  2. When the ESXi installer window appears, press Shift+O to edit boot options.


  3. At the run weasel command prompt, type
    ks=location of installation script plus boot command line options

Example: Boot Option

You type the following boot options:

ks=http://00.00.00.00/kickstart/ks-osdc-pdp101.cfg nameserver=00.00.0.0 ip=00.00.00.000 netmask=255.255.255.0 gateway=00.00.00.000

More information:

Configure kernel options

Official Documentation:

vSphere Installation and Setup Guide, Chapter 4 “Installing, Upgrading, or Migrating Hosts Using a Script”, Section “About the boot.cfg File”, page 58.

The boot loader configuration file boot.cfg specifies the kernel, the kernel options, and the boot modules that the mboot.c32 boot loader uses in an ESXi installation.

The boot.cfg file is provided in the ESXi installer. You can modify the kerneloptline of the boot.cfg file to specify the location of an installation script or to pass other boot options.
The boot.cfg file has the following syntax:

# boot.cfg — mboot configuration file

#

# Any line preceded with ‘#’ is a comment.

title=STRING

kernel=FILEPATH

kernelopt=STRING

modules=FILEPATH1— FILEPATH2… — FILEPATHn

# Any other line must remain unchanged.

The commands in boot.cfg configure the boot loader.

Command Description
title=STRING Sets the boot loader title to STRING
kernel=FILEPATH Sets the kernel path to FILEPATH
kernelopt=STRING Appends STRING to the kernel boot options.
modules=FILEPATH1— FILEPATH2… — FILEPATHn Lists the modules to be loaded, separated by three hyphens(—).

Given a scenario, determine when to customize a configuration

Official Documentation:

ESXi can be installed in several ways. To ensure the best vSphere deployment, understand the options thoroughly before beginning the installation.

ESXi installations are designed to accommodate a range of deployment sizes.

Depending on the installation method you choose, different options are available for accessing the installation media and booting the installer.

Interactive ESXi Installation

Interactive installations are recommended for small deployments of fewer than five hosts.

You boot the installer from a CD or DVD, from a bootable USB device, or by PXE booting the installer from a location on the network. You follow the prompts in the installation wizard to install ESXi to disk. See Chapter 3, “Installing ESXi Interactively,”on page 43.
Scripted ESXi Installation

Running a script is an efficient way to deploy multiple ESXi hosts with an unattended installation.

The installation script contains the host configuration settings. You can use the script to configure multiple hosts with the same settings. See Chapter 4, “Installing, Upgrading, or Migrating Hosts Using a Script,”on page 47.

The installation script must be stored in a location that the host can access by HTTP, HTTPS, FTP, NFS, CDROM, or USB. You can PXE boot the ESXi installer or boot it from a CD/DVD or USB drive.

vSphere Auto Deploy ESXi Installation Option

With the vSphere Auto Deploy ESXi Installation, you can provision and reprovision large numbers of ESXi hosts efficiently with vCenter Server.

Using the Auto Deploy feature, vCenter Server loads the ESXi image directly into the host memory. Auto Deploy does not store the ESXi state on the host disk. vCenter Server stores and manages ESXi updates and patching through an image profile, and, optionally, the host configuration through a host profile. You can create image profiles with ESXi Image Builder CLI, and host profiles using the vSphere Client. See Chapter 6, “Using vSphere ESXi Image Builder CLI,”on page 123 and vSphere Host Profiles.

The first time you install a host with Auto Deploy, the host PXE boots and establishes contact with the Auto Deploy server, which streams the image profile and any host profile to the host. The host starts, using the image profile, and Auto Deploy assigns the host to the appropriate vCenter Server system.

When you restart the host, vCenter Server uses the Auto Deploy feature to provision the host with the appropriate image and host profile. If the image profile changes, for example, for an update or patch, the administrator can propagate the change to all hosts that are provisioned with Auto Deploy and managed by a vCenter Server system. This ability makes Auto Deploy an efficient way to provision and reprovision large numbers of hosts, and to enforce compliance to a master ESXi image. See “Understanding vSphere Auto Deploy,”on page 63.
Customizing Installations with ESXi Image Builder CLI

You can use ESXi Image Builder CLI to create ESXi installation images with a customized set of updates, patches, and drivers.

ESXi Image Builder CLI is a PowerShell CLI command set that you can use to create an ESXi installation image with a customized set of ESXi updates and patches. You can also include third-party network or storage drivers that are released between vSphere releases.

You can deploy an ESXi image created with Image Builder in either of the following ways:

  • By burning it to an installation DVD.
  • Through vCenter Server, using the Auto Deploy feature.

See Chapter 6, “Using vSphere ESXi Image Builder CLI,”on page 123 and Chapter 5, “Installing ESXi Using vSphere Auto Deploy,”on page 63.

Other exam notes

VMware vSphere official documentation

VMware vSphere Basics Guide html pdf epub mobi
vSphere Installation and Setup Guide html pdf epub mobi
vSphere Upgrade Guide html pdf epub mobi
vCenter Server and Host Management Guide html pdf epub mobi
vSphere Virtual Machine Administration Guide html pdf epub mobi
vSphere Host Profiles Guide html pdf epub mobi
vSphere Networking Guide html pdf epub mobi
vSphere Storage Guide html pdf epub mobi
vSphere Security Guide html pdf epub mobi
vSphere Resource Management Guide html pdf epub mobi
vSphere Availability Guide html pdf epub mobi
vSphere Monitoring and Performance Guide html pdf epub mobi
vSphere Troubleshooting html pdf epub mobi
VMware vSphere Examples and Scenarios Guide html pdf epub mobi


Related articles:

Disclaimer.
The information in this article is provided “AS IS” with no warranties, and confers no rights. This article does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.

Marco

Marco works for ViaData as a Senior Technical Consultant. He has over 15 years experience as a system engineer and consultant, specialized in virtualization. VMware VCP4, VCP5-DC & VCP5-DT. VMware vExpert 2013, 2014,2015 & 2016. Microsoft MCSE & MCITP Enterprise Administrator. Veeam VMSP, VMTSP & VMCE.