Solved

is there a way to get a backup job report that has the backup size using powershell commands ?

  • 19 October 2021
  • 8 replies
  • 267 views

Badge +2

Is there a way to create a roport using powershell that includes the backup size. I've tried pulling information but all I see is application size, size on disk etc. 
 

I need to do this for physical and virtual machines. 

icon

Best answer by Cbcurry1 19 November 2021, 14:43

View original

8 replies

Userlevel 5
Badge +10

This @Cbcurry1,

Checking the powershell articles, I don’t believe so: https://documentation.commvault.com/11.24/essential/101892_commvault_powershell_module_reference.html

However, if you see a webconsole \ metrics report that gives you the data you’re after - you can use the below to call and access the same data via REST API:

https://documentation.commvault.com/11.24/essential/115046_rest_api_get_data_set.html

Refer to: https://documentation.commvault.com/11.24/essential/115048_rest_apis_for_reports.html


Could you please check this and let me know if this helps?
 

Regards, 
Chris

Badge +2

Hello, 

 

Thank you for your response, it’s much appreciated. I am looking into the your suggestion. I will review that further and let you know. 

On the same subject on trying to get the backup size I made a discovery as I peeled back the layers in powershell. I found what looks like the backup size, application, VMsize etc. by running get-cvjob -clientname  [clintname] -SubclientName [subclientname]  | select -Property destclientname, subclientname, localizedBackupLevelName, jobid

 

Then I got job id and ran Get-CVJobDetail -Id [job id] to get the job details, and then diving further into the array returned I was able to get all the vm backup details. 

 

My question is are these values the same values you get when you go into the job ID of a VSA sublclient, and click on the virtual machine tab to show the vms backed. 

I I believe the data is what I’m looking for but the numbers returned in the gui are slightly different, could that be because of compression?

 

Thank you, 

Userlevel 7
Badge +23

@Cbcurry1 , that looks right to me; can you share which numbers didn’t match?  Could be a few factors including being in different formats.

Find an example of a single Job ID and let’s take a look :nerd:

Userlevel 7
Badge +23

Hi @Cbcurry1 , following up to see if you had a chance to provide a Job ID detail so we can investigate.

Thanks!

Badge +2

Hello, 

 

My apologies for not responding yet, but I got tied up with some other things. I will look into the numbers and bring back some data so we can review. I will come back asap with some numbers to look at. 

Userlevel 7
Badge +23

Thanks, @Cbcurry1 and no need to apologize, we’re here for you!  I unmarked the best answer in the meantime.

Have a great weekend!

Badge +2

Hello, I just wanted to report back on this topic. I have successfully pulled the backup size of vms backed up with a VSA. The size does match the size reported when you view the job in the Commvault Console on the virtual machine tab. In order to do it, I used [math]::Round(($_.UsedSpace/1GB),2).

What had to be done was to run a cvgetjobs to get the jobs for the VSA client and subclients. Then run get-cvjobdetail for the job. The property UsedSpace is the Backup Size. when you review the backup in the gui for the subclient under the VSA backup, choose backup history, choose a backup job, and then virtual machines tab, there will be a backup size. then the date and baackup size had to be converted. The backup times are in Unix date format. Once converted, the dates and UsedSpace are exactly what is displayed in the gui. 

 

I appreciate all the previous feedback and assistance with this topic. its’ nice to know there is help out there. 

Userlevel 7
Badge +23

Appreciate you coming back to share (and marked your own reply as the Best Answer)!

This community is a fantastic place for sure.  We have so many passionate members always stepping up to help each other out.

I get to see it all, every day and it’s inspiring!

Reply