VCAP6-DCV Deployment – Objective 1.1 – Perform Advanced ESXi Host Configuration 13


Main Study Page

Objectives for 1.1 are broke down as the following

  • Configure and Manage Auto Deploy configurations
    • Determine use case for Stateless vs Stateful installs
    • Create / Modify rules and rule sets
    • Create and associate Host Profiles for an Auto Deploy reference host
  • Configure Kernel Boot Parameters for scripted install according to a deployment plan:
    • Modify scripted weasel install (ks.cfg)
    • Create / Modify scripted installation
  • Configure Advanced System Settings according to a deployment plan:
    • Edit System Swap / Scratch Configuration
    • Configure ESXi host to use a central Syslog Server
  • Manage/Edit the Core Dump configuration of an ESXi host

Configure and Manage Auto Deploy configuration

First I will start with the configuration of Auto Deploy.  Auto Deploy in v6 is included with the management node but the service must be started post deployment.  I am using the appliance in my lab, to check the status I open the Web Client – System Configuration – Services – Auto Deploy

autodeploy01

Notice the service is stopped and set to manual.  Edit this and change to Automatic

autodeploy02

To start the service on the appliance directly run the following

>service vmware-rbd-watchdog start

autodeploy03

Now if I browse to Web Client – vCenter Inventory List – vCenter Servers – vCenter – Manage – Settings – Auto Deploy I see the service running along with some settings I can change.  Its worth noting I had trouble enabling the service running on vCenter 6.0 Update 1 after I have changed the VMCA to run as a subordinate CA.  I resolved this by upgrading to v6 Update 2.

autodeploy04

From the same screen I need to download the TFTP pack.  One of the prereqs for Auto Deploy is requirement to use a TFTP server.  For my lab I am using SolarWinds TFTP server.  I install this on a server and create a directory for it to use C:\TFTP.  When downloading the TFTP package from the Web Client I must download it to this directory

autodeploy08

autodeploy05

Another prereq is the requirement for a DHCP server.  Open the DHCP server and change the scope options 066 and 067.  Option 066 requires the IP address of the TFTP server and option 067 requires the boot filename

autodeploy06  autodeploy07

Now if I set a host on my network to PXE boot I can see the host picking up an IP address and talking to the TFTP server but I have yet to upload a ESXi image

autodeploy09

The next step is to install PowerCLI on a management machine.  There are some prereqs for PowerCLI which ill not go into but check the docs for that.  PowerCLI comes with built in Auto Deploy cmdlets so nothing needs adding at this point.  Do a quick Get-DeployCommand to see the available options

autodeploy10

First thing I need to do is upload a ESXi image.  Download an offline version of ESXi from the VMware portal.  I am using v6.0 GA.  Connect to vCenter with an account with the correct permissions.

>connect-VIserver vcenterFQDN

autodeploy11

Add the offline ESXi image

>Add-EsxSoftwareDepot “file location

autodeploy13

Confirm the upload was successful run

>Get-EsxImageProfile

autodeploy14

I now need to create a rule set and associate a host profile but the Auto Deploy infrastructure is ready.


Stateful vrs Stateless

Hosts deployed via Auto Deploy with either stateful deployment or stateless.

Stateful deployments provisions a host and applies a Host Profile to store the ESXi image and config to local disk, once installed the host will boot from disk and no longer require Auto Deploy.

Stateless deployment provisions a host using Auto Deploy and applies a host profile, every boot requires Auto Deploy.  Caching can be configured to allow the host to boot from a cached image should Auto Deploy be unavailable.

To enable stateful or stateless a Host Profile must be configured first.  Edit an existing Host Profile via Web Client – Host Profiles – Edit – Advanced Configuration Settings – System Image Cache Configuration

autodeploy27  autodeploy26


Create / Modify rules and rule sets

Now I have Auto Deploy configured and a Offline ESXi image has been uploaded, I now need to create a deployment rule.  I need to start PowerCLI and connect to the vCenter.

>connect-VIserver vcenterFQDN

As part of the deployment plan it is possible to add the host direct into vCenter after ESXi is installed, this can be an object such as a cluster or folder.  I create a new folder called Staging Host

autodeploy15

Once created I run the following.  I specify the uploaded ESXi image and folder using -Item and specify the IP address of the host using -Pattern.  The pattern can be a range of IPs, MAC address and vendor.

>New-DeployRule -Name “Deployment” -Item “ESXi-image“, “Staging Host” -Pattern “ipv4=192.168.0.100”

autodeploy16

I then need to apply the rule to make it the active rule set

>Add-DeployRule -DeployRule “deployment”

autodeploy17

Now if I PXE boot a new machine it will pick up a DHCP address of 192.168.0.100 and the TFTP details.  My host will then match the deployment rule and the uploaded ESXi image is deployed and added to the folder in vCenter

autodeploy18

autodeploy19

autodeploy20

To edit a deployment rule I first run to find the rule I want to change

>Get-DeployRule

Then to change an item I run the following, I am changing the folder Staging Host to a new cluster object called Deployment Cluster

>Copy-DeployRule -DeployRule nameofrule -ReplaceItem “Deployment Cluster”

autodeploy28

To view the details of a host I can run

>Get-VMHost –nameofhost |fl

For further reference to PowerCLI cmdlets see here


Create and associate Host Profiles for an Auto Deploy reference host

A reference host be be configured with network settings, NTP settings, Syslog settings, Core Dump setup and Security settings.  This reference host can provide a Host Profile to be applied to Auto Deploy stateless deployments.

Set up a host using the usual methods – Web Client / CLI and use that host to create a Host Profile that will be used as the reference.  It is possible to create the Host Profile manually.

As an example I create a very basic host and change the default Virtual Machine Port Group name to Deploy and add a VLAN tag of 99.

autodeploy21

I then right click the host – Host Profiles – Create Profile from Host

autodeploy22

Give the reference profile a name

autodeploy23

Once created I can attach the Host Profile to a host or cluster

autodeploy24

As a test I create a deployment rule and point to Staging Host cluster and attach the Host Profile to the cluster object.

>New-DeployRule -Name “Deployment” -Item “ESXi-image“, “Staging Host” -Pattern “ipv4=192.168.0.101”

Once deployed I can see the Host Profile was compliant and it applied successfully

autodeploy25

You can choose to apply the Host Profile as part of the deployment rule if you wish.  Specific configuration such as static IP addresses can be added using Host Customisation, I will not go into this at this point but if you are studying for the exam I would recommend looking this up see here


Configure Kernel Boot Parameters for scripted install according to a deployment plan

You can start an installation script by typing boot options at the ESXi installer boot command line.  To access this during boot press Shift+O in the boot loader.  For PXE boots the options can be passes through the kernelopts line of boot.cfg I will not cover this here but see here for more information.

Once Shift+O has been select I am prompted for install script location from here I can point to a kick start script on the network or USB.


Modify scripted weasel install (ks.cfg)

It is possible to use a remote kick start script, the install script is a text file that contains supported commands – ks.cfg.  The default ks.cfg file is located in the initial RAM disk /etc/vmware/weasel/ks.cfg.

To create a custom script or modify an existing one supported commands must be used.  To see a list of the supported commands see here for the exam have any idea of these and know where to find them in the docs should you need them.

As a test I call a kick script from a IIS web server.  To be able to do this I first create a folder under the root directory called KickScript.  I have copied the default ks.cfg file to this location

autodeploy30

I also have to add the extension to MIME types.  Open IIS – Sites – Default Web Site – KickStart – MIME Type – Add.  Add the .cfg extension and text/plain MIME type

autodeploy31

Now if I browse the following I will see the default ks.cfg file

http://192.168.0.200/KickStart/ks.cfg

autodeploy32

I open up the default kick start script and add a static IP address and hostname using Notepad ++

autodeploy34

To test I will boot from ESXi media and use the Shift+O open but a PXE boot could be used as well.  Once booted and Shift+O has been selected I add the following

ks=http://192.168.0.200/KickStart/ks.cfg

autodeploy33

ESXi will then build following the script.  Notice the custom IP address and hostname

autodeploy35  autodeploy36


Configure Advanced System Settings according to a deployment plan


Edit System Swap / Scratch Configuration

Setting a scratch partition is important and a regular task should ESXi be installed on media such as SD card.  There are a variaty of methods to set the scratch partition to persistent storage such as shared storage.  I will demonstrate using the Web Client and PowerCLI to set the scratch partition.

First the Web Client I need to create a folder to store the scratch partition.  Open Web Client – Storage – vCenter – Datacentre – datastore – Manage – Files – Add Folder.  I create a folder called .locker-lab-esx01 

autodeploy37

Once created go to Web Client – Storage – vCenter – datacentre – datastore – Summary and copy the URL to the clipboard, I need the vmfs/volumes/UUID

autodeploy38

Now I need to add the location to the host.  Web Client – Host and Clusters – datacentre – cluster – host – Manage – Settings – System – Advanced System Settings – ScratchConfig.ConfiguredScratchLocation – Edit.  Then add the new folder with the datastore UUID

autodeploy39

Reboot the host, once it has booted up check the folder and see the scratch has been created in the new folder

autodeploy40

To change the system swap I go to Web Client – Host and Clusters – datacentre – cluster – host – Manage – Settings – System – System Swap

autodeploy39-1

As the exam objectives point to a deployment plan its important to know how to add these settings to a Host Profile.  Web Client – Host Profiles – profile – Manage – General System Settings – System Swap Configuration

autodeploy48

Another way of doing this is by using PowerCLI, I find this way easier and faster.  Run the following to connect direct to the host

>connect-VIserver esxihostname 

When prompted add the root credentials.  Run the following to list available datastores

>Get-Datastore

I then need to mount the datastore and create a folder called .locker-lab-esxi-02

>New-PSDrive -Name “mounteddatastore” -Root \ -PSProvider VimDatastore -Datastore (get-Datastore “Lab-VMFS-02“)

autodeploy41

>Set-Location mounteddatastore:\

>New-Item “.locker-lab-esxi-02

Once new folder is created I add the location to the host

>Get-VMhost | Get-AdvancedSetting -Name “ScratchConfig.ConfiguredScratchLocation” | Set-AdvancedSetting -Value “/vmfs/volumes/lab-vmfs-02/.locker-la-esxi-02”

autodeploy42

Choose yes to confirm and reboot the host.

VMware has a good KB on each method to change the scratch partition including how to add this step to a kick start script see here.

Its not possible to change the scratch partition using Host Profiles, it is recommended to configure a Syslog server covered in the next section.  VMware have a blog that relates to this here.


Configure ESXi host to use a central Syslog Server

A host can be configured to point to a Syslog Server using various methods the following will show the esxcli commands.  First SSH onto the host and run the following

>esxcli system syslog config set — loghost=’tcp://192.168.0.200:514′

Once added run the following

>esxcli system syslog reload

autodeploy43

It is possible to change the log folder location to shared storage, if this is left blank as in my example and the scratch has been configured the logs will use the configured scratch location.  See VMware KB for other methods such as adding the settings to a host Profile here.

As the exam objectives point to a deployment plan its important to know how to add these settings to a Host Profile.  Web Client – Host Profiles – profile – Manage – Advanced Configuration Settings – Advanced Options – Advanced Configuration Option

autodeploy38-1


Manage/Edit the Core Dump configuration of an ESXi host

A core dump is the state of working memory in the event of a host failure which by default is saved to local disk.  The ESXi Dump Collector can be be used to keep core dumps on the network.

First start the service on the vCenter server.  Web Client – System Configuration – Services – VMware vSphere ESXi Dump Collector.  I start the service and mark it as Automatic

autodeploy44

Then SSH onto a host and run the following to enable

>esxcli system coredump network set –interface-name vmk0 –server-ip vCenterIP –server-port 6500

>esxcli system coredump network set –enable true

To test run

>esxcli system coredump network check

autodeploy45

As the exam objectives point to a deployment plan its important to know how to add these settings to a Host Profile.  Web Client – Host Profiles – profile – Manage – Network Configuration –  Network Coredump Settings

autodeploy46


Leave a comment

Your email address will not be published. Required fields are marked *

13 thoughts on “VCAP6-DCV Deployment – Objective 1.1 – Perform Advanced ESXi Host Configuration

    • Kyle jenner Post author

      Hey David, thanks for the feedback. I have added a software depot for my image and then go on to create deploy rules in a later section. Which part am I missing?

  • Pawel

    Hello Kyle, This is a really good job with the series. I just want to say thank you and let you know that it was very helpful for me during preparation to my exam. Of course I passed the exam. I’m going to share a link to you series on my blog to let more ppl use it.

  • Jitesh

    Hi Kyle
    Is there a pdf version, of your study guide?
    Asking out of curiosity.
    Great job and thank you for all your hard work.
    Really appreciated.j

  • Shamsuddin

    Awesome study material. I am preparing for the exam now and I am using this material for my exam.
    I hope there is no changes in the VCAP6 exam since when u wrote this excellent study material.

          • Shamsuddin

            Ok Thank You for the information. But I have a issue here.
            I have installed and configured autodeploy as u have mentioned in my home lab. The VC is 6.0 and ESXi image is 5.5. Somehow I am getting below error. The client is taking IP and able to connect to TFTP server but it is not taking the image. Could you please help me here.

            tftp://10.10.10.10/tramp………………………connection timed out

  • Oriol

    Many thanks for this guide. Is really clear and helpful.
    Just two little typos:
    -Final “For further reference…here” link is missing on “Create / Modify rules and rule sets” section
    -And on “See VMware KB for other methods such as adding the settings to a host Profile here.” on “Configure ESXi host to use a central Syslog Server” section.

    Thanks again for your job and your time 🙂