Skip to content
Luca Dell'Oca Principal Cloud Architect @Veeam
Virtual To The Core Virtual To The Core

Virtualization blog, the italian way.

Virtual To The Core
Virtual To The Core

Virtualization blog, the italian way.

Cloud Connect automatic usage reporting

Luca Dell'Oca, February 12, 2019February 11, 2019

Veeam Cloud Connect allows service providers to charge their costumers on the base of multiple parameters, but together with used space license consumption is surely one of the most common. This script allows service providers to configure an automatic usage reporting.

Manual report

In the user interface, the way to check the usage of Veeam Cloud Connect is via the console: by opening the main menu and selecting License, the operator can reach this info box:

By hitting the button Report… an additional box appears:

From here, providers can print or save the report as a pdf or as a json file (for further processing).

But, obviously, it’s way better to automate the entire process, and that’s what this script does.

 

The script

$vbrserver = "vbr.domain.local"
$vbruser = "Administrator"
$vbrpwd = "password"

asnp "VeeamPSSnapIn" -ErrorAction SilentlyContinue

Connect-VBRServer -Server $vbrserver -User $vbruser -Password $vbrpwd

$csvFileName = "vcc_report.csv"
$tenantlist = Get-VBRCloudTenant
$results = @()

foreach ($tenant in $tenantlist) {
        $details = [ordered]@{           
                Tenant           = $tenant
                VM_Backup        = $Tenant.VMCount
                VM_Replica       = $tenant.ReplicaCount
                Wks_Backup       = $tenant.WorkstationCount
                Srv_Backup       = $tenant.ServerCount
        }                          
        $results += New-Object PSObject -Property $details
    }

$results | export-csv -Path $csvFileName -NoTypeInformation

Disconnect-VBRServer

 

The script connects to the Cloud Connect server, retrieves the list of the tenants, and for each of them reads the amount of the consumed licenses for each type of protected resources: Backup VM, Replica VM, workstations and Servers. Then, puts all those data into a CSV file that is formatted like this:

"Tenant","VM_Backup","VM_Replica","Wks_Backup","Srv_Backup"
"Tenant3","1","0","0","0"
"Tenant1","3","0","0","0"
"Tenant2","1","0","0","0"

You can then parese the CSV file with any exernal tool, from simple Microsoft Excel to different chargeback/billing systems.

NOTE: if you want to obtain the same information via API, please note there’s a hotfix to be applied to the Veeam Enterprise Manager server on top of 9.5 Update 4. Please ask Veeam support for the bits and be sure that the starting point is an installation with version 9.5.4.2615.

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • Email
  • Tumblr
  • Pinterest
  • Reddit
  • WhatsApp
  • Pocket
Tech automationcloud connectpowershellreportingusageveeam

Post navigation

Previous post
Next post

Search

Sponsors

Latest Posts

  • My Automated Lab project: #2 Create a Ubuntu template in VMware vSphere with Packer
  • My Automated Lab project: #1 Install and configure the needed tools
  • Calculate space savings of a XFS volume with reflink and Veeam fast clone
  • A new whitepaper: Veeam Backup & Replication V12 enhanced security and scalability with object storage Secure Mode
  • Enable EVC mode in an existing vSphere Cluster with VCSA and VSAN in it
©2023 Virtual To The Core | WordPress Theme by SuperbThemes