Scenario to set up and configure a working vSphere Auto Deploy environment by using PowerCLI.

In this scenario, you are going to set up and configure a working vSphere Auto Deploy environment that includes four hosts. You will create rules and provision two of the hosts with an image profile and the other two with the same image profile and a host profile that is set up to prompt for user input. This scenario can provide you with the basis for a production environment. The task descriptions assume that you are using a flat network with no VLAN tagging between the physical hosts and the rest of your environment.

To perform the tasks in this scenario, you should have the following background knowledge and privileges.
  • Experience with vSphere (vCenter Server and ESXi).
  • Basic knowledge of Microsoft PowerShell and PowerCLI.
  • Administrator rights to a Windows system and a vCenter Server system.

Follow the tasks in the order presented in this scenario. Some steps can be performed in a different order, but the order used here limits repeated manipulation of some components. For details on the preinstallation checklist and other prerequisites to configure vSphere Auto Deploy, see Install and Configure vSphere Auto Deploy.

Figure 1. vSphere Auto Deploy Setup and Hosts Provisioning Workflow
Flow of preinstallation check and setup of TFTP, PowerCLI, target host, DHCP, active rule, host profile, reference host, and host customization.

vSphere Auto Deploy takes advantage of the iPXE infrastructure and PXE booting with legacy BIOS firmware is possible only over IPv4. If the hosts that you want to provision with vSphere Auto Deploy are with legacy BIOS, the vSphere Auto Deploy server must have an IPv4 address. PXE booting with UEFI firmware is possible with either IPv4 or IPv6.

Install the TFTP Server

To set up a vSphere Auto Deploy infrastructure, you must install a TFTP server in your environment. vSphere Auto Deploy relies on a TFTP server for sending a boot image to the hosts that it provisions.

This task only installs the TFTP server. You later download a configuration file to the server. See Configure the vSphere Auto Deploy and TFTP Environment in the vSphere Client.

Procedure

  1. Download your preferred TFTP server to a location that has network access to your vCenter Server and install the server.
  2. Configure the TFTP root directory, for example D:\TFTP_Root\.

What to do next

Install PowerCLI, to manage vSphere Auto Deploy with PowerCLI cmdlets.

Install PowerCLI

Before you can manage vSphere Auto Deploy with rules that you create with PowerCLI cmdlets, you must install PowerCLI.

Procedure

What to do next

Configure the settings of your target hosts to prepare them for provisioning with vSphere Auto Deploy.

Prepare the vSphere Auto Deploy Target Hosts

You must configure the BIOS settings of the four hosts and reconfirm the MAC address of the primary network device to prepare the target hosts for provisioning with vSphere Auto Deploy.

Prerequisites

Hosts that you want to provision with vSphere Auto Deploy must meet the requirements for ESXi.

See ESXi Hardware Requirements.

Procedure

  1. Change the BIOS settings of each of the four physical hosts to force the hosts to boot from the primary network device.
  2. Reconfirm the MAC address of the primary network device.

What to do next

Set up the DHCP server to serve each target host with an iPXE binary.

Prepare the DHCP Server for vSphere Auto Deploy Provisioning

When you prepare the vSphere Auto Deploy target hosts, you must set up the DHCP server in this scenario to serve each target host with an iPXE binary.

The environment in this scenario uses Active Directory with DNS and DHCP. The DHCP server is included in the vSphere supported Windows Server versions.

Procedure

  1. Log in to your DHCP Server with administrator privileges.
  2. Create a DHCP scope for your IP address range.
    1. Click Start > Settings > Control Panel > Administrative Tools and click DHCP.
    2. Navigate to DHCP > hostname > IPv4.
    3. Right-click IPv4 and select New Scope.
    4. On the Welcome screen, click Next, and specify a name and description for the scope.
    5. Specify an IP address range and click Next.
    6. Click Next until you reach the Configure DHCP Options screen and select No, I will configure this option later.
  3. Create a DHCP reservation for each target ESXi host.
    1. In the DHCP window, navigate to DHCP > hostname > IPv4 > Autodeploy Scope > Reservations.
    2. Right-click Reservations and select New Reservation.
    3. In the New Reservation window, specify a name, IP address, and the MAC address for one of the hosts. Do not include the colon (:) in the MAC address.
      Information about IP reservations and the MAC address.

    4. Repeat the process for each of the other hosts.
  4. Set up the DHCP Server to point the hosts to the TFTP Server.
    1. In the DHCP window, navigate to DHCP > hostname > IPv4 > Autodeploy Scope > Scope Options.
    2. Right click Scope Options and choose Configure Options.
    3. In the Scope Options window, click the General tab.
    4. Click 066 Boot Server Host Name and enter the address of the TFTP server that you installed in the String value field below the Available Options.
      The 066 Boot Server Host Name and 067 Bootfile Name check boxes are selected. The file name has been entered in the String value field.

    5. Click 067 Bootfile Name and enter undionly.kpxe.vmw-hardwired.
      The undionly.kpxe.vmw-hardwired iPXE binary will be used to boot the ESXi hosts.
    6. Click Apply and click OK to close the window.
  5. In the DHCP window, right-click DHCP > hostname > IPv4 > Scope > Activate and click Activate.
  6. Do not log out from the DHCP Server if you are using Active Directory for DHCP and DNS, or log out otherwise.

What to do next

start the vCenter Server service of vSphere Auto Deploy and configure the TFTP server.

Configure the vSphere Auto Deploy and TFTP Environment in the vSphere Client

After you prepare the DHCP server, you must start the vSphere Auto Deploy vCenter Server service and configure the TFTP server. You must download a TFTP ZIP file from your vSphere Auto Deploy server. The customized FTP server serves the boot images that vSphere Auto Deploy provides.

Procedure

  1. Use the vSphere Client to connect to the vCenter Server system that manages the vSphere Auto Deploy server.
  2. Start the vSphere Auto Deploy service.
    1. Navigate to Home > Auto Deploy.
    2. On the Auto Deploy page, select your vCenter Server from the drop-down menu at the top.
    3. Click Enable Auto Deploy and Image Builder to activate the service.
      If the Image Builder service is already active, select the Configure tab and click Enable Auto Deploy Service.
  3. In the Auto Deploy inventory, click the Configure tab.
  4. Click the Download TFTP Zip File.
  5. Save the file deploy-tftp.zip to the TFTP_Root directory that you created when you installed the TFTP Server, and unzip the file.

What to do next

Add a software depot to your inventory and use an image profile from the depot to create a rule for host provisioning.

Prepare the ESXi Software Depot and Write a Rule

After you configure the vSphere Auto Deploy infrastructure, you must add an ESXi software depot, specify an image profile, write a rule, and add it to the active rule set.

vSphere Auto Deploy provisions hosts with image profiles that define the set of VIBs that an ESXi installation process uses. Image profiles are stored in software depots. You must make sure that the correct image profile is available before you start provisioning hosts. When you add a software depot to a PowerCLI session, it is available only during the current session. It does not persist across sessions.

The steps in this task instruct you to run PowerCLI cmdlets. For additional information about the vSphere Auto Deploy cmdlets that you can run in a PowerCLI session, see vSphere Auto Deploy PowerCLI Cmdlet Overview.

Prerequisites

Verify that you can access the ESXi hosts that you want to provision from the system on which you run PowerCLI.

Procedure

  1. Log in as an administrator to the console of the Windows system, either directly or by using RDP.
    This task assumes that you installed PowerCLI on the system on which the vCenter Server system is running.
  2. In a PowerCLI session, run the Connect-VIServer cmdlet to connect to the vCenter Server system that vSphere Auto Deploy is registered with.
    Connect-VIServer ipv4_address
    The cmdlet might return a server certificate warning. In a production environment, make sure no server certificate issues occur. In a development environment, you can ignore the warning.
  3. Enter the vCenter Server credentials.
  4. Run Add-EsxSoftwareDepot to add the online depot to the PowerCLI session.
    Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml

    Adding the software depot is required each time you start a new PowerCLI session.

  5. Validate that you successfully added the software depot by checking the contents of the depot with the Get-EsxImageProfile cmdlet.
    The cmdlet returns information about all image profiles in the depot.
  6. Create a new rule by running the New-DeployRule cmdlet.
    New-DeployRule -Name "InitialBootRule" -Item ESXi-6.0.0-2494585-standard -AllHosts
    The cmdlet creates a rule that assigns the specified image profile to all hosts in the inventory.
  7. Add the new rule to the active rule set to make the rule available to the vSphere Auto Deploy server.
    Add-DeployRule	-DeployRule "InitialBootRule"

What to do next

Provision your first host with vSphere Auto Deploy and verify its image provisioning.

Provision the First Host with vSphere Auto Deploy

After creating a rule and adding it to the active rule set, you can provision the first host and check its vCenter Server location to complete verification of the image provisioning of your setup.

Procedure

  1. Open a console session to the physical host that you want to use as the first ESXi target host, boot the host, and look for messages that indicate a successful iPXE boot.
    During the boot process, DHCP assigns an IP address to the host. The IP address matches the name you specified earlier in the DNS server. The host contacts the vSphere Auto Deploy server and downloads the ESXi binaries from the HTTP URL indicated in the iPXE tramp file that you downloaded earlier to the TFTP_Root directory. Each instance of vSphere Auto Deploy produces a custom set of files for the TFTP Server.
  2. Use the vSphere Client to connect to the vCenter Server system that manages the vSphere Auto Deploy server.
  3. On the vSphere Client Home page, click Hosts and Clusters.
  4. Verify that the newly provisioned host is now in the vCenter Server inventory at the datacenter level.
    By default, vSphere Auto Deploy adds hosts at the datacenter level when the boot process completes.

What to do next

Extract a host profile from the host and configure it to require user input.

Extract and Configure a Host Profile from the Reference Host

After provisioning the first host, you can extract and configure a host profile that can be used to apply the same configuration to other target hosts. Configuration that differs for different hosts, such as a static IP address, can be managed through the host customization mechanism.

vSphere Auto Deploy can provision each host with the same host profile. vSphere Auto Deploy can also use host customization that allows you to specify different information for different hosts. For example, if you set up a VMkernel port for vMotion or for storage, you can specify a static IP address for the port by using the host customization mechanism.

Procedure

  1. Use the vSphere Client to connect to the vCenter Server system that manages the vSphere Auto Deploy server.
  2. Click Policies and Profiles and select Host Profiles.
  3. Click Extract Host Profile.
  4. On the Select host page of the wizard, select the reference host that you configured earlier and click Next.
  5. On the Name and Description page of the wizard, enter a name and description for the new profile and click Finish.
  6. Select the host profile that you want to edit and click the Configure tab.
  7. Click Edit Host Profile.
  8. Select Security and Services > Security Settings > Security > User Configuration > root.
  9. From the Password drop-down menu, select User Input Password Configuration.
  10. Click Save to configure the host profile settings.

What to do next

Create a vSphere Auto Deploy rule to apply the host profile to other ESXi hosts.

Create a Rule that Provisions Hosts from a Specific IP Range

After creating a host profile from a reference host, you can create a rule that applies the previously verified image profile and the host profile that you extracted to target hosts from a specific IP range.

Procedure

  1. Log in with administrator privileges to the console of the Windows system, either directly or by using RDP.
  2. In a PowerCLI session, run the Connect-VIServer cmdlet to connect to the vCenter Server system that vSphere Auto Deploy is registered with.
    Connect-VIServer ipv4_address
    The cmdlet might return a server certificate warning. In a production environment, make sure no server certificate issues occur. In a development environment, you can ignore the warning.
  3. Run Add-EsxSoftwareDepot to add the online depot to the PowerCLI session.
    Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml

    Adding the software depot is required each time you start a new PowerCLI session.

  4. (Required) Display the rules in the active rule set by running the Get-DeployRuleset cmdlet.
  5. Create a rule that instructs vSphere Auto Deploy to provision the set of hosts from a specified IP range with the image profile that you previously selected and the host profile that you created from the reference host.
    New-DeployRule -name "Production01Rule" -item "image_profile",ESXiGold -Pattern "ipv4=IP_range"
  6. Add the new rule to the active rule set.
    Add-DeployRule	-DeployRule "Production01Rule"
  7. Check the active rule set by running the Get-DeployRuleset command.
    PowerCLI displays information similar to the following example.
    Name:              Production01Rule
    PatternList:       {ipv4=address_range}
    ItemList:          {ESXi-version-XXXXXX-standard, Compute01, ESXiGold}

What to do next

Provision the hosts and set up the host customizations.

Provision Hosts and Set Up Host Customizations

With the rule in place that provisions hosts using an image profile and a host profile, you can provision specific target hosts. If any host profile items are set to prompt the user for input, the host comes up in maintenance mode. You apply the host profile or check host compliance to be prompted for the information. The system associates the host customization with the host.

Procedure

  1. Boot the remaining hosts you want to provision.
    vSphere Auto Deploy boots the hosts, applies the host profile, and adds the hosts to the vCenter Server inventory. The hosts remain in maintenance mode because the host profile from the reference host is set up to require user input for each host.
  2. Use the vSphere Client to connect to the vCenter Server system that manages the vSphere Auto Deploy server.
  3. Click Policies and Profiles and select Host Profiles.
  4. Right-click the newly created host profile for Auto Deploy and click Edit Host Customizations.
  5. Select the hosts, enter the required host customizations and click Finish.
    Alternatively, you can also Import Host Customizations file.
  6. Apply the host profile to each of the hosts and get the hosts out of maintenance mode. Alternatively, you can reboot each host.
    When the reboot progress completes, all hosts are running with the image you specify and use the configuration in the reference host profile. The cluster shows that all hosts are fully compliant.

Results

All hosts are now configured with the shared information through the reference host profile and with the host-specific information through the host customization mechanism. The next time you boot the hosts, they receive the complete Host Profile information, including the host-specific information, and boot up completely configured and out of Maintenance Mode.