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
Notice the service is stopped and set to manual. Edit this and change to Automatic
To start the service on the appliance directly run the following
>service vmware-rbd-watchdog start
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.
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
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
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
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
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.
Add the offline ESXi image
>Add-EsxSoftwareDepot “file location“
Confirm the upload was successful run
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
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.
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
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”
I then need to apply the rule to make it the active rule set
>Add-DeployRule -DeployRule “deployment”
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
To edit a deployment rule I first run to find the rule I want to change
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”
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.
I then right click the host – Host Profiles – Create Profile from Host
Give the reference profile a name
Once created I can attach the Host Profile to a host or cluster
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
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
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
Now if I browse the following I will see the default ks.cfg file
I open up the default kick start script and add a static IP address and hostname using Notepad ++
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
ESXi will then build following the script. Notice the custom IP address and hostname
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
Once created go to Web Client – Storage – vCenter – datacentre – datastore – Summary and copy the URL to the clipboard, I need the vmfs/volumes/UUID
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
Reboot the host, once it has booted up check the folder and see the scratch has been created in the new folder
To change the system swap I go to Web Client – Host and Clusters – datacentre – cluster – host – Manage – Settings – System – System Swap
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
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
When prompted add the root credentials. Run the following to list available datastores
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“)
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”
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
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
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
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
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