VMware Cloud Community
lulu62
Enthusiast
Enthusiast

PowerCLI, host profile and host customization

Hello community,

I can't seem to find much info about how to edit host customization with PowerCLI when applying a host profile with PowerCLI.

I can remember having to enter host customization settings when applying a host profile to a freshly installed ESXi host via the vCenter GUI. Now how to do that with PowerCLI?

I searched a bit here:

https://code.vmware.com/docs/9006/cmdlet-reference/doc/VMHostProfile.html#/doc/Invoke-VMHostProfile....

Is it done with the -Variable parameter ?

Invoke-VMHostProfile $vmhost -Profile $profile -Variable $requireInput;

Variable Hashtable Specifies a hash table object that provides values for the host profile required variables.

Can someone confirm?

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership

Invoke-VMHostProfile is just one of the HostProfile related cmdlets in PowerCLI.

You can find them all with

Get-Command -Name *VMHostProfile*

Invoke-VMHostProfile is indeed used to apply a HostProfile to an ESXi node. But the profile is provided on the Profile parameter.

The Variable parameter is used to provide values, in the form of a hash table, for the HostProfile entries that are set to 'prompt'.

Use the Get-VMHostProfileRequiredInput cmdlet to find out which settings to provide in that hash table.

You can create a new HostProfile

  • by copying the settings of an existing ESXi node (ReferenceHost on the New-VMHostProfile cmdlet)
  • same as the previous option, but change settings. The specific settings are currently limited to Cache,Storage,User and Portgroup settings (see all the Set-VMHostProfile*Configuration cmdlets)
  • by importing one with Import-VMHostProfile cmdlet


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos