Automation

 View Only
Expand all | Collapse all

get-tagassignment error after vcenter upgrade

LucD

LucDJun 02, 2021 04:14 PM

  • 1.  get-tagassignment error after vcenter upgrade

    Posted Mar 23, 2021 01:07 PM

    We have two datacenters and thus two vCenter environments. Recently one DC received an update from vCenter 7.0.1 to 7.0.2. The other one is still on 7.0.1.
    On the upgraded environment the get-tagassignment and get-tag commands now error out :

     

     

    get-vm alani001|get-tagassignment
    
    Get-TagAssignment: 3/23/2021 1:13:50 PM Get-TagAssignment               com.vmware.vapi.std.errors.operation_not_found {'messages': [com.vmware.vapi.std.localizable_message {'id': vapi.method.input.invalid.interface, 'default_message': Cannot find service 'com.vmware.cis.data.svc.resource_model'., 'args': [com.vmware.cis.data.svc.resource_model], 'params': , 'localized':}], 'data': , 'error_type': OPERATION_NOT_FOUND}

     

     

    Is this a known issue, and if so, what can we do to resolve this, please ?

    Before I forget, I tried this on both PowerCLI on Windows (v. 6.5.1) and Linux (v. 12.0). Both go wrong....



  • 2.  RE: get-tagassignment error after vcenter upgrade

    Posted Mar 23, 2021 02:04 PM

    Is your environment and vCenter configured in En-US or a local language?
    PowerCLI 6.5.1?
    That is a very old version, I suggest you upgrade that version.



  • 3.  RE: get-tagassignment error after vcenter upgrade

    Posted Mar 23, 2021 03:41 PM

    Already asked our Wintel guys to hurry up and upgrade PowerCLI asap......

    But..the error also occurs when I do the same on Linux in Powershell Core and PowerCLI 12.0.0

    vCenter is configured EN-US.

    And yes, after starting a fresh powershell session and reissuing the command get-vm alani001 | get-tagassignment, I do get the right output, but only in Linux, NOT in Windows...

    I'm curious why you asked that question, and more curious to the solution it leads to...



  • 4.  RE: get-tagassignment error after vcenter upgrade

    Posted Mar 23, 2021 03:49 PM

    There have been cases reported when a PS/PowerCLI got corrupted, and a restart helped.

    I'm afraid I have no solution, I would advise opening an SR.



  • 5.  RE: get-tagassignment error after vcenter upgrade

    Posted Mar 23, 2021 02:14 PM

    Does the error return after you stop your PowerShell/PowerCLI session and start it again?



  • 6.  RE: get-tagassignment error after vcenter upgrade

    Posted Apr 08, 2021 08:18 AM

    We ran into same issue after VSCA 7.0.2 upgrade, we are going to open SR.

    PS W:\> get-tagassignment
    get-tagassignment : 4/8/2021 10:13:23 AM Get-TagAssignment com.vmware.vapi.std.errors.operation_not_found {'messages': [com.vmware.vapi.std.localizable_message {'id':
    vapi.method.input.invalid.interface, 'default_message': Cannot find service 'com.vmware.cis.data.svc.resource_model'., 'args': [com.vmware.cis.data.svc.resource_model], 'params': ,
    'localized':}], 'data': , 'error_type': OPERATION_NOT_FOUND}
    At line:1 char:1
    + get-tagassignment
    + ~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Get-TagAssignment], CisException
    + FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Impl.V1.Service.Tagging.Cis.TaggingServiceCisImpl.GetTagAssignment.Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetT
    agAssignment



  • 7.  RE: get-tagassignment error after vcenter upgrade

    Posted Apr 21, 2021 02:38 PM

    Yes, we have the same problem. After upgrading vCenter 7.0.1 to 7.0.2 we can not read or write the tags. All other information like name, network, notes we can read.

    Different PowerShell versions on Windows 10, Windows Server and linux clients tried. All have the same issue:

     

    PS V:\> (Get-TagAssignment -Entity $vm -Category "Administator").Tag
    Get-TagAssignment : 21.04.2021 15:09:09 Get-TagAssignment Der Wert darf nicht NULL sein.
    Parametername: collection
    In Zeile:1 Zeichen:2
    + (Get-TagAssignment -Entity $vm -Category "Administator").Tag
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Get-TagAssignment], VimException
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetTag
    Assignment

    PS V:\> Get-TagAssignment -Entity $vm
    Get-TagAssignment : 21.04.2021 15:10:17 Get-TagAssignment com.vmware.vapi.std.errors.operation_not_found {'messages':
    [com.vmware.vapi.std.localizable_message {'id': vapi.method.input.invalid.interface, 'default_message': Cannot find
    service 'com.vmware.cis.data.svc.resource_model'., 'args': [com.vmware.cis.data.svc.resource_model], 'params': ,
    'localized':}], 'data': , 'error_type': OPERATION_NOT_FOUND}
    In Zeile:1 Zeichen:1
    + Get-TagAssignment -Entity $vm
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Get-TagAssignment], CisException
    + FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Impl.V1.Service.Tagging.Cis.TaggingServiceCisImpl.GetTagAssi

    gnment.Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetTagAssignment



  • 8.  RE: get-tagassignment error after vcenter upgrade

    Posted Apr 22, 2021 01:19 PM

    Updating to Powercli 12.3.0 solved the issue for us.:

    https://code.vmware.com/web/tool/12.3.0/vmware-powercli



  • 9.  RE: get-tagassignment error after vcenter upgrade

    Posted Apr 22, 2021 01:50 PM

    No changes . The Powercli-Module was on Windows-client already with version 12.3.

    PS V:\> Find-Module *powercli

    Version Name Repository Description
    ------- ---- ---------- -----------
    12.3.0.... VMware.PowerCLI PSGallery This Windows PowerShell module contains VMware.P...

     

    Also tried with downloaded powercli-Script

     



  • 10.  RE: get-tagassignment error after vcenter upgrade

    Posted Apr 22, 2021 02:09 PM

    Not sure if it helps, but I ran upgrade with -force parameter and it didn't work until I rebooted the machine. 



  • 11.  RE: get-tagassignment error after vcenter upgrade

    Posted Apr 22, 2021 02:26 PM

    Yes. First -force install grumbles some of the modules are in use. Reboot, install again with -force no problems. Reboot again. Now it works.



  • 12.  RE: get-tagassignment error after vcenter upgrade

    Posted Jun 02, 2021 12:48 PM

    hello

    our vcenter was updated to 6.7.0.48 and "get-tag" command have the same error. 

    1. powercli on pc was updated to 12.3

    2. pc rebooted 

    result: not successful

    3. deleted vmware Modul - rebooted pc - install vmware modul - rebooted pc

    result: not successful again

     

    pls help



  • 13.  RE: get-tagassignment error after vcenter upgrade

    Posted Jun 02, 2021 04:14 PM

    I suggest opening an SR



  • 14.  RE: get-tagassignment error after vcenter upgrade

    Posted Jul 05, 2021 08:35 AM

    PA3CRZ,
    Did you open an SR? What's the status now?

     

    Lars



  • 15.  RE: get-tagassignment error after vcenter upgrade

    Posted Jul 21, 2021 10:34 AM

    Has anyone been able to find a way to get this working. I am having the same issue. 



  • 16.  RE: get-tagassignment error after vcenter upgrade

    Posted Jul 21, 2021 02:29 PM

    jrodriguez00,

    Not sure what OP did, but I opened SR 21235836807 and support has opened a PR with engineering.

    Lars



  • 17.  RE: get-tagassignment error after vcenter upgrade

    Posted Sep 29, 2021 08:03 AM

    It seems that the tag commands work fine on Windows Server 2019, but not on 2012R2.

     

    Lars



  • 18.  RE: get-tagassignment error after vcenter upgrade

    Posted Oct 08, 2021 11:12 AM

    Hi, has anyone found a solution for this? We still have this problem by using PowerCLI 12.4.0.18633274 and Windows Server 2016. Thanks for any help



  • 19.  RE: get-tagassignment error after vcenter upgrade

    Posted Nov 12, 2021 07:48 AM

    Maybe this has something to do with the Powershell version.

    On Server 2012R2 you get

    > $PSVersionTable.PSVersion

    Major Minor Build Revision
    ----- ----- ----- --------
    5 0 10586 117

    Windows 10 (1909):  5 1 18362 1801

    Windows 10 (21H1):  5 1 19041 1320

    Server 2019: 5 1 17763 2268

    Linux ($ pwsh --version): PowerShell 7.2.0

     

    Server 2012 R2 is out of date. I cannot test which version you have on Server 2016.



  • 20.  RE: get-tagassignment error after vcenter upgrade

    Posted Nov 12, 2021 08:05 AM

    Hi,

    thanks for your reply. You're right, after I updated the Powershell version the script works again.

    $PSVersionTable.PSVersion

    Major Minor Build Revision
    ----- ----- ----- --------
    5 1 14393 4583

     



  • 21.  RE: get-tagassignment error after vcenter upgrade

    Posted Sep 09, 2022 07:18 AM

    I too ran into the same issue as the OP, running an almost identical one-liner. Googled the error and found this thread. 

    Updated to the latest supported version of PowerCLI for our environment (12.7) and it's resolved this error for me.

    Thanks, all.