VMware Cloud Community
hideyori
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)
Reply
0 Kudos
33 Replies
mragland
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

Reply
0 Kudos
LucD
Leadership
Leadership

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


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

Reply
0 Kudos
mragland
Contributor
Contributor

Yes, this was a brand new session

Reply
0 Kudos
LucD
Leadership
Leadership

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

Reply
0 Kudos
mragland
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)

Reply
0 Kudos
LucD
Leadership
Leadership

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

Reply
0 Kudos
mragland
Contributor
Contributor

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

Reply
0 Kudos
LucD
Leadership
Leadership

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


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

Reply
0 Kudos
kmruddyVMW
Enthusiast
Enthusiast

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

Reply
0 Kudos
mragland
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

Reply
0 Kudos
matsss
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.

Reply
0 Kudos
kmruddyVMW
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?

Reply
0 Kudos
matsss
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.

Reply
0 Kudos
Levin1
Contributor
Contributor

How / where did you configure this?

Reply
0 Kudos