VMware Cloud Community
jacosta
Enthusiast
Enthusiast

Querying SRM License Information Returns Stale Data

(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

0 Kudos
5 Replies
LucD
Leadership
Leadership

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.


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

0 Kudos
jacosta
Enthusiast
Enthusiast

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.
0 Kudos
LucD
Leadership
Leadership

Can you restart the License Manager service?


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

0 Kudos
jacosta
Enthusiast
Enthusiast

Restarted the entire server today, which of course included the vmware-license service:  The correct information is now displayed via POWERCLI.  
0 Kudos
LucD
Leadership
Leadership

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


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

0 Kudos