Before you can start using vSphere Auto Deploy, you must prepare your environment in several steps.

You start with server setup and hardware preparation. You must configure the vSphere Auto Deploy service startup type in the vCenter Server system that you plan to use for managing the hosts you provision, and install PowerCLI.

vSphere Auto Deploy Preinstallation Checklist

Before you can start the tasks in this vSphere Auto Deploy scenario, make sure that your environment meets the hardware and software requirements, and that you have the necessary permissions for the components included in the setup.

Table 1. Preinstallation Checklist
Required Software and Hardware Details
vCenter Server The vSphere Auto Deploy server is part of vCenter Server. You must enable and start the vSphere Auto Deploy service on the vCenter Server system. You can perform many of the setup tasks by logging in to vCenter Server. See Prepare Your System for vSphere Auto Deploy.
Storage

Storage for ESXi datastores NFS, iSCSI, or Fibre Channel, with servers and storage arrays that are configured so the servers can detect the LUNs.

  • A list of target IP addresses for NFS or iSCSI.
  • A list of target volume information for NFS or iSCSI.
Host information (for four ESXi hosts)

A list of target IP addresses for NFS or iSCSI.

A list of target volume information for NFS or iSCSI.

  • Default route, net mask, and primary and secondary DNS server IP addresses.
  • IP address and net mask for the VMkernel primary management network.
  • IP address and net mask for other VMkernel networks such as storage, vSphere FT, or VMware vMotion.

vSphere Auto Deploy does not overwrite existing partitions by default.

PowerCLI See Install PowerCLI.
ESXi software depot The location of the ESXi software depot on the Downloads page of the VMware website. You use a URL to point to the image profile stored at that location, or you download a ZIP file to work with a local depot. Do not download the ESXi image.
TFTP server TFTP installer software such as WinAgents TFTP server.
DHCP server The DHCP server is included in the vSphere supported Windows Server versions.
DNS server A working DNS server. You must add entries in both Forward (A Record) and Reverse (PTR Record) Zones for each target host.

You also need information about and administrator privileges to the core servers of the environment, including the ActiveDirectory server, DNS server, DHCP server, NTP server, and so on.

You must have complete control of the broadcast domain of the subnet in which you deploy the setup. Ensure that no other DHCP, DNS, or TFTP server are on this subnet.

Prepare Your System for vSphere Auto Deploy

Before you can PXE boot an ESXi host with vSphere Auto Deploy, you must install prerequisite software and set up the DHCP and TFTP servers that vSphere Auto Deploy interacts with.

If you want to manage vSphere Auto Deploy with PowerCLI cmdlets, see Set Up vSphere Auto Deploy and Provision Hosts with vSphere PowerCLI.

Prerequisites

  • Verify that the hosts that you plan to provision with vSphere Auto Deploy meet the hardware requirements for ESXi. See ESXi Hardware Requirements.
  • Verify that the ESXi hosts have network connectivity to vCenter Server and that all port requirements are met. See vCenter Server Upgrade.
  • Verify that you have a TFTP server and a DHCP server in your environment to send files and assign network addresses to the ESXi hosts that Auto Deploy provisions. See Install the TFTP Server and Prepare the DHCP Server for vSphere Auto Deploy Provisioning.
  • Verify that the ESXi hosts have network connectivity to DHCP, TFTP, and vSphere Auto Deploy servers.
  • If you want to use VLANs in your vSphere Auto Deploy environment, you must set up the end to end networking properly. When the host is PXE booting, the firmware 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 UEFI/BIOS interface. 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.
  • Verify that you have enough storage for the vSphere Auto Deploy repository. The vSphere 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 2 GB to have enough room for four image profiles and some extra space. Each image profile requires approximately 400 MB. Determine how much space to reserve for the vSphere Auto Deploy repository by considering how many image profiles you expect to use.

  • 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 vSphere Auto Deploy setup, replace the gpxelinux.0 filename with snponly64.efi.vmw-hardwired for UEFI or undionly.kpxe.vmw-hardwired for BIOS. For more information on DHCP configurations, see Sample DHCP Configurations.
  • Secure your network as for any other PXE-based deployment method. vSphere Auto Deploy transfers data over SSL to prevent casual interference and snooping. However, the authenticity of the client or the vSphere Auto Deploy server is not checked during a PXE boot.
  • If you want to manage vSphere Auto Deploy with PowerCLI cmdlets, verify that Microsoft .NET Framework 4.5 or 4.5.x and Windows PowerShell 3.0 or 4.0 are installed on a Windows machine. See the vSphere PowerCLI User's Guide.
  • 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 VMware vCenter Log Insight, which provides log aggregation and analytics for VMware and non-VMware products, virtual and physical, with near real-time search and analytics of log events.
  • Install ESXi Dump Collector, set up your first host so that all core dumps are directed to ESXi Dump Collector, and apply the host profile from that host to all other hosts. See Configure ESXi Dump Collector with ESXCLI.
  • If the hosts that you plan to provision with vSphere Auto Deploy are with legacy BIOS, verify that the vSphere Auto Deploy server has an IPv4 address. PXE booting with legacy BIOS firmware is possible only over IPv4. PXE booting with UEFI firmware is possible with either IPv4 or IPv6.

Procedure

  1. Navigate to Home > Auto Deploy.
    By default, only the administrator role has privileges to use the vSphere Auto Deploy service.
  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.
    The Software Depot page appears.
  4. Configure the TFTP server.
    1. Click the Configure tab.
    2. Click Download TFTP Boot Zip to download the TFTP configuration file and unzip the file to the directory in which your TFTP server stores files.
    3. (Optional) To use a proxy server, click Add on the Auto Deploy Runtime Summary pane and enter a proxy server URL in the text box.
      Using reverse proxy servers can offload the requests made to the vSphere Auto Deploy server.
  5. Set up your DHCP server to point to the TFTP server on which the TFTP ZIP file is located.
    1. Specify the TFTP Server's IP address in DHCP option 66, frequently called next-server.
    2. Specify the boot filename, which is snponly64.efi.vmw-hardwired for UEFI or undionly.kpxe.vmw-hardwired for BIOS in the DHCP option 67, frequently called boot-filename.
  6. Set each host you want to provision with vSphere Auto Deploy to network boot or PXE boot, following the manufacturer's instructions.
  7. (Optional) If you set up your environment to use Thumbprint mode, you can use your own Certificate Authority (CA) by replacing the OpenSSL certificate rbd-ca.crt and the OpenSSL private key rbd-ca.key with your own certificate and key file.
    The files are in /etc/vmware-rbd/ssl/.
    By default, vCenter Server uses VMware Certificate Authority (VMCA).

Results

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

What to do next

  • You can change the default configuration properties of the Auto Deploy Service. For more information, see "Configuring vCenter Server" in the vCenter Server and Host Management documentation.
  • You can change the default configuration properties of the Image Builder Service. For more information, see "Configuring vCenter Server" in the vCenter Server and Host Management documentation.
  • Define a rule that assigns an image profile and optional host profile, host location, or script bundle to the host. For Managing vSphere Auto Deploy with PowerCLI cmdlets, see the Managing vSphere Auto Deploy with PowerCLI Cmdlets section. For managing vSphere Auto Deploy with the vSphere Client, see the Managing vSphere Auto Deploy with the vSphere Client section.
  • (Optional) Configure the first host that you provision as a reference host. Use the storage, networking, and other settings you want for your target hosts to share. Create a host profile for the reference host and write a rule that assigns both the already tested image profile and the host profile to target hosts.
  • (Optional) If you want to have vSphere Auto Deploy overwrite existing partitions, set up a reference host to do auto partitioning and apply the host profile of the reference host to other hosts. See Configure a Reference Host for Auto-Partitioning.
  • (Optional) If you have to configure host-specific information, set up the host profile of the reference host to prompt for user input. For more information about host customizations, see the vSphere Host Profiles documentation.

Using vSphere Auto Deploy Cmdlets

vSphere Auto Deploy cmdlets are implemented as Microsoft PowerShell cmdlets and included in PowerCLI. Users of vSphere Auto Deploy cmdlets can take advantage of all PowerCLI features.

Experienced PowerShell users can use vSphere Auto Deploy cmdlets just like other PowerShell cmdlets. If you are new to PowerShell and PowerCLI, the following tips might be helpful.

You can type cmdlets, parameters, and parameter values in the PowerCLI shell.

  • Get help for any cmdlet by running Get-Helpcmdlet_name.
  • Remember that PowerShell is not case sensitive.
  • Use tab completion for cmdlet names and parameter names.
  • Format any variable and cmdlet output by using Format-List or Format-Table, or their short forms fl or ft. For more information, run the Get-Help Format-List cmdlet.

Passing Parameters by Name

You can pass in parameters by name in most cases and surround parameter values that contain spaces or special characters with double quotes.
 Copy-DeployRule -DeployRule testrule -ReplaceItem MyNewProfile

Most examples in the vCenter Server Installation and Setup documentation pass in parameters by name.

Passing Parameters as Objects

You can pass parameters as objects if you want to perform scripting and automation. Passing in parameters as objects is useful with cmdlets that return multiple objects and with cmdlets that return a single object. Consider the following example.

  1. Bind the object that encapsulates rule set compliance information for a host to a variable.
    $tr = Test-DeployRuleSetCompliance MyEsxi42
  2. View the itemlist property of the object to see the difference between what is in the rule set and what the host is currently using.
    $tr.itemlist
  3. Remediate the host to use the revised rule set by using the Repair-DeployRuleSetCompliance cmdlet with the variable.
    Repair-DeployRuleSetCompliance $tr

The example remediates the host the next time you boot the host.

Set Up Bulk Licensing

You can use the vSphere 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 vSphere Auto Deploy.

Assigning license keys through the vSphere Client and assigning licensing by using PowerCLI cmdlets function differently.

Assign license keys with the vSphere Client
You can assign license keys to a host when you add the host to the vCenter Server system or when the host is managed by a vCenter Server system.
Assign license keys with LicenseDataManager PowerCLI
You can specify a set of license keys to be added to a set of hosts. The license keys are added to the vCenter Server database. Each time a host is added to the vCenter Server system or reconnects to it, the host is assigned a license key. A license key that is assigned through PowerCLI is treated as a default license key. When an unlicensed host is added or reconnected, it is assigned the default license key. If a host is already licensed, it keeps its license key.

The following example assigns licenses to all hosts in a data center. You can also associate licenses with hosts and clusters.

The following example is for advanced PowerCLI users who know how to use PowerShell variables.

Prerequisites

Prepare Your System for vSphere Auto Deploy.

Procedure

  1. In a PowerCLI session, 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 data center 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 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 vSphere Auto Deploy and assign them to the data center or to the cluster that you assigned the license data to.
  7. You can use the vSphere Client to verify that the host is successfully assigned to the default license XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.

Results

All hosts that you assigned to the data center are now licensed automatically.