TechRant
Installing ESXi Using vSphere Auto Deploy – Section 5
Jan 26, 2014

Preparing for vSphere Auto Deploy – Section 5

 

Before you can start to use vSphere Auto Deploy, you must prepare your environment. You start with server setup and hardware preparation. You must register the Auto Deploy software with the vCenter Server system that you plan to use for managing the hosts you provision, and install the VMware PowerCLI.

 

  • Prepare Your System and Install the Auto Deploy Server: Before you turn on a host for PXE boot with vSphere Auto Deploy, you must install prerequisite software and set up the DHCP and TFTP servers that Auto Deploy interacts with.
  • Install PowerCLI and Prerequisite Software: Before you can run Auto Deploy cmdlets to create and modify the rules and rule sets that govern Auto Deploy behavior, you must install vSphere PowerCLI and all prerequisite software. The Auto Deploy cmdlets are included with the PowerCLI installation.
  • Using Auto Deploy Cmdlets: Auto Deploy cmdlets are implemented as Microsoft PowerShell cmdlets and included in vSphere PowerCLI. Users of Auto Deploy cmdlets can take advantage of all PowerCLI features.
  • Set Up Bulk Licensing: You can use the vSphere Client, the vSphere Web Client or ESXi Shell to specify individual license keys, or you can set up bulk licensing by using PowerCLI cmdlets. Bulk licensing works for all ESXi hosts, but is especially useful for hosts provisioned with Auto Deploy.

 

Prepare Your System and Install the Auto Deploy Server

 

Before you turn on a host for PXE boot with vSphere Auto Deploy, you must install prerequisite software and set up the DHCP and TFTP servers that Auto Deploy interacts with.

 

Prerequisites

  • Ensure that the hosts that you will provision with Auto Deploy meet the hardware requirements for ESXi 5.1.

 

*** NOTE: You cannot provision EFI hosts with Auto Deploy unless you switch the EFI system to BIOS compatibility mode. ***

 

  • Ensure that the ESXi hosts have network connectivity to vCenter Server and that all port requirements are met.
  • If you want to use VLANs in your Auto Deploy environment, you must set up the end to end networking properly. When the host is PXE booting, the UNDI driver must be set up to tag the frames with proper VLAN IDs. You must do this set up manually by making the correct changes in the BIOS. You must also correctly configure the ESXi port groups with the correct VLAN IDs. Ask your network administrator how VLAN IDs are used in your environment.
  • Ensure that you have enough storage for the Auto Deploy repository. The Auto Deploy server uses the repository to store data it needs, including the rules and rule sets you create and the VIBs and image profiles that you specify in your rules.
  • Best practice is to allocate 2GB to have enough room for four image profiles and some extra space. Each image profile requires approximately 350MB. Determine how much space to reserve for the Auto Deploy repository by considering how many image profiles you expect to use.
  • Obtain the vCenter Server installation media, which include the Auto Deploy installer, or deploy the vCenter Server Appliance.
  • Ensure that a TFTP server is available in your environment. If you require a supported solution, purchase a supported TFTP server from your vendor of choice.
  • Obtain administrative privileges to the DHCP server that manages the network segment you want to boot from. You can use a DHCP server already in your environment, or install a DHCP server. For your Auto Deploy setup, replace the gpxelinux.0 file name with undionly.kpxe.vmw-hardwired.
  • Secure your network as you would for any other PXE-based deployment method. Auto Deploy transfers data over SSL to prevent casual interference and snooping. However, the authenticity of the client or the Auto Deploy server is not checked during a PXE boot.

 

*** NOTE: Auto Deploy is not supported with NPIV (N_Port ID Virtualization). ***

 

  • Set up a remote Syslog server. See the vCenter Server and Host Management documentation for Syslog server configuration information. Configure the first host you boot to use the remote syslog server and apply that host’s host profile to all other target hosts. Optionally, install and use the vSphere Syslog Collector, a vCenter Server support tool that provides a unified architecture for system logging and enables network logging and combining of logs from multiple hosts.
  • Install ESXi Dump Collector and set up your first host so all core dumps are directed to ESXi Dump Collector and apply the host profile from that host to all other hosts.
  • Auto Deploy does not support a pure IPv6 environment because the PXE boot specifications do not support IPv6. However, after the initial PXE boot state, the rest of the communication can happen over IPv6. You can register Auto Deploy to the vCenter Server system with IPv6, and you can set up the host profiles to bring up hosts with IPv6 addresses. Only the initial boot process requires an IPv4 address.

 

 

Procedure

1. Install the vSphere Auto Deploy server as part of a vCenter Server installation or standalone on a Windows system, or deploy the vCenter Server Appliance to an ESXi system of your choice.

 

Location Description
vCenter Server system Use the vCenter Server installation media to install   Auto Deploy on the same host as the vCenter Server system itself. That vCenter Server system manages all hosts that you provision with this Auto Deploy installation.
Windows system Use the vCenter Server installation media to install   Auto Deploy on a Microsoft Windows system that does not have a vCenter Server system installed. The installer prompts you for a vCenter Server system to register Auto Deploy with. That vCenter Server system manages all hosts that you provision with this Auto Deploy installation.
vCenter Server Appliance Deploy the vCenter Server Appliance to the ESXi host of your choice. The appliance includes an Auto Deploy server, which is disabled by default. By default, the vCenter Server system on the appliance manages all hosts you provision with the appliance Auto Deploy installation. Other configurations are supported.

 

2. Configure the TFTP server.

 

Option Description
vSphere Client a. In a vSphere Client connected to the vCenter Server system that Auto Deploy is registered with, click Home in the navigation bar and select Auto Deploy in the Administration tab to display the Auto Deploy page.
b. Click Download TFTP ZIP to download the TFTP   configuration file and unzip the file to the directory in which your TFTP server stores files.
vSphere Web Client a. In a vSphere Web Client connected to the vCenter Server system that Auto Deploy is registered with, go to the inventory list and select the vCenter Server system.
b. Click the Manage tab, select Settings, and click Auto Deploy.
c. Click Download TFTP Boot Log to download the TFTP configuration file and unzip the file to the directory in which your TFTP server stores files.

3. Set up your DHCP server to point to the TFTP server on which the TFTP ZIP file is located.

a. Specify the TFTP Server’s IP address in DHCP option 66 (frequently called next-server).

b. Specify the boot file name, which is undionly.kpxe.vmw-hardwired in the DHCP option 67 (frequently called boot-filename).

Auto deploy 2

4. Set each host you want to provision with Auto Deploy to network boot or PXE boot, following the manufacturer’s instructions.

5. Locate the image profile that you want to use and the depot in which it is located.

In most cases, you point to an image profile that VMware makes available in a public depot. If you want to include custom VIBs with the base image, you can use the Image Builder PowerCLI to create an image profile and use that image profile. See the Image Builder PowerCLI documentation.

6. Write a rule that assigns an image profile to hosts.

7. (Optional) You can use your own Certificate Authority (CA) by replacing the OpenSSL certificate (rbdca.crt) and the OpenSSL private key (rbd-ca.key) with your own certificate and key file.

  • On Windows, the files are in the SSL subfolder of the Auto Deploy installation directory. For example, on Windows 7 the default is C:\ProgramData\VMware\VMware vSphere Auto Deploy\ssl.
  • On the vCenter Server Appliance, the files are in /etc/vmware-rbd/ssl/.

 

When you start a host that is set up for Auto Deploy, the host contacts the DHCP server and is directed to the Auto Deploy server, which provisions the host with the image profile specified in the active rule set.

 

Assign an Image Profile to Hosts

 

Before you can provision a host, you must create rules that assign an image profile to each host that you want to provision by using Auto Deploy.

 

Prerequisites

 

  • Install VMware PowerCLI and all prerequisite software.
  • If you encounter problems running PowerCLI cmdlets, consider changing the execution policy.

 

 Procedure

 1. Run the Connect-VIServer PowerCLI cmdlet to connect to the vCenter Server system that Auto Deploy is registered with.

 Connect-VIServer 192.XXX.X.XX

The cmdlet might return a server certificate warning. In a production environment, make sure no server certificate warnings result. In a development environment, you can ignore the warning.

Auto deploy 1

2. Determine the location of a public software depot, or define a custom image profile using the Image Builder PowerCLI.

3. Run Add-EsxSoftwareDepot to add the software depot that contains the image profile to the PowerCLI session.

 

Depot Type Cmdlet
Remote depot Run:    Add-EsxSoftwareDepot depot_url
ZIP file a. Download the ZIP file to a local file path.
b. Run:    Add-EsxSoftwareDepot C:\file_path\my_offline_depot.zip

4. In the depot, find the image profile that you want to use by running the Get-EsxImageProfile cmdlet.

Auto deploy 3

By default, the ESXi depot includes one base image profile that includes VMware tools and has the string standard in its name, and one base image profile that does not include VMware tools.

5. Define a rule in which hosts with certain attributes, for example a range of IP addresses, are assigned to the image profile.

 New-DeployRule -Name “adamrule” -Item “Your Profile” -Pattern “vendor=Dell,HP”, “ipv4=192.XXX.1.10-192.XXX.1.20”

Double quotes are required if a name contains spaces, optional otherwise. Specify -AllHosts instead of a pattern to apply the item to all hosts.

The cmdlet creates a rule named adamrule. The rule assigns the image profile named Your Profile to all hosts with a vendor of Dell or HP that also have an IP address in the specified range.

Auto deploy 4

6. Add the rule to the rule set.

 Add-DeployRule adamrule

By default, the rule is added to both the working rule set and the active rule set. If you use the NoActivate parameter, the working rule set does not become the active rule set.

When the host boots from iPXE, it reports attributes of the machine to the console. Use the same format of the attributes when writing deploy rules.

 

******************************************************************

* Booting through VMware AutoDeploy…

*

* Machine attributes:

* . asset=No Asset Tag

* . domain=vmware.com

* . hostname=myhost.mycompany.com

* . ipv4=XX.XX.XXX.XXX

* . mac=XX:Xa:Xb:Xc:Xx:XX

* . model=MyVendorModel

* . oemstring=Product ID: XXXXXX-XXX

* . serial=XX XX XX XX XX XX…

* . uuid=XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX

* . vendor=MyVendor

******************************************************************

 

What to do next

 

  • For hosts already provisioned with Auto Deploy, perform the compliance testing and repair operations to provision them with the new image profile.
  • Turn on unprovisioned hosts to provision them with the new image profile.

 

Assign a Host Profile to Hosts

 

Auto Deploy can assign a host profile to one or more hosts. The host profile might include information about storage configuration, network configuration, or other characteristics of the host. If you add a host to a cluster, that cluster’s host profile is used.

The following procedure explains how to write a rule that assigns a host profile to hosts. To assign the host profiles to hosts already provisioned with Auto Deploy, you must also perform a test and repair cycle.

 

In many cases, you assign a host to a cluster instead of specifying a host profile explicitly. The host uses the host profile of the cluster.

 

Procedure

1. Run the Connect-VIServer PowerCLI cmdlet to connect to the vCenter Server system that Auto Deploy is registered with.

Connect-VIServer 192.XXX.X.XX

The cmdlet might return a server certificate warning. In a production environment, make sure no server certificate warnings result. In a development environment, you can ignore the warning.

2. Using the vSphere Client or the vSphere Web Client, set up a host with the settings you want to use and create a host profile from that host.

3. Find the name of the host profile by running Get-VMhostProfile PowerCLI cmdlet, passing in the ESXi host from which you create a host profile.

4. At the PowerCLI prompt, define a rule in which hosts with certain attributes, for example a range of IP addresses, are assigned to the host profile.

 New-DeployRule -Name “adamrule2” -Item my_host_profile -Pattern “vendor=Dell,HP”, “ipv4=192.XXX.1.10-192.XXX.1.20”

The specified item is assigned to all hosts with the specified attributes. This example specifies a rule named adamrule2. The rule assigns the specified host profile my_host_profile to all hosts with an IP address inside the specified range and with a manufacturer of Dell or HP.

5. Add the rule to the rule set.

Add-DeployRule adamrule2

By default, the working rule set becomes the active rule set, and any changes to the rule set become active when you add a rule. If you use the NoActivate parameter, the working rule set does not become the active rule set.

 

What to do next

 

  • Upgrade existing hosts to use the new host profile by performing compliance test and repair operations on those hosts.
  • Turn on unprovisioned hosts to provision them with the host profile.

 

Assign a Host to a Folder or Cluster

 

Auto Deploy can assign a host to a folder or cluster. When the host boots, Auto Deploy adds it to the specified location on the vCenter Server. Hosts assigned to a cluster inherit the cluster’s host profile.

 

The following procedure explains how to write a rule that assigns a host to a folder or cluster. To assign a host already provisioned with Auto Deploy to a new folder or cluster, you must also perform a test and repair cycle.

 

*** NOTE: The folder you select must be in a datacenter or in a cluster. You cannot assign the host to a standalone top-level folder. ***

 

Procedure

1. Run the Connect-VIServer PowerCLI cmdlet to connect to the vCenter Server system that Auto Deploy is registered with.

Connect-VIServer 192.XXX.X.XX

The cmdlet might return a server certificate warning. In a production environment, make sure no server certificate warnings result. In a development environment, you can ignore the warning.

2. Define a rule in which hosts with certain attributes, for example a range of IP addresses, are assigned to a folder or a cluster.

New-DeployRule -Name “adamrule3” -Item “your folder” -Pattern “vendor=Dell,HP”, “ipv4=192.XXX.1.10-192.XXX.1.20”

This example passes in the folder by name. You can instead pass in a folder, cluster, or datacenter object that you retrieve with the Get-Folder, Get-Cluster, or Get-Datacenter cmdlet.

3. Add the rule to the rule set.

Add-DeployRule adamrule3

By default, the working rule set becomes the active rule set, and any changes to the rule set become active when you add a rule. If you use the NoActivate parameter, the working rule set does not become the active rule set.

 

What to do next

 

  • Upgrade existing hosts to be added to the specified vCenter Server location by performing test and repair compliance operations on those hosts.
  • Turn on unprovisioned hosts to add them to the specified vCenter Server location.

 

 Test and Repair Rule Compliance

When you add a rule to the Auto Deploy rule set or make changes to one or more rules, hosts are not updated automatically. Auto Deploy applies the new rules only when you test their rule compliance and perform remediation.

This task assumes that your infrastructure includes one or more ESXi hosts provisioned with Auto Deploy, and that the host on which you installed vSphere PowerCLI can access those ESXi hosts.

 

Procedure

1. Use PowerCLI to check which Auto Deploy rules are currently available.

Get-DeployRule

The system returns the rules and the associated items and patterns.

2. Make a change to one of the available rules, for example, you might change the image profile and the name of the rule.

Copy-DeployRule -DeployRule adamrule -ReplaceItem YourNewProfile

You cannot edit a rule already added to a rule set. Instead, you copy the rule and replace the item or pattern you want to change. By default, PowerCLI uses the old name for the copy and hides the old rule.

3. Verify that the host that you want to test rule set compliance for is accessible.

Get-VMHost -Name SnoopyEsxi

4. Run the cmdlet that tests rule set compliance for the host, and bind the return value to a variable for later use.

 $tr = Test-DeployRuleSetCompliance SnoopyEsxi

5. Examine the differences between what is in the rule set and what the host is currently using.

 $tr.itemlist

The system returns a table of current and expected items.

CurrentItem    ExpectedItem

———–           ————

Your Profile    YourNewProfile

 

6. Remediate the host to use the revised rule set the next time you boot the host.

Repair-DeployRuleSetCompliance $tr

 

What to do next

 

If the rule you changed specified the inventory location, the change takes effect when you repair compliance.

For all other changes, boot your host to have Auto Deploy apply the new rule and to achieve compliance between the rule set and the host.

 

Comments:

No comment found.

Leave a new comment

Search

Please enter a keyword.

Recent Posts

Categories

Copyright © 2017 New Horizons Worldwid, Inc. All rights reserved.
Version: 5.7.1.0