Highlighted
Enthusiast
Enthusiast

Get-VM -Tag not working in VMware vSphere 6.7

Hello all

In VMware vSphere 6.0 with PowerCLI version 11.2.0 we used Get-VM -Tag 'Test' to list

VM with tag with value Test. After upgrade to VMware vSphere 6.7 this stopped working.

Is there a solution for that?

Regards

Hideyori

Tags (2)
0 Kudos
33 Replies
Highlighted
Contributor
Contributor

PS C:\Windows\system32> Get-TagAssignment -Entity SERVERNAME

Get-TagAssignment : 12/12/2019 6:51:08 AM    Get-TagAssignment        com.vmware.vapi.std.errors.unauthenticated {'messages': [com.vmware.vapi.std.localizable_message {'id':

com.vmware.vapi.endpoint.method.authentication.required, 'default_message': Authentication required., 'args': []}], 'data':}.  

At line:1 char:1

+ Get-TagAssignment -Entity SERVERNAME

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Get-TagAssignment], CisException

    + FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Impl.V1.Service.Tagging.Cis.TaggingServiceCisImpl.GetTagAssignment.Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetTagAssignment

0 Kudos
Highlighted
User Moderator
User Moderator

Just to make sure, did you stop/start your PowerShell/PowerCLI session before testing?


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

0 Kudos
Highlighted
Contributor
Contributor

Yes, this was a brand new session

0 Kudos
Highlighted
User Moderator
User Moderator

Which build of VCSA 6.7 are you running?
And do you use an embedded PSC or not?


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

0 Kudos
Highlighted
Contributor
Contributor

Version = 6.7.0

Build = 14792544

Im not sure on the embedded PSC, I do know that this command worked just fine before we upgraded to 6.7 (we were on 6.5 previously)

0 Kudos
Highlighted
User Moderator
User Moderator

I would in any case suggest to open a SR.

I'm running that same build and I don't seem to have an issue with Tags.


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

0 Kudos
Highlighted
Contributor
Contributor

I tried, but they said we need to have SDK support in our contract. Working on that now

0 Kudos
Highlighted
User Moderator
User Moderator

That is not true, see PowerCLI Support Breakdown
You can refer GSS to that post.


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

0 Kudos
Highlighted
Enthusiast
Enthusiast

Would you be able to DM me your SR number? I can probably help remedy that issue.

0 Kudos
Highlighted
Contributor
Contributor

kmruddyVMW​ I just sent you the SR via message, I've also notified GSS of the article LucD​ mentioned. Thanks for all your support on this Smiley Happy

0 Kudos
Highlighted
Contributor
Contributor

Hi. Could you please PM the SR as well? We're having the same exact issue (no commands with Tag work). vSphere 6.7 + PowerCLI 11.2. Thank you.

edit: commands tried:

Get-Cluster -tag <tag>

Get-TagAssignment

Get-Tag

In all 3 cases, it gives empty results. The Get-Cluster command works fine when not using the "-tag" flag.

0 Kudos
Highlighted
Enthusiast
Enthusiast

matsss​ - The output you're describing would indicate that you have no vSphere tags created or in use within your environment. Does your environment have any vSphere tags?

0 Kudos
Highlighted
Contributor
Contributor

kmruddyVMW​ - Yes, tags are enabled.

We managed to resolve this issue by enabling delegation for the user/machine. I have no idea why everything worked except for operations involving tags. Our script was fully working if tag commands were disabled, but as soon as you would use tags, that command would fail. As mentioned, "Get-Cluster" worked fine with all flags except "-Tag". Very weird, an explanation would be nice. Everything works correctly now.

0 Kudos
Highlighted
Contributor
Contributor

How / where did you configure this?

0 Kudos