Yes, it's an issue in PowerCLI 4.1 and some vCenter 4.1 servers that have hidden cluster profile created by default. You can check this by examing ClusterProfileManager object:
$si = Get-View ServiceInstance $clProfileMgr = Get-View ($si.Content.ClusterProfileManager) $clProfileMgr.Profile
The immediate workaround in that case would be:
Get-VMHostProfile -Entity $vmhost
Get-VmHostProfile -Entity *
for all entities.
But this workaround works only for Host Profiles that are already attached to an ESX(i) host or a cluster.
Btw there is no need to file a new bug for this issue, we've already fixed it for the next release
PowerCLI Dev Team
Yasen, these 3 default cluster profiles seem to be compliance checks for FT.
Is it safe to delete these if one doesn't use FT in the vCenter ?
And can they be deleted ?
The reason for asking, your bypass with the -Entity parameter works.
But that is only valid if the host profile is attached to at least 1 host and doesn't allow one to use the -ApplyOnly parameter on the Apply-VMHostProfile cmdlet.
Blog: LucD notes
Twitter: lucd22Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
I'm not familiar with this new functionality so I need to research what these profiles are for and if you can safely delete them.
I'll let you know asap as I have any info about it
PowerCLI Dev Team
Is it also known (or am I the only one here having this problem?) that specifying a host profile by name also does not work? For example, I'm typing:
Get-VMHostProfile -Name <name>
And it is throwing this error:
Get-VMHostProfile : 11/11/2010 1:43:59 PM Get-VMHostProfile At line:1 char:18 + Get-VMHostProfile <<<< -Name GMR + CategoryInfo : NotSpecified: (:) [Get-VMHostProfile], InvalidProperty + FullyQualifiedErrorId : Client20_SystemManagementServiceImpl_CreateProfileByMoRef_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.Ge tVMHostProfile Get-VMHostProfile : 11/11/2010 1:43:59 PM Get-VMHostProfile VMHostProfile with name 'name' was not found, using the specified filter(s). At line:1 char:18 + Get-VMHostProfile <<<< -Name GMR + CategoryInfo : ObjectNotFound: (:) [Get-VMHostProfile], VimException + FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetVMHostProfile
Because without being able to "get" a host profile, my export/import script seems impossible because I'd like to use "Apply-VMHostProfile" with the -AssociateOnly parameter to assign my newly imported host profiles to their proper clusters. Looks like I'm going to have to do it by hand (or play with the API maybe).
I've downloaded PowerCLI 4.1.1 and this is indeed fixed, though it isn't listed as fixed on the "complete" changelog found here: http://www.vmware.com/support/developer/PowerCLI/changelog.html#PowerCLI41U1.
I can confirm that installing U1 has fixed that issue but opened up a few more. I can no longer import my vmtx files as new-vm as it complains that they are not virtual machines.