Automation

 View Only
  • 1.  Querying SRM License Information Returns Stale Data

    Posted Jan 02, 2018 07:34 PM

    (Actual LicenseKey, Total, and Used values were changed)  Recently I reclaimed 13 SRM licenses.  Previously there were only 7 free licenses.  Within the GUI, it correctly reflects that there are now 20 free licenses, in the form of 600 Total and 580 Used.  So the product seems to be function correctly.

    However, using the below snippet of code,

                      Process
                      {
                            $srvins = Get-View ServiceInstance -Server $global:DefaultVIServer
                            $licmgr = Get-View -Id $srvins.Content.LicenseManager
                            $licmgr.Licenses
                      }

    nets the old information:

    LicenseKey : xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
    EditionKey : srm.enterprise.vm
    Name       : vCenter Site Recovery Manager Enterprise
    Total      : 600
    Used       : 593
    CostUnit   : vm
    Properties : {LicenseInfo, ProductName, ProductVersion, FileVersion...}
    Labels     :

    I used a new PowerCLI session, added some UpdateView lines as below, but netted the same results as above

                      Process
                      {
                           $srvins = Get-View ServiceInstance -Server $global:DefaultVIServer
                           $srvins.UpdateViewData()
                           $licmgr = Get-View -Id $srvins.Content.LicenseManager
                           $licmgr.UpdateViewData()
                           $licmgr.Licenses
                      }

    I'm guessing I could restart the vmware-license service to "fix" the problem for now, but would like to understand why the code above is failing.  Should I use another approach?  Known issue? Or....?

    Thanks

    JoeA

    POWERCLI Version: 6.5.2.6234650

    Vcenter Version: 6.0.0, Build 4541947

    SRM Version: 6.1.1, Build 4535903



  • 2.  RE: Querying SRM License Information Returns Stale Data

    Posted Jan 02, 2018 07:57 PM

    If you are seeing the correct number of licenses in the Web Client, the issue probably isn't in the LicenseManager service.

    Did you already try disconnecting/connecting to the vCenter before making the call?

    And perhaps stop/start your PowerCLI session as well as a test.



  • 3.  RE: Querying SRM License Information Returns Stale Data

    Posted Jan 02, 2018 08:07 PM
    Thanks for the response Luc.  Yes, fresh power shell windows, vcenter connections, etc.  All anew.  Noticed this a week ago and the issue still persists.


  • 4.  RE: Querying SRM License Information Returns Stale Data

    Posted Jan 02, 2018 08:46 PM

    Can you restart the License Manager service?



  • 5.  RE: Querying SRM License Information Returns Stale Data

    Posted Jan 10, 2018 09:26 PM
    Restarted the entire server today, which of course included the vmware-license service:  The correct information is now displayed via POWERCLI.  


  • 6.  RE: Querying SRM License Information Returns Stale Data

    Posted Jan 10, 2018 09:39 PM

    Next time you see this, I would be interested to know if just restarting the vmware-license service would have been enough.