Objective 9.2 – Install ESXi Hosts Using Auto Deploy
For this objective I used the following resources:
- VMware “vSphere Installation and Setup” documentation
Identify Auto Deploy Requirements
Auto Deploy Environment Requirements
- Do not use VLAN tagged networks at the boot NIC
- 2GB of disk space (minimum) for Auto Deploy repository
- DHCP server in the environment
- TFTP server in the environment
- Set up a remote Syslog server (optional). Leverage vSphere Syslog Collector
- Set up ESXi Dump Collector and configure hosts to leverage
- Microsoft .NET 2.0
- Microsoft Powershell 2.0
- VMware vSphere PowerCLI
- Set up a remote Syslog server (optional but recommended). Leverage vSphere Syslog Collector
- Set up ESXi Dump Collector (optional but recommended) and configure hosts to leverage
Skills and Abilities
Install the Auto Deploy Server
Auto Deploy is an installation option included on the vSphere vCenter media. Select “VMware Auto Deploy” from the selection list:
Select the “Setup Language”
Click “Next” on the “Welcome” dialog
Click “Next” on the “End User Patent Agreement”:
Accepted the “End User License Agreement”, click “Next”:
Don’t fall asleep on this screen! Be sure to change the “Auto Deploy repository directory” from the default. In the example I am using D:Depot.
Provide the FQDN of your vCenter server along with administrative credentials:
Leave the default server port and click “Next”:
If you have multiple interfaces on your Auto Deploy server, choose the correct listening IP from the drop down:
Click “Install” to continue:
Select “Finish” to close out the installation:
Auto Deploy is now installed.
Utilize Auto Deploy cmdlets to Deploy ESXi Hosts
At this time the use and configuration of Auto Deploy is completed using vSphere PowerCLI cmdlets. The commands and there uses are listed below:
|Get-DeployCommand||Returns a list of Auto Deploy cmdlets|
|New-DeployRule||Creates a new rule with the specified items and patterns|
|Set-DeployRule||Updates an existing rule with the specified items and patterns. You cannot update a rule that is part of a rule set|
|Get-DeployRule||Retrieves the rules with the specified names|
|Copy-DeployRule||Clones and updates an existing rule|
|Add-DeployRule||Adds one or more rules to the working rule set and, by default, also to the active rule set. Use the NoActivate parameter to add a rule only to the working rule set|
|Remove-DeployRule||Removes one or more rules from the working rule set and from the active rule set. Run this command with the –Delete parameter to complete delete the rule.|
|Set-DeployRuleset||Explicitly sets the list of rules in the working rule set|
|Get-DeployRuleset||Retrieves the current working rule set or the current active rule set|
|Switch-ActiveDeployRuleset||Activates a rule set so that any new requests are evaluated through the rule set|
|Get-VMHostMatchingRules||Retrieves rules matching a pattern. For example, you can retrieve all rules that apply to a host or hosts. Use this cmdlet primarily or debugging.|
|Test-DeployRulesetCompliance||Checks whether the items associated with a specified host are in compliance with the active rule set|
|Repair-DeployRulesetCompliance||Given the output from Test-DeployRulesetComplaince, this cmdlet updates the image profile, host profile, and location for each host in the vCenter Server inventory. The cmdlet might apply image profiles, apply host profiles, or move hosts to prespecified folders or clusters on the vCenter Server system.|
|Apply-EsxImageProfile||Associates the specified image profile with the specified host|
|Get-VMHostImageProfile||Retrives the image profile in use by a specified host. This cmdlet differs from the Get-EsxImageProfile cmdlet in the Image Builder PowerCLI|
|Repair-DeployImageCache||Use this cmdlet only if the Auto Deploy image cache is accidentally deleted|
|Get-VMHostAttributes||Retrieves the attributes for a host that are used when the Auto Deploy server evaluates the rules.|
To deploy an ESXi host via Auto Deploy you need to first create a “Deployment Rule”. A deployment rule is created using the “New-DeployRule” cmdlet:
The above command will create a deployment rule named “AutoDeploy_VCAP” and will use the “VCAP-DCA5” image profile (created in Objective 9.1 HERE) and will apply the rule to “Allhosts” or any ESXi host boots from it.
Next we will create an additional deployment rule to specify a vSphere cluster location to add each host to join:
Using the “Get-DeployRule” cmdlet we can list the newly created deployment rules:
Next, to make the deployment rules active we will create a “Deploy Rule Set”. Using the “Add-DeployRule” cmdlet we will add each of the two deploy rules:
To verify the configuration, issue the “Get-DeployRuleSet” cmdlet:
We are now ready to deploy some ESXi hosts!
Configure Bulk Licensing
Procedure taken from pages 71 through 72 of the VMware vSphere Installation and Setup documentation:
Step 1 – Connect to the vCenter Server system you want to use and bind the associated license manager to a variable
Connect-VIServer –Server <Your Server> –User <Username> –Password <Password>
$licenseDataManager = Get-LicenseDataManager
Step 2 – Run a cmdlet that retrieves the datacenter in which the hosts for which you want to use the bulk licensing feature are located.
$hostContainer = Get-DataCenter –Name Datacenter-X
Step 3 – Create a new LicenseData object and a LicenseKeyEntry object with associated type ID and license key.
$licenseData = New-Object VMware.Vim.Automation.License.Types.LicenseData
$licenseKeyEntry = New-Object Vmware.VimAutomation.License.Types.LicenseKeyEntry
$licenseKeyEntry.TypeId = “vmware-vsphere”
$licenseKeyEntry.LicenseKey = “XXXXX-XXXXX-XXXXX-XXXXX-XXXXX”
Step 4 – Associate the LicenseKeys attribute of the LicenseData object you created in step 3 with the LicenseKeyEntry object
$licenseData.LicenseKeys += $licenseKeyEntry
Step 5 – Update the license data for the data center with the LicenseData object and verify that the license is associated with the host container.
Step 6 – Provision one or more hosts with Auto Deploy and assign them to the data center or cluster that you assigned the license data to.
Step 7 – Verify that the host is successfully assigned to the default license XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
- Using a vSphere client, log in to the vCenter Server System
- Navigate to the Configuration –> License Features tab for the host and check that the correct license is displayed
All hosts that you assigned to the data center are now licensed automatically.
Provision/Reprovision ESXi Hosts Using Auto Deploy
Thought not configured in this objective, prior to attempting to deploy ESXi hosts via Auto Deploy the proper infrastructure/components need to be in place. This includes the setup of DHCP services with reservations and a TFTP server. These concepts are not covered on the exam, but do know they are required to implement Auto Deploy.
To provision an ESXi host with Auto Deploy is pretty straight forward once the infrastructure and deployment rules/rulesets have been created. Be sure that in the BIOS of the server you have configured the boot order to list network first. From there it should go as follows:
You system will PXE boot and via TFTP locate the boot image:
The ESXi installation will begin:
Once the installation has completed you will have a functioning base installation of ESXi:
Configure an Auto Deploy Reference Host
After you have your initial host has been deployed you will want to use that as your “Reference Host”. Since Auto Deployed ESXi hosts run in memory per host setting are not maintained during reboots. In this case you want to leverage “Host Profiles” to save you both time and to have a standard base configuration. On the initial host you will want to configure NTP, syslog, networking, and security settings. Then capture those settings in a Host Profile and create a deployment rule containing the profile.
For further information read pages 79 through 85 of the VMware vSphere Installation and Setup documentation.