VMware Cloud Community
jrr001
Enthusiast
Enthusiast

get-vm -tag tagname no longer working

get-vm -tag Backup_Setup_Request or other tag request return this error for all vmadmins that it has worked for. vcenter 7.0u3J not working, vcenter 7.0u3I works. Been working and just stopped

et-vm -tag Backup_Setup_Request
get-vm : 4/21/2023 9:11:05 AM Get-VM 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': [], 'params': , 'localized':}], 'data': , 'error_type': UNAUTHENTICATED, 'challenge': Basic realm="VAPI endpoint",SIGN
realm=aae8c893a960e90321598339928e6e7b6acaec07,service="VAPI endpoint",sts="https://vcenter.xx.xx.xx/sts/STSService/vsphere.local",SIGN
realm=f30c097f56e939aacddb0290232ef66166802bbc,service="VAPI endpoint",sts="https://vcenter.xx.xx.xx/sts/sts/STSService/vsphere.local",SIGN
realm=ddaf37b026cf0a6812d24e6630e138618670a4d2,service="VAPI endpoint",sts="https://vcenter.xx.xx.xx/sts/sts/STSService/vsphere.local"}.

Name Value
---- -----
PSVersion 5.1.19041.2673
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.2673
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Labels (2)
Tags (1)
0 Kudos
14 Replies
LucD
Leadership
Leadership

Still working for me with PowerCLI 13.1
But that 'unauthenticated' error often indicates an issue with your PS session or the Inventory Service on the VCSA.

Did you already stop/start your PS/PowerCLI session?
Is the Inventory Service running on the VCSA?
Can you restart the INventory Service?
Can you restart the VCSA?


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

0 Kudos
ThePusher
Contributor
Contributor

We are also experiencing this issue! We are currently on vCenter Server 7.0 Update 3l

We have been restarting all the services to resolve the issue.....and only notice it because out daily reports depend on tags to report capacity across our environment. 

Is there a more permanent resolution to this issue?

Thanks!

0 Kudos
LucD
Leadership
Leadership

Can you try with the CisTag module?
See New Community Module for Tag Management - VMware PowerCLI Blog


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

BrettK1
Enthusiast
Enthusiast

We also are experiencing this issue with 7.0u3J (using get-tag).
Tested from multiple machines with PowerCLI 12.1, 13, 13.1.

I opened a ticket with VMWare, who also experienced errors with get-tag (though upon review, the error they received was different from ours), and suggested opening a ticket with the SDK team.  I have inquired further about that.

 

 

Edit: 'Can you try with the CisTag module?'  - I have not tried this, but as I was just recently reading about the Rest API tagging system and wanted to try it, I may grab this for testing

0 Kudos
ThePusher
Contributor
Contributor

our ticket lead us to increasing the heap memory of the vmware-infraprofile service....we had to go through a couple levels of engineer to get to that point. Good luck!

LucD
Leadership
Leadership

If GSS claims you need a Developer Support contract for PowerCLI support, that is not true.
See this reply from the PowerCLI Team Leader
Solved: Re: Powercli NSX module not loading expression for... - VMware Technology Network VMTN


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

BrettK1
Enthusiast
Enthusiast

Amusingly, GSS said 'You need SDK support' AFTER I sent him those links, and that this should clearly fall under 'Cmdlets are not working as documented’.  Silly for our TAM to have to deal with things like this.

0 Kudos
LucD
Leadership
Leadership

Perhaps your TAM should contact Kamen 😉


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

0 Kudos
BrettK1
Enthusiast
Enthusiast

I suggested he sick Kamen on GSS 🙂

0 Kudos
SanjayJadhav1
Contributor
Contributor

This will work in errors:

Get-Tag : 10/4/2023 10:58:13 PM  Get-Tag    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': [], 'params': , 'localized':}], 
'data': , 'error_type': UNAUTHENTICATED, 'challenge': Basic realm="VAPI endpoint",SIGN realm=bf65334c0a59e5278a13e2db7d6c81fe9945793c,service="VAPI 
endpoint"

 

Increasing the memory for the vmware-infraprofile service should prevent future OOM(Out of memory) messages

Get the current memory allocated to the service
# cloudvm-ram-size -l | grep vmware-infraprofile

Example: vmware-infraprofile = 332

Doubling the memory should be enough to fix the issue, however in case it does not fix it you can further increase the memory.
# cloudvm-ram-size -C 664 vmware-infraprofile

Check the memory status again to confirm the change
# cloudvm-ram-size -l | grep vmware-infraprofile

Example: vmware-infraprofile = 684

Then restart the infraprofile service
# service-control --stop vmware-infraprofile && service-control --start vmware-infraprofile

Workaround
Restart the image infraprofile service may fix the issue until the service has OOM again
# service-control --stop vmware-infraprofile && service-control --start vmware-infraprofile

0 Kudos
antize1
Contributor
Contributor

Just ran into the same error this week. Get-Tag has abruptly stopped working. It takes a long time to run and returns this (note place holders for realm/FQDN) -

 

Get-Tag: 10/19/2023 1:45:25 PM Get-Tag 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': [], 'params': , 'localized':}], 'data': , 'error_type': UNAUTHENTICATED, 'challenge': Basic realm="VAPI endpoint",SIGN realm=<ID>,service="VAPI endpoint",sts="https://<FQDN>/sts/STSService/vsphere.local"}.

 

I saw the community module that calls the REST API so I tried out my own version using the REST API and it works fine. So I'm not sure what else the PowerCLI Get-Tag cmdlet is doing that is causing the problem... Here's my little test that works fine - 

 

function Get-vSphereTag {
	param ([string] $vSphereApiSessionID)
	$api_header = @{'vmware-api-session-id' = $vSphereApiSessionID}
​
	Invoke-RestMethod -Uri "$api_base_url/cis/tagging/tag" -Headers $api_header | ForEach-Object {
		$_ | ForEach-Object {
			Invoke-RestMethod -Uri "$api_base_url/cis/tagging/tag/$_" -Headers $api_header
		}
	}
}

 

 

RichardN1
Contributor
Contributor

how much did you increase the memory allocation for vmware-infraprofile? did you see some errors in vcsa logs related to this (vpxd, infraprofile ..etc)? did you see this happen since then?

0 Kudos
kamennikolov
Contributor
Contributor

This issue has been fixed in PowerCLI 13.2, so if you update you won't need to increase the memory allocation.

RichardN1
Contributor
Contributor

thank you Kamen, looks promising, I'll will give it a go

0 Kudos