12 Replies Latest reply on Nov 29, 2018 1:47 AM by Dimon_SPB

    Why are vSphere tagging operations in 6.5 so slow ?

    dr_uk Lurker

      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.

        • 1. Re: Why are vSphere tagging operations in 6.5 so slow ?
          LucD Guru
          Community WarriorsUser ModeratorsvExpert

          Which PowerCLI version are you using for manipulating the Tags?

          • 2. Re: Why are vSphere tagging operations in 6.5 so slow ?
            dr_uk Lurker

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

            • 3. Re: Why are vSphere tagging operations in 6.5 so slow ?
              LucD Guru
              User ModeratorsCommunity WarriorsvExpert

              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

              • 4. Re: Why are vSphere tagging operations in 6.5 so slow ?
                vpaw Novice

                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?

                • 5. Re: Why are vSphere tagging operations in 6.5 so slow ?
                  BenConrad Master

                  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 :
                  • 6. Re: Why are vSphere tagging operations in 6.5 so slow ?
                    LucD Guru
                    vExpertUser ModeratorsCommunity Warriors

                    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.

                    • 7. Re: Why are vSphere tagging operations in 6.5 so slow ?
                      Dimon_SPB Novice

                      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.

                      • 8. Re: Why are vSphere tagging operations in 6.5 so slow ?
                        Dimon_SPB Novice

                        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
                        • 9. Re: Why are vSphere tagging operations in 6.5 so slow ?
                          LucD Guru
                          Community WarriorsvExpertUser Moderators

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

                          • 10. Re: Why are vSphere tagging operations in 6.5 so slow ?
                            Dimon_SPB Novice

                            Oh, I'm so sorry.

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

                            • 11. Re: Why are vSphere tagging operations in 6.5 so slow ?
                              LucD Guru
                              Community WarriorsvExpertUser Moderators

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

                              • 12. Re: Why are vSphere tagging operations in 6.5 so slow ?
                                Dimon_SPB Novice
                                Your module did not use. It is common PowerCLI problem