PowerShell script exchange
Post Reply
stephen.cilesio
Service Provider
Posts: 21
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: 21
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: 20400
Liked: 2298 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: 20400
Liked: 2298 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
Veeam Vanguard
Posts: 282
Liked: 113 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 | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | 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: 2010
Liked: 669 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
Product Manager
Posts: 9846
Liked: 2604 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
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.
Product Management Analyst @ Veeam Software
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 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
Product Manager
Posts: 9846
Liked: 2604 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
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
Product Management Analyst @ Veeam Software
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests