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.

Before you begin

  • Install VMware PowerCLI and all prerequisite software.

  • If you encounter problems running PowerCLI cmdlets, consider changing the execution policy. See Using Auto Deploy Cmdlets.

About this task

Auto Deploy extensibility rules enforce that VIBs at the CommunitySupported level can only contain files from certain predefined locations, such as the ESXCLI plug-in path, jumpstart plug-in path, and so on. If you add a VIB that is in a different location to an image profile, a warning results. You can override the warning by using the force option.

If you call the New-DeployRule cmdlet on an image profile that includes VIBs at the CommunitySupported level which violate the rule, set $DeployNoSignatureCheck = $true before adding the image profile. With that setting, the system ignores signature validation and does not perform the extensibility rules check.

Note:

Image profiles that include VIBs at the CommunitySupported level are not supported on production systems.

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. 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

    1. Download the ZIP file to a local file path.

    2. 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.

    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 "testrule" -Item "My Profile25" -Pattern "vendor=Acme,Zven", "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 testrule. The rule assigns the image profile named My Profile25 to all hosts with a vendor of Acme or Zven that also have an IP address in the specified range.

  6. Add the rule to the rule set.

    Add-DeployRule testrule

    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.

Results

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. See Test and Repair Rule Compliance.

  • Turn on unprovisioned hosts to provision them with the new image profile.