dr_uk
Contributor
Contributor

Why are vSphere tagging operations in 6.5 so slow ?

Hi,

We make heavy use of the vSphere tagging functionality.  Before upgrading our environment from 5.5 to 6.5, tagging operations using PowerCLI were very fast - eg   New-TagAssignment.

Since the 6.5 upgrade, tagging operations are painfully slow on all vCenters.  Assigning a single tag to single object takes ~10 seconds.

Has anyone else experienced this and found a remedy ?

 

Thanks.

0 Kudos
12 Replies
LucD
Leadership
Leadership

Which PowerCLI version are you using for manipulating the Tags?


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

0 Kudos
dr_uk
Contributor
Contributor

Hi Luc - I am using   VMware PowerCLI 6.5 Release 1 build 4624819

0 Kudos
LucD
Leadership
Leadership

I would strongly suggest to go for the latest (10.1.0) release, tag cmdlets have seriously improved.
And since 10.0.0, the tag cmdlets work with the REST API :smileycool:


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

0 Kudos
vpaw
Contributor
Contributor

I'm seeing similar issues no matter what language or method we use to access tags in our 6.5 vCenter.  It's terribly slow via Powershell (10.1.0), Javascript from vRO, or even right in the web UI.  I don't have these issues when I query a 5.5 vCenter.  Is anyone else experiencing this?

0 Kudos
BenConrad
Expert
Expert

Yes, even getting a tag is so slow:

 C:\> 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

 

 C:\> measure-command { $vmHostObj | get-datastore -tag 'Internal Production' -verbose:$false -server $viserver }

 

TotalSeconds      : 36.188923

 C:\> $vmHostObj | get-datastore | measure-object

Count    : 34

 

 C:\> 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
 
 
 
 C:\> measure-command { $vmHostObj | get-datastore -tag 'Internal Production' -verbose:$false -server $viserver }
 
 
Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 36
Milliseconds      : 188
Ticks             : 361889230
TotalDays         : 0.000418853275462963
TotalHours        : 0.0100524786111111
TotalMinutes      : 0.603148716666667
TotalSeconds      : 36.188923
TotalMilliseconds : 36188.923
 
 
 
 C:\> $vmHostObj | get-datastore | measure-object
 
 
Count    : 34
Average  :
Sum      :
Maximum  :
Minimum  :
Property :
0 Kudos
LucD
Leadership
Leadership

I would suggest to upgrade your PowerCLI version.

More recent versions of PowerCLI use the REST API to interact with tags, that should be faster.

As an alternative, you can have a look at my rCisTag module, which also uses the REST API.


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

0 Kudos
Dimon_SPB
Contributor
Contributor

Hi. I use VMware.VimAutomation.Core  -    11.0.0., but stil slowly.

get-vm command it is carried out in 14 seconds

get-vm | Sort Name | Get-TagAssignment –Category "Creator" is about 55 seconds.

0 Kudos
Dimon_SPB
Contributor
Contributor

But once from 50 at implementation of the same command gives an error message of reading tags

Get-TagAssignment : 28.11.2018 13:45:58 Get-TagAssignment Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
At line:1 char:47
+ ...  = (get-vm | Get-TagAssignment –Category $CPUlevelTAGcategory) | Wher ...
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-TagAssignment], CisException
    + FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Impl.V1.Service.Tagging.Cis.TaggingServiceCisImpl.GetTagAssignment.Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetTagAss 
   ignment
 
Get-TagAssignment : 28.11.2018 13:45:58 Get-TagAssignment Value cannot be null.
Parameter name: collection
At line:1 char:47
+ ...  = (get-vm | Get-TagAssignment –Category $CPUlevelTAGcategory) | Wher ...
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-TagAssignment], VimException
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetTagAssignment

 

Get-TagAssignment : 28.11.2018 13:45:58 Get-TagAssignment Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
At line:1 char:47
+ ...  = (get-vm | Get-TagAssignment –Category $CPUlevelTAGcategory) | Wher ...
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-TagAssignment], CisException
    + FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Impl.V1.Service.Tagging.Cis.TaggingServiceCisImpl.GetTagAssignment.Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetTagAss 
   ignment
 
Get-TagAssignment : 28.11.2018 13:45:58 Get-TagAssignment Value cannot be null.
Parameter name: collection
At line:1 char:47
+ ...  = (get-vm | Get-TagAssignment –Category $CPUlevelTAGcategory) | Wher ...
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-TagAssignment], VimException
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetTagAssignment
0 Kudos
LucD
Leadership
Leadership

Do you get the same errors with the cmdlets from my rCisTag module?


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

0 Kudos
Dimon_SPB
Contributor
Contributor

Oh, I'm so sorry.

this problem to belong not to your module, and in general to work with tags

0 Kudos
LucD
Leadership
Leadership

I just wanted to know if you tried my module.
The cmdlets in there tend to be faster and more robust.


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

0 Kudos
Dimon_SPB
Contributor
Contributor

Your module did not use. It is common PowerCLI problem
0 Kudos