Use vSphere Auto Deploy to reprovision ESXi hosts with a different image profile or a different host profile.

vSphere Auto Deploy supports multiple reprovisioning options. You can perform a simple reboot or reprovision with a different image profile or a different host profile.

A first boot using vSphere Auto Deploy requires that you set up your environment and add rules to the rule set. See Install and Configure vSphere Auto Deploy.

The following reprovisioning operations are available.

  • Simple reboot.
  • Reboot of hosts for which the user answered questions during the boot operation.
  • Reprovision with a different image profile.
  • Reprovision with a different host profile.

Reprovision Hosts with Simple Reboot Operations

You can reprovisions ESXi hosts with the image profile, host profile, custom script, and vCenter Server location assigned during first boot.

Prerequisites

A simple reboot of a host that is provisioned with vSphere Auto Deploy requires only that all prerequisites are still met. The process uses the previously assigned image profile, host profile, custom script, and vCenter Server location.
  • Verify that the setup you performed during the first boot operation is in place. See Provision a Host (First Boot).
  • Verify that all associated items like are available. An item can be an image profile, host profile, custom script or vCenter Server inventory location.
  • Verify that the host has the identifying information (asset tag, IP address) it had during previous boot operations.

Procedure

  1. Place the host in maintenance mode.
    Host Type Action
    Host is part of a DRS cluster VMware DRS migrates virtual machines to appropriate hosts when you place the host in maintenance mode.
    Host is not part of a DRS cluster You must migrate all virtual machines to different hosts and place each host in maintenance mode.
  2. Reboot the host.

Results

The host shuts down. When the host reboots, it uses the image profile that the vSphere Auto Deploy server provides. The vSphere Auto Deploy server also applies the host profile stored on the vCenter Server system.

Use PowerCLI To Reprovision a Host

You can use vSphere Auto Deploy to reprovision a host with a new image profile in a PowerCLI session.

Several options for reprovisioning hosts exist.

  • If the VIBs that you want to use support live update, you can use an esxcli software vib update command. In that case, you must also update the rule set to use an image profile that includes the new VIBs.
  • During testing, you can apply an image profile to an individual host with the Apply-EsxImageProfile cmdlet and reboot the host so the change takes effect. The Apply-EsxImageProfile cmdlet updates the association between the host and the image profile but does not install VIBs on the host.
  • In all other cases, use this procedure.

Prerequisites

Procedure

  1. At the PowerShell prompt, run the Connect-VIServer PowerCLI cmdlet to connect to the vCenter Server system that vSphere Auto Deploy is registered with.
    Connect-VIServer ipv4_or_ipv6_address
    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. Determine the location of a public software depot that contains the image profile that you want to use, or define a custom image profile with vSphere ESXi Image Builder.
  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
    1. Download the ZIP file to a local file path or create a mount point local to the PowerCLI machine.
    2. Run Add-EsxSoftwareDepot C:\file_path\my_offline_depot.zip.
  4. Run Get-EsxImageProfile to see a list of image profiles, and decide which profile you want to use.
  5. Run Copy-DeployRule and specify the ReplaceItem parameter to change the rule that assigns an image profile to hosts.
    The following cmdlet replaces the current image profile that the rule assigns to the host with the my_new_imageprofile profile. After the cmdlet completes, myrule assigns the new image profile to hosts. The old version of myrule is renamed and hidden.
    Copy-DeployRule myrule -ReplaceItem my_new_imageprofile
  6. Test the rule compliance for each host that you want to deploy the image to.
    1. Verify that you can access the host for which you want to test rule set compliance.
      Get-VMHost -Name ESXi_hostname
    2. 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 ESXi_hostname
    3. Examine the differences between the contents of the rule set and configuration of the host.
      $tr.itemlist
      The system returns a table of current and expected items if the host for which you want to test the new rule set compliance is compliant with the active rule set.
      CurrentItem                             ExpectedItem
      -----------                             ------------   
      my_old_imageprofile                           my_new_imageprofile
      
    4. Remediate the host to use the revised rule set the next time you boot the host.
      Repair-DeployRuleSetCompliance $tr
  7. Reboot the host to provision it with the new image profile.

Reprovision a Host with a New Image Profile by Using the vSphere Client

You can use vSphere Auto Deploy to reprovision a host with a new image profile with the vSphere Client by changing the rule that the host corresponds to and activating the rule.

Prerequisites

  • Verify that the image profile you want to use to reprovision the host is available. See Create an Image Profile.
  • Verify that the setup you performed during the first boot operation is in place.

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 Deploy Rules tab, from the list of rules in the inventory select the rule and click Edit.
    The Edit Deploy Rule dialog box appears.
  3. (Optional) On the Name and hosts page of the wizard, enter a name for the new rule.
  4. (Optional) Select to either apply the rule to all hosts in the inventory or only to hosts that match a specific pattern.
    You can select one or more patterns.
    For example, the rule can apply only to hosts in a vCenter Single Sign-On domain, with a specific host name, or that match a specific IPv4 range.
  5. On the Configuration page of the wizard, you can optionally include items in the rule.
    Each enabled item adds a new page to the wizard.
    Option Action
    Host Location Add the hosts that match the criteria of the rule to a specific location.
    Image Profile Assign an image profile to the hosts that match the rule criteria.
    Host Profile Assign a host profile to the hosts that match the rule criteria.
    Script Bundle Assign a script bundle to the host that match the rule criteria.
  6. Click Next to skip the Host Location selection.
  7. On the Select image profile page of the wizard, assign an image profile to the hosts that match the rule criteria.
    Option Action
    If you do not want to change the image profile Select the Same image profile check box.
    If you want to assign a new image profile to the selected hosts
    1. Select the Browse for Image Profile check box.
    2. Select a software depot from the drop-down menu.
    3. Select an image profile from the list.
    4. (Optional) If you want to bypass the acceptance level verification for the image profile, select the Skip image profile signature check check box.
  8. Click Next to skip the Host profile selection.
  9. On the Ready to complete page, review the summary information for the new image profile and click Finish.
  10. Click Activate/Deactivate rules.
  11. From the list of inactive rules, select the rule that you want to activate and click the Activate button.
  12. (Optional) If you want to reorder the rules in the active rule list, select a rule that you want to move up or down in the list and click Move up or Move down above the list of active rules.
    The rules are listed by priority. For example, if two or more rules apply to the same host but are set to provision the host with different host locations, image profiles, and host profiles, the rule that is highest in the list takes effect on the host.
  13. (Optional) If you want to test an inactive rule before activation, click Test rules before activation.
    1. Select a host from the list and click Check Compliance to view the current status of the host and the changes that are expected after the activation of the rule.
      If the host is compliant with the rule, you do not need to remediate the host after you activate the rule.
    2. (Optional) If you want to remediate the selected hosts after the rule activation, enable the toggle button or select the Remediate all host associations after rule activation check box to remediate all hosts.
  14. Review the list of active rules and click ОК.
  15. Reboot the host to provision it with the new image profile.

Update the Host Customization in the vSphere Client

If a host required user input during a previous boot, the answers are saved with the vCenter Server. If you want to prompt the user for new information, you must remediate the host.

Prerequisites

Attach a host profile that prompts for user input to the host.

Procedure

  1. Migrate all virtual machines to different hosts, and place the host into maintenance mode.
    Host Type Action
    Host is part of a DRS cluster VMware DRS migrates virtual machines to appropriate hosts when you place the host in maintenance mode.
    Host is not part of a DRS cluster You must migrate all virtual machines to different hosts and place each host in maintenance mode.
  2. Navigate to Home > Auto Deploy.
    By default, only the administrator role has privileges to use the vSphere Auto Deploy service.
  3. On the Deployed Hosts tab, select an ESXi host.
  4. Click Remediate Host Associations.
    You can monitor the progress of the remediation process in the Recent Tasks pane.
  5. When prompted, provide the user input.
  6. Direct the host to exit maintenance mode.

Results

The host customization is saved and takes effect the next time you boot the host.