PowerShell script exchange
Post Reply
DonZoomik
Service Provider
Posts: 372
Liked: 120 times
Joined: Nov 25, 2016 1:56 pm
Full Name: Mihkel Soomere
Contact:

Mapping used license to job/tenant like in GUI license report

Post by DonZoomik »

In GUI there is a convenient view (at least with rental and VCC, I don't currently have access to VUL based-server):
Menu -> License -> Create report

This provides mapping of licensed objects (VMs, Servers..) to backup jobs that is useful for billing.
However I can't replicate this view easily via PowerShell, Get-VBRLicensedInstanceWorkload only returns VM name and some ID that does not always map to anything obvious. Name-based matching is bad when you can't control VM names and duplicates are possible.

After poking around various methods, for VMs I found an awkward mapping via Backup object's GetObjectIds() method that returns ID-s that were included in backup storage (but nothing on Job).
For agent-based stuff I haven't found anything useful.
For VCC Get-VBRLicensedInstanceWorkload returns nothing.

Is there an easy way to replicate the reports (or at least query the data that report uses) in PowerShell? There's problably some .Net class that exposes this information.
Mildur
Product Manager
Posts: 9848
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Mapping used license to job/tenant like in GUI license report

Post by Mildur »

Hi Mihkel
For VCC Get-VBRLicensedInstanceWorkload returns nothing.
At least this report you can get from a VSPC REST API call. This API call will give you a list of the used Rental licenses for cloud connect:
https://helpcenter.veeam.com/docs/vac/r ... ingReports

For the other data, have you tried to get the information over the VSPC REST API?
I used the REST API to do my reports when I was working for a cloud service provider.
It's not a single query, you have to do multiple queries and then link the result together.
But it's possible this way to get a list of all agents and vm backups with their job name. Filtered by the machines which have backups in the last 31 days, and you have the value you need for billing each customer.

Thanks
Fabian
Product Management Analyst @ Veeam Software
DonZoomik
Service Provider
Posts: 372
Liked: 120 times
Joined: Nov 25, 2016 1:56 pm
Full Name: Mihkel Soomere
Contact:

Re: Mapping used license to job/tenant like in GUI license report

Post by DonZoomik » 1 person likes this post

Haven't tried VCSP REST yet. Will give it a try, thanks.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Mapping used license to job/tenant like in GUI license report

Post by oleg.feoktistov » 1 person likes this post

Hi Mihkel,

I also think that the best way in your case would be VCSP REST API.
I mean, there are some unsupported methods in DBManager, which could help you get this type of report via VBR Powershell/.NET, but one of them returns cached data for the previous months and the other uses an argument, which could be calculated with internal methods only (they cannot be invoked via Powershell framework).
Example with cached data report:

Code: Select all

[Veeam.Backup.DBManager.CDBManager]::Instance.Licensing.Reports.GetCachedReportTable(2022, 9, $false)
Best regards,
Oleg
DonZoomik
Service Provider
Posts: 372
Liked: 120 times
Joined: Nov 25, 2016 1:56 pm
Full Name: Mihkel Soomere
Contact:

Re: Mapping used license to job/tenant like in GUI license report

Post by DonZoomik »

I've looked at VCSP only in passing so far and now going deeper, it currently seems a bit of an overkill for our business needs. I'll definitely keep an eye on it as it does have some nice features.

But that method is very useful and gives exactly what I need. Cloud Connect version is a bit cryptic and but I can make it work. The caching part is not a problem as the billing cycle is monthly anyways.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests