PowerShell script exchange
Post Reply
stephen.cilesio
Service Provider
Posts: 20
Liked: 1 time
Joined: Nov 20, 2015 6:21 am
Full Name: Stephen Cilesio
Contact:

Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by stephen.cilesio »

With the upgrade to Veeam 9.5 Update 4, there is a new field within the backup repositories called "Used Space". I currently have a powershell script running to grab the Capacity, Free space but would like to also grab the new "Used space column" to add to my script. I can't seem to find the input needed to add it to a variable.

For example, I've created a variable $backuprepo = Get-VBRBackupRepository and within this i have created other variables such as:

$vbrname = $backuprepo.Name which gives me the name of the repo
$vbrfreespace = $backuprepo.Info.CachedFreeSpace this gets free capacity
$vbrtotalspace = $backuprepo.Info.CachedTotalSpace this gets total capacity

I'd like one for the used space if possible as this calculates the raw backup data.

stephen.cilesio
Service Provider
Posts: 20
Liked: 1 time
Joined: Nov 20, 2015 6:21 am
Full Name: Stephen Cilesio
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by stephen.cilesio »

*** UPDATE ****

I know the location of the information which i'm trying to pull which is located a table within SQL.

The location is used_space column in Server [@Name='SQL Server']/[@Name='Database name']/View[@Name='ReportRepositoriesView' and @Schema='dbo']/Data

Just need to know how to pull this and update it with a variable to then add to my script or try and pull (or locate) the same information using veeam powershell commands

veremin
Product Manager
Posts: 18679
Liked: 1867 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by veremin »

Try this unsupported workaround (no guarantees it will work in future):

Code: Select all

Asnp VeeamPSSNapin
$Repository = Get-VBRBackupRepository -name "Name of your repository"
[Veeam.Backup.Core.CbackupRepository]::GetRepositoryStoragesSize($Repository.id)/1GB
Thanks!

bib_ak
Enthusiast
Posts: 33
Liked: 1 time
Joined: Jan 31, 2010 12:57 pm
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by bib_ak »

It's not returning the correct result. In SQL and Veeam software it says 10 TB, powershell says "13498,2316336632". Any other way? I'd hate to work with collecting SQL data just for this purpose...

veremin
Product Manager
Posts: 18679
Liked: 1867 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by veremin »

What kind of repository it is? Might be some specifics related to repository type. Thanks!

bib_ak
Enthusiast
Posts: 33
Liked: 1 time
Joined: Jan 31, 2010 12:57 pm
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by bib_ak »

Cloud Connect.

jhoughes
Expert
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by jhoughes »

Check out the reply by @chris.arceneaux here:

powershell-f26/veeam-cloud-repository-d ... 63332.html
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion

bib_ak
Enthusiast
Posts: 33
Liked: 1 time
Joined: Jan 31, 2010 12:57 pm
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by bib_ak »

Yes, I've seen that thread. It's pretty much the same.

Total Space GB: 10240
Totale Used GB: 14601.93

I have now used about 6000/10240, not 14602/10240. Really annoying...

oleg.feoktistov
Veeam Software
Posts: 1053
Liked: 373 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by oleg.feoktistov »

Hi Stephen,

Aside from the workaround mentioned here, there is currently no other way yet to get UsedSpace property.
Nonetheless, we are aware of it and have it noted as a feature request for further releases.

Thanks!
Oleg

bib_ak
Enthusiast
Posts: 33
Liked: 1 time
Joined: Jan 31, 2010 12:57 pm
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by bib_ak »

Well, except querying it from the database directly. But it's ugly, I'll rather wait a while to see if this will be implemented.

Mildur
Veeam Legend
Posts: 1169
Liked: 506 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian
Location: Switzerland
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by Mildur »

Was there any change to this feature request?
I want to ise powershell to report used space for each backup repository for billing the customers.
VMCE 9 | Veeam Legends 2021
Working with Veeam since 2017 for a VCSP in Switzerland

oleg.feoktistov
Veeam Software
Posts: 1053
Liked: 373 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by oleg.feoktistov »

Hi Fabian,

Not yet as the implementation approach is not as straightforward as it might look from the first sight. But we do remember about it.

Best regards,
Oleg

Mildur
Veeam Legend
Posts: 1169
Liked: 506 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian
Location: Switzerland
Contact:

Re: Veeam 9.5 U4 - Locate Used Space within PowerShell Modules

Post by Mildur »

Ok, thanks Oleg
We will try the restful API. This should get me what I want, i think.

https://helpcenter.veeam.com/docs/backu ... ml?ver=110
VMCE 9 | Veeam Legends 2021
Working with Veeam since 2017 for a VCSP in Switzerland

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests