Migration underway from vSphere 6.5 to 7.0 (ESXi 6.5 to 7.0U2 and vCenter 6.5 to 7.0U3).
I refreshed my PowerCLI and set about to validate production scripts. I find no useful way to fix Get-TagCategory. Why is it not working? Any tips to get better debugging information other than:
Error is + CategoryInfo : ObjectNotFound: (:) [Get-TagCategory], VimException + FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetTagCategory
The working vSphere 6.5 environment does not have Enhanced Linked Mode (ELM) vCenters. The vCenter 7 are using ELM.
Here is some test code:
#Working vSphere 6.5 Disconnect-VIServer -Server * -Confirm:$false Set-PowerCLIConfiguration -scope Session -ParticipateInCeip $false -InvalidCertificateAction Ignore -DefaultVIServerMode Single -Confirm:$false Connect-VIServer -Server avcenter.corp.mycorp.com -AllLinked:$false $CatAv = Get-TagCategory -Name "CommVaultBackup" -Server avcenter.corp.mycorp.com Write-Host $CatAv #Fails vSphere 7.0 vCenter ELM Disconnect-VIServer -Server * -Confirm:$false Set-PowerCLIConfiguration -scope Session -ParticipateInCeip $false -InvalidCertificateAction Ignore -DefaultVIServerMode Multiple -Confirm:$false Connect-VIServer -Server pvcenter.corp.mycorp.com -AllLinked:$true $CatPv = Get-TagCategory -Name "CommVaultBackup" -Server pvcenter.corp.mycorp.com Write-Host $CatPv |
Here is the console output:
PowerCLI C:\users\gperkins\Downloads> get-powercliversion PowerCLI Version ---------------- VMware PowerCLI 6.5 Release 1 build 4624819 --------------- Component Versions --------------- VMware Cis Core PowerCLI Component 6.5 build 4624453 VMware VimAutomation Core PowerCLI Component 6.5 build 4624450 VMWare ImageBuilder PowerCLI Component 6.5 build 4561891 VMWare AutoDeploy PowerCLI Component 6.5 build 4561891 VMware Vds PowerCLI Component 6.5 build 4624695 VMware Cloud PowerCLI Component 6.5 build 4624821 VMware HA PowerCLI Component 6.0 build 4525225 VMware HorizonView PowerCLI Component 7.0.2 build 4596620 VMware Licensing PowerCLI Component 6.5 build 4624822 VMware PCloud PowerCLI Component 6.5 build 4624825 VMware Storage PowerCLI Component 6.5 build 4624820 VMware vROps PowerCLI Component 6.5 build 4624824 VMware vSphere Update Manager PowerCLI 6.5 build 4540462 PowerCLI C:\users\gperkins\Downloads> .\test_Get-TagCategory.ps1 Scope ProxyPolicy DefaultVIServerMode InvalidCertificateAction DisplayDeprecationWarnings WebOperationTimeout Seconds ----- ----------- ------------------- ------------------------ -------------------------- ------------------- Session UseSystemProxy Single Ignore True 300 User Multiple Ignore AllUsers Ignore IsConnected : True Id : /VIServer=mycorp\myadmin@avcenter.corp.mycorp.com:443/ ServiceUri : https://avcenter.corp.mycorp.com/sdk SessionSecret : "e698878ecc66220e3a6f88d24c51f28bca44cad6" Name : avcenter.corp.mycorp.com Port : 443 SessionId : "e698878ecc66220e3a6f88d24c51f28bca44cad6" User : MYCORP\myadmin Uid : /VIServer=mycorp\myadmin@avcenter.corp.mycorp.com:443/ Version : 6.5 Build : 19261680 ProductLine : vpx InstanceUuid : 492e731b-e2cb-42a3-ae91-5d61cd216133 RefCount : 1 ExtensionData : VMware.Vim.ServiceInstance Client : VMware.VimAutomation.ViCore.Impl.V1.VimClient CommVaultBackup Session UseSystemProxy Multiple Ignore True 300 User Multiple Ignore AllUsers Ignore IsConnected : True Id : /VIServer=mycorp\myadmin@pvcenter.corp.mycorp.com:443/ ServiceUri : https://pvcenter.corp.mycorp.com/sdk SessionSecret : "b9a3aefeeac8bc0c81b1dbdc238d2b0479b69fc6" Name : pvcenter.corp.mycorp.com Port : 443 SessionId : "b9a3aefeeac8bc0c81b1dbdc238d2b0479b69fc6" User : MYCORP\myadmin Uid : /VIServer=mycorp\myadmin@pvcenter.corp.mycorp.com:443/ Version : 7.0.3.0 Build : 19480866 ProductLine : vpx InstanceUuid : 2dd4f3d7-b5bb-40a3-b83a-f2435c5b06c2 RefCount : 1 ExtensionData : VMware.Vim.ServiceInstance Client : VMware.VimAutomation.ViCore.Impl.V1.VimClient IsConnected : True Id : /VIServer=mycorp\myadmin@svcenter.corp.mycorp.com:443/ ServiceUri : https://svcenter.corp.mycorp.com/sdk SessionSecret : "079aef7373490c531386129e262248c1e4a8dca3" Name : svcenter.corp.mycorp.com Port : 443 SessionId : "079aef7373490c531386129e262248c1e4a8dca3" User : MYCORP\myadmin Uid : /VIServer=mycorp\myadmin@svcenter.corp.mycorp.com:443/ Version : 7.0.3.0 Build : 19480866 ProductLine : vpx InstanceUuid : 6e2ebdbf-949c-4ad9-a70e-86e3f790789c RefCount : 1 ExtensionData : VMware.Vim.ServiceInstance Client : VMware.VimAutomation.ViCore.Impl.V1.VimClient
Get-TagCategory : 7/22/2022 11:39:10 AM Get-TagCategory 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]}], 'data':} At C:\users\gperkins\Downloads\test_Get-TagCategory.ps1:11 char:10 + $CatPv = Get-TagCategory -Name "CommVaultBackup" -Server pvcenter.cor ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-TagCategory], CisException + FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Impl.V1.Service.Tagging.Cis.TaggingServiceCisImpl.GetCategory.Error,VMware.VimAutomat ion.ViCore.Cmdlets.Commands.Tagging.GetTagCategory Get-TagCategory : 7/22/2022 11:39:10 AM Get-TagCategory TagCategory with name 'CommVaultBackup' was not found using the specified filter(s). At C:\users\gperkins\Downloads\test_Get-TagCategory.ps1:11 char:10 + $CatPv = Get-TagCategory -Name "CommVaultBackup" -Server pvcenter.cor ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (:) [Get-TagCategory], VimException + FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetTagCategory |