VMware Cloud Community
alanrenouf
VMware Employee
VMware Employee

Get-VMHostProfile

I am trying to do a Get-VMHostProfile with PowerCLI 4.1 (tried 32 and 64bit) and I get the following error:

Get-VMHostProfile : 14/09/2010 14:17:45 Get-VMHostProfile

At line:1 char:18

+ Get-VMHostProfile <<<<

+ CategoryInfo : NotSpecified: (Smiley Happy , InvalidProperty

+ FullyQualifiedErrorId : Client20_SystemManagementServiceImpl_CreateProfileByMoRef_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetVMHostProfile

My vCenter is also 4.1.

Anyone else confirm this is an issue with them ?

Alan Renouf

http://virtu-al.net

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Tags (2)
0 Kudos
8 Replies
LucD
Leadership
Leadership

Yes, I see the same error.

____________

Blog: LucD notes

Twitter: lucd22


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

alanrenouf
VMware Employee
VMware Employee

Doh ! - Guess I will bug the dev team then Smiley Wink

Alan Renouf

http://virtu-al.net

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
0 Kudos
ykalchev
VMware Employee
VMware Employee

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 

or

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 Smiley Wink

Regards,

Yasen Kalchev

PowerCLI Dev Team

Yasen Kalchev, vSM Dev Team
0 Kudos
LucD
Leadership
Leadership

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: lucd22


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

0 Kudos
ykalchev
VMware Employee
VMware Employee

Hi Luc,

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

Regards,

Yasen Kalchev

PowerCLI Dev Team

Yasen Kalchev, vSM Dev Team
0 Kudos
allencrawford
Enthusiast
Enthusiast

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

0 Kudos
allencrawford
Enthusiast
Enthusiast

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.

0 Kudos
pauljawood
Enthusiast
Enthusiast

Hi,

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.

If you found this helpful then please leave some points.
0 Kudos