PowerShell script exchange
Post Reply
Mreza.Ghasemi
Lurker
Posts: 1
Liked: never
Joined: Dec 26, 2020 9:57 am
Full Name: Mohammadreza Ghasemi
Contact:

Get Restore point Disk Type and Size

Post by Mreza.Ghasemi »

Hello,
I've created some scripts that create backup jobs automatically, now I need to create scripts to restore the VM, assume the scenario in which I'm trying to restore an entire VM that the source VM still exists in vCenter, So I have to choose to restore to a new location with a different setting, the problem is that I need to find the restore point disk types to check whether I have enough free space on my datastore to restore the VM or not, I need to generate a list like below:

RestorePoint[0] for VMName
Disk Disk Type of VM at the backup time DiskSize used size
scsi0:0 Thick 200GB is equal to disk size because it's Thick Disk
scsi0:1 Thin 500GB 100GB

suppose that my total backup size is 150GB, but to restore the entire VM I need at least 300GB free space on datastore because the type of scsi0:0 is thick and does not matter how much is the size of total backup size,
soncscy
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: Get Restore point Disk Type and Size

Post by soncscy » 1 person likes this post

Hey Mohamammdreza,

This should be in the OIB data property Auxdata.Disks

Assuming you have the result of Get-VBRBackup in $backup, you can fetch this with:

All OIBs: $oibs = $backup.GetOibs()
Last OIBs: $LastOib = $backup.GetLastOibs()

And from there, you can check the property $oib.Auxdata.Disks and there should be a property ThinProvisioned that does what you need for your check.
Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests