Press "Enter" to skip to content

Objective 9.2 – Install ESXi Hosts Using Auto Deploy

  • Install the Auto Deploy Server

Standalone:

This is located on the vSphere install disk, this can be installed on the vCenter or on a standalone host, Attach media and install.

vCenter Appliance:

Auto Deploy comes pre installed on the vCenter appliance but is disabled by default, Browse to the web management of the vCenter appliance and start AutoDeploy.

autodeploy-c

Next we need to download and setup the Auto Deploy files to a server which has a TFTP server running, I am using “open TFTP server” from sourceforge other people use starwinds free TFTP server that they offer.

Open up the viclient and connect to vCenter from home page select Auto Deploy and download the TFTP boot.zip.

autodeploy-a

Unzip these files into the TFTP directory that you have selected the TFTP server to make available.

autodeploy-b

Next we need to setup DHCP server, you would generally utilise you environments DHCP server, Configure Scope, this scope needs to be configured with option 66 boot server host this is the TFTP server, and 67 this is the file that you want to use. In this case we want to use “undionly.kpxe.vmw-hardwired”

autodeploy-k

Now if you were to boot an ESXi host you should get the below screens, it should be successful apart from saying there is no image available, We are on the right path.

autodeploy-d autodeploy-e

Now we need to add an image to use, download the ESXi 5.x offline bundle which will be used. Connect to the vCenter server with PowerCLI and enter the command:

Add-EsxSoftwareDeport C:\VMware-ESXi-5.1.0-799733.zip

autodeploy-f

Now we can see the image profiles by using the command

Get-EsxImageProfile

autodeploy-g

Now we need to create a rule. I will create a first boot rule and very basic run of the mill AutoDeploy Functionality.

Use the command:

New-DeployRule -Name "firstboot" -Item "ESXi-5.1.0-799733-standard" -Pattern "model=VMware Virtual Platform"

autodeploy-h

It will then complete the upload.

Last but not least we need to add the rule we just created, using the command:

Add-DeployRule -DeployRule firstboot

autodeploy-i

Boot away and the new ESXi should boot up and appear in the vCenter.

autodeploy-j

  • Utilize Auto Deploy cmdlets to deploy ESXi hosts

See the above objective to see some of the cmdlets that are used. to get a full list of deploy commands use the follwoing command:

Get-DeployCommand

autodeploy-l

To ad a slightly more advanced profile over what was done above this is what we would do.

First we need to add another software depot, this is for HA client. IP address is the IP address of your vCenter server.

Add-EsxSoftwareDepot http://10.0.0.11:80/vSphere-HA-depot

Now we want to clone the standard image we created previously:

New-EsxImageProfile -CloneProfile ESXi-5.1.0-799733-standard -Name "ESXiHA"

Now we want to add the HA client software package to the image:

Add-EsxSoftwarePackage -ImageProfile "ESXiHA" -SoftwarePackage vmware-fdm

Now we would want to remove the firstboot deploy rule we setup:

Remove-DeployRule -DeployRule firstboot -Delete

And then create a new rule that will use the new image profile and add the server into a cluster.

New-DeployRule -Name “Production” -Item “ESXiHA”,ESXiLabHostProfile,”ACME Local -Pattern “model=VMware Virtual Platform”

Note – ESXiHA is the image profile, ESXiLabHostProfile is the name of a host profile you setup in vCenter and want applied to the host. AMCE local is the name of the cluster you want the host placed and the pattern is how a host knows if this rule is to be applied, pattern usually would be used with ipv4″<ipaddress range>” I have done the model of the host which is a virtual machine in this case.

Now all that is needed is to activate the rule by adding it:

Add-DeployRule -DeployRule "Production"
  • Configure Bulk Licensing

This is straight out of the vSphere 5 documentation for VMware:

Procedure

1

Connect to the vCenter Server system you want to use and bind the associated license manager to a variable.

Connect-VIServer -Server 192.XXX.X.XX -User username -Password password
$licenseDataManager = Get-LicenseDataManager
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

You can also run a cmdlet that retrieves a cluster to use bulk licensing for all hosts in a cluster, or retrieves a folder to use bulk licensing for all hosts in a folder.

3

Create a new LicenseData object and a LicenseKeyEntry object with associated type ID and license key.

$licenseData = New-Object VMware.VimAutomation.License.Types.LicenseData
$licenseKeyEntry = New-Object Vmware.VimAutomation.License.Types.LicenseKeyEntry
$licenseKeyEntry.TypeId = "vmware-vsphere”
$licenseKeyEntry.LicenseKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
4

Associate the LicenseKeys attribute of the LicenseData object you created in step 3 with the LicenseKeyEntry object.

$licenseData.LicenseKeys += $licenseKeyEntry

5

Update the license data for the data center with the LicenseData object and verify that the license is associated with the host container.

$licenseDataManager.UpdateAssociatedLicenseData($hostContainer.Uid, $licenseData)
$licenseDataManager.QueryAssociatedLicenseData($hostContainer.Uid)
6

Provision one or more hosts with Auto Deploy and assign them to the data center or to the cluster that you assigned the license data to.

7

Verify that the host is successfully assigned to the default license�

XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

.

a

Using a vSphere Client, log in to the vCenter Server system.

b

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/Re-provision ESXi hosts using Auto Deploy

On the first provision you will be required to run through the answer file for the host if host profiles are used, and subsequent re-provisions this will be automatic.

To re-provision an ESXi host using auto deploy is actually just a reboot for a simple re-provision. You can also assign different image profiles or host profiles by using the above PowerCLI commands.

if you require the hosts to be added using FQDN, then DNS will have to be setup with revers look up working, Auto deploy works best with DHCP and this is a simple matter of making reservations and pre filling out DNS with the FQDN.

  • Configure an Auto Deploy reference host

This is basically setting up a host profile for the first host that gets provisioned. when the first host is provisioned set it up like you would any host, by adding or changing:

Firewall rules, networking configuration, NTP servers, syslog, storage configuration basically set this single host up so its ready to be used. Create a host profile from this host.

This is the host profile that you will use for all future AutoDeploy provision hosts for that cluster, this will have to be done for different clusters or configuration that is needed in your environment.

One Comment

  1. Shamsuddin
    Shamsuddin July 31, 2017

    Hi,
    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

Leave a Reply

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

Anti SPAM BOT Question * Time limit is exhausted. Please reload CAPTCHA.