Error while fetching TAG details from PowerShell
search cancel

Error while fetching TAG details from PowerShell

book

Article ID: 340946

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
Getting below error while fetching TAG details from powershell.


C:\Users\Administrator> Get-vm <VM-name> | Get-TagsAssignment

"Get-TagAssignment com.vmware.vapi.std.errors.service_unavailable {'messages': [com.vmware.vapi.std.localizable_message {'id': com.vmware.vapi.endpoint.failedToLoginMaxSessionCountReached, 'default_message': Sessions count is limited to 1000. Existing sessions are 1000., 'args': [1000, 1000]}], 'data':}.





Environment

VMware vCenter Server 6.7.x
VMware vCenter Server 7.0.x
VMware vCenter Server 6.5.x

Cause

Two reasons why the PowerShell Command failed
  1. Account which is used to connect vCenter instance does not have sufficient privilege
  2. Maximum session count exceeded 

Note: endpoint.log will complain about maximum session count

Resolution

  • From the power shell, use '[email protected]' account or use account which has administrative privilege to connect vCenter instance 
  • Take a backup of : /etc/vmware-vapi/endpoint.properties
              #cp /etc/vmware-vapi/endpoint.properties /etc/vmware-vapi/endpoint.properties.backup
 
  • edit and comment out this line using vi editor 
            # vi /etc/vmware-vapi/endpoint.properties

  original:        session.maxSessionCount=1000

  modified:   # session.maxSessionCount=1000

  • Restart the vmware-vapi-endpoint service 
                  #service-control --stop vmware-vapi-endpoint && service-control --start vmware-vapi-endpoint

Additional Information

Impact/Risks:
Would not get desired tag information output from PowerShell command.