Hi All
Does anyone know how to Host > Host Profiles > Reset Host Customizations in PowerCLI or ESXCLI?
I am pushing host customizations via Invoke-VMHostProfile -Variable. But they do not appear visable until I do the reset.
Thanks
Ben
No cmdlet I'm afraid.
But you can use the API method
$esx = Get-VMHost -Name $esxName
$hProfMgr = Get-View HostProfileManager
$spec = New-Object VMware.Vim.AnswerFileOptionsCreateSpec
$hProfMgr.UpdateAnswerFile($esx.Id,$spec)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Moderator: Moved to PowerCLI
No cmdlet I'm afraid.
But you can use the API method
$esx = Get-VMHost -Name $esxName
$hProfMgr = Get-View HostProfileManager
$spec = New-Object VMware.Vim.AnswerFileOptionsCreateSpec
$hProfMgr.UpdateAnswerFile($esx.Id,$spec)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
This is it. Thank you very much.
While I have you. Is the following the best method of applying the host customizations?
Invoke-VMHostProfile - vSphere PowerCLI Cmdlets Reference
$requireInput = Invoke-VMHostProfile $vmhost -Profile $profile;
$requireInput['network.hostPortGroup["key-vim-profile-host-HostPortgroupProfile-VMkernel"].ipConfig.IpAddressPolicy.address'] = '192.168.0.1';
$requireInput['network.hostPortGroup["key-vim-profile-host-HostPortgroupProfile-VMkernel"].ipConfig.IpAddressPolicy.subnetmask'] = '255.255.255.0';
Invoke-VMHostProfile $vmhost -Profile $profile -Variable $requireInput;
That is correct.
We do have a short section on this in the PowerCLI Reference.
Note Apply-VMHostProfile is now Invoke-VMHostProfile.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Is there anyway to get the required hash table without having to invoke the host profile?
Not that I know of I'm afraid.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference