1 2 Previous Next 27 Replies Latest reply on May 18, 2019 9:05 AM by vijaysaiv Go to original post
      • 15. Re: Powercli 6.5 memory leak
        kruddy Enthusiast
        vExpert

        Can we get an output of the following command when you're experiencing the memory leak: Get-Module

        • 16. Re: Powercli 6.5 memory leak
          vijaysaiv Novice

          Here it is:

           

          PowerCLI C:\> Get-Module

           

           

          ModuleType Version    Name                                ExportedCommands

          ---------- -------    ----                                ----------------

          Script     0.0        Initialize-VMware.VimAutomation....

          Script     0.0        Initialize-VMware.VimAutomation....

          Script     0.0        Initialize-VMware.VimAutomation....

          Script     0.0        Initialize-VMware_DeployAutomation

          Script     0.0        Initialize-VMware_VimAutomation_Cis

          Script     0.0        Initialize-VMware_VumAutomation

          Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}

          Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}

          Binary     6.0.0.0    VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...}

          Binary     6.0.0.0    VMware.ImageBuilder                 {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Export-EsxImageProfile...}

          Binary     6.5.0.4... VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}

          Binary     6.5.0.4... VMware.VimAutomation.Cloud          {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...}

          Manifest   6.5.0.4... VMware.VimAutomation.Common

          Binary     6.5.0.2... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostNtpServer...}

          Binary     6.0.0.0    VMware.VimAutomation.HA             Get-DrmInfo

          Binary     7.0.2.4... VMware.VimAutomation.HorizonView    {Connect-HVServer, Disconnect-HVServer}

          Binary     6.5.0.4... VMware.VimAutomation.License        Get-LicenseDataManager

          Binary     6.5.0.4... VMware.VimAutomation.PCloud         {Connect-PIServer, Disconnect-PIServer, Get-PIComputeInstance, Get-PIDatacenter}

          Manifest   6.5.0.4... VMware.VimAutomation.Sdk            Get-PSVersion

          Binary     6.5.0.4... VMware.VimAutomation.Storage        {Copy-VDisk, Export-SpbmStoragePolicy, Get-NfsUser, Get-SpbmCapability...}

          Binary     6.5.0.4... VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup, Export-VDSwitch...}

          Binary     6.5.0.4... VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAlertDefinition...}

          Binary     6.0.0.0    VMware.VumAutomation                {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance...}

          • 17. Re: Powercli 6.5 memory leak
            kruddy Enthusiast
            vExpert

            Is that the setup that's leaking memory?

             

            If so, that's not using PowerCLI 6.5.3.

             

            Your module output should look a little more like this:

            PS C:\Users\kruddy> Get-Module

             

             

            ModuleType Version    Name

            ---------- -------    ----

            Manifest   3.1.0.0    Microsoft.PowerShell.Management

            Manifest   3.1.0.0    Microsoft.PowerShell.Utility

            Script     1.2        PSReadline

            Binary     6.5.1.5... VMware.DeployAutomation

            Binary     6.5.1.5... VMware.ImageBuilder

            Manifest   6.5.3.6... vmware.powercli

            Binary     6.5.3.6... VMware.VimAutomation.Cis.Core

            Binary     6.5.1.5... VMware.VimAutomation.Cloud

            Manifest   6.5.1.5... VMware.VimAutomation.Common

            Binary     6.5.2.6... VMware.VimAutomation.Core

            Binary     6.0.0.5... VMware.VimAutomation.HA

            Binary     7.1.0.5... VMware.VimAutomation.HorizonView

            Binary     6.5.1.5... VMware.VimAutomation.License

            Binary     2.0.0.6... VMware.VimAutomation.Nsxt

            Binary     6.5.1.5... VMware.VimAutomation.PCloud

            Manifest   1.0.0.5... VMware.VimAutomation.Sdk

            Binary     6.5.1.5... VMware.VimAutomation.Srm

            Binary     6.5.1.5... VMware.VimAutomation.Storage

            Script     1.0        VMware.VimAutomation.StorageUtility

            Binary     6.5.1.5... VMware.VimAutomation.Vds

            Binary     6.5.1.5... VMware.VimAutomation.vROps

            Binary     6.5.1.5... VMware.VumAutomation

             

            I would recommending uninstalling your current version of PowerCLI, installing PowerCLI 6.5.3, and trying your script again.

             

            Couple notes:

            • 18. Re: Powercli 6.5 memory leak
              vijaysaiv Novice

              This is the setup where we have PowerCLI 6.5.0 installed. As I mentioned earlier, we see this problem through out PowerCLI 6.5 series. We tried 6.5.1 and 6.5.3, all of them have the same issue.

              The get-module output was from a machine with PowerCLI 6.5.0.

              • 19. Re: Powercli 6.5 memory leak
                kruddy Enthusiast
                vExpert

                Unfortunately, I'm not able to replicate the memory leak with PowerCLI 6.5.3.

                 

                The attached image shows multiple points where I open up PowerShell, connect to the vCenter Server, then run the 'Get-VM' command through a loop 1,000 times.

                 

                The memory fluctuated between 110MB and 202MB, but ended at 113.5MB.

                 

                At this point, I think it would be best to open a support request. Pick a single cmdlet, like Get-VM, and include those results in the support request stating that you believe there's a memory leak. Please also include a link to this thread in the SR.

                 

                If you can then also post the SR number in this thread, I'll be able to help the VMware support team get to the bottom of this.

                 

                Thank you for your patience!

                • 20. Re: Powercli 6.5 memory leak
                  vijaysaiv Novice

                  Thank you.

                  I will try to open a SR. However, can you tell me what would be the difference between PowerCLI 6.0 and PowerCLI 6.5.x? And why the same code behaves differently? Please note that we are calling these scripts from .Net. The same .Net application binary works well with Power CLI 6.0 but not with PowerCLI 6.5. The .net code or the scripts are not changed.

                  • 21. Re: Powercli 6.5 memory leak
                    vijaysaiv Novice

                    Here is the DCPN case # 00046585.

                     

                    We see that the problem is same through all versions of 6.5. We also have provided memory logs.

                    • 22. Re: Powercli 6.5 memory leak
                      ricardo_sanchez Lurker

                      Did you guys ever got to the bottom of this issue? One of our scripts starts off by consuming about 150 MB and gradually increases over time until it reaches 4 GB of ram consumed. I am attaching the output of Get-Module in case it helps. The script itself iterates through a list of VMs calling Get-VM in a for loop to then generate a CSV with a bunch of attributes (IP address, Name, OS, etc.) Pretty standard stuff. The number of VMs is not even 10K.

                       

                      ModuleType Version    Name                                ExportedCommands

                      ---------- -------    ----                                ----------------

                      Script     0.0        Initialize-VMware.VimAutomation....

                      Script     0.0        Initialize-VMware_DeployAutomation

                      Script     0.0        Initialize-VMware_VimAutomation_Cis

                      Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Con...

                      Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}

                      Script     1.2        PSReadline                          {Get-PSReadlineKeyHandler, Get-PSReadlineOption, Remove-PS...

                      Binary     6.0.0.0    VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-D...

                      Binary     6.0.0.0    VMware.ImageBuilder                 {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-Esx...

                      Binary     6.5.0.4... VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}

                      Manifest   6.5.0.4... VMware.VimAutomation.Common

                      Binary     6.5.0.2... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAd...

                      Binary     6.0.0.0    VMware.VimAutomation.HA             Get-DrmInfo

                      Binary     6.5.0.4... VMware.VimAutomation.License        Get-LicenseDataManager

                      Manifest   6.5.0.4... VMware.VimAutomation.Sdk            Get-PSVersion

                      Binary     6.5.0.4... VMware.VimAutomation.Storage        {Copy-VDisk, Export-SpbmStoragePolicy, Get-NfsUser, Get-Sp...

                      Binary     6.5.0.4... VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, E..

                      • 23. Re: Powercli 6.5 memory leak
                        vijaysaiv Novice

                        ricardo_sanchez,

                        Yes. We implemented similar script to identify the issue and it is indeed a memory leak issue in PowerCLI.

                        The issue has been fixed in PowerCLI 10.0 and above. You may want to give a try by upgrading to latest version of PowerCLI.

                        • 24. Re: Powercli 6.5 memory leak
                          ricardo_sanchez Lurker

                          vijaysaiv Thank you for your reply; it is tremendously helpful. I will upgrade to PowerCLI 10 and give it another try.

                          • 25. Re: Powercli 6.5 memory leak
                            vijaysaiv Novice

                            ricardo_sanchez

                            Were you able to upgrade to powercli 10.0 ?

                            • 26. Re: Powercli 6.5 memory leak
                              ricardo_sanchez Lurker

                              Yes, vijaysaiv, thanks again for the tip! I actually upgraded to PowerCli 11.2 but to be honest, I still think there's something incredibly wrong with their implementation - extracting data for a couple hundred VMs takes as much as 900 MB of RAM. In any case, I am good for the time being.

                              • 27. Re: Powercli 6.5 memory leak
                                vijaysaiv Novice

                                Good. But we didn't observe the same on 10.0.

                                1 2 Previous Next