PowerShell script exchange
Post Reply
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Identify storage snapshot of a restore point

Post by lrhazi »

I'd like to script a restore ov a VM from storage snapshot.
It seems I can find the restore points like so:

Code: Select all

$snap_restore_points = Get-VBRRestorePoint -Name $VM_NAME | where {$_.Type -like 'Snapshot'}
How do I then find out which storage snapshot is the restore point from, so I can confirm it's the one I need? As I have all snapshots replicated in a secondary NetApp system, and I would like to restore from the primary only.

A restore point looks like bellow, but I cannot figure out which its proprieties can be used to link into the storage snapshots and volumes, to trace it back to the storage device.

Code: Select all

PS D:\Scripts> $snap_restore_points[0]


Info                : Veeam.Backup.Model.COibInfo
Id                  : 9eba6083-6bb5-4295-93c9-ec365a41348b
LinkIdNullable      :
OriginalOibId       : 9eba6083-6bb5-4295-93c9-ec365a41348b
LinkId              : 00000000-0000-0000-0000-000000000000
CreationTime        : 9/26/2018 12:03:00 AM
CreationTimeUtc     : 9/26/2018 4:03:00 AM
Type                : Snapshot
Algorithm           : Full
PointId             : 8933bae2-d448-41ee-8636-5ffe545bb9a1
ObjectId            : 324e49f1-a1c5-4762-9aac-339bd610cbb6
StorageId           : 0f992fee-d677-4c4a-9e2c-4c1aed76fecd
InsideDir           : Leahy-DR/AFF_DATA_N6/scriptmgmt-2
IsCorrupted         : False
IsRecheckCorrupted  : False
IsLicensed          : False
CreationUsn         : 0
IsConsistent        : True
ApproxSize          : 84197474708
VmName              : scriptmgmt-2
Name                : scriptmgmt-2
State               : Nothing
EffectiveMemoryMb   : 32768
GuestInfo           : Veeam.Backup.Model.CGuestInfo
AuxData             : Veeam.Backup.Core.CViOibAuxData
ParentId            : 00000000-0000-0000-0000-000000000000
ParentOriginalOibId : 00000000-0000-0000-0000-000000000000
DisplayName         : scriptmgmt-2
HvAuxData           :
HasIndex            : False
HasExchange         : False
HasVeeamArchiver    : False
HasSharePoint       : False
HasSql              : False
HasAd               : False
HasOracle           : False
Fqdn                :
BackupId            : f1095a1e-0730-4aa3-bec8-c4b7c59ebaf1
LinkableType        : Oib
IsFull              : False
MountToFull         : False
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Identify storage snapshot of a restore point

Post by veremin »

For NetApp Storage System, kindly, use its specific set of PowerShell cmdlets. Thanks!
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Re: Identify storage snapshot of a restore point

Post by lrhazi »

Thanks Eremin.

I saw those functions... but I still do not see how to go about linking the information from those functions with the info I see in the restore point object.

Given a snapshot type restore point, how do we find out which storage volume it is from?

I opened a case with Support, but they do not seem to understand my question either!
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Identify storage snapshot of a restore point

Post by veremin »

Don't have a NetApp storage at hand, but the workflow should look like this:

- Get storage system, using Get-NetAppHost cmdlet; assign result to a variable
- Get required volume of the storage system, using Get-NetAppVolume cmdlet with the storage system variable as one of cmdlet parameters; assign result to a variable
- Get snapshots of this volume, using Get-NetAppSnapshot cmdlet with the snapshot variable as one of cmdlet parameters

Is that something you're after? Or did I get it all wrong?

Thanks!
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Re: Identify storage snapshot of a restore point

Post by lrhazi »

Still wrong am afraid :) but you get lots of karma points for trying to help me out :)

In order to restore a VM from storage snapshot... I have to start by calling Get-VBRRestorePoint, correct?

Get-VBRRestorePoint returns a restore point object, the details of which I show in my initial post.
The details show me that this is indeed a snapshot based backup.... The question is: Given this restore point instance... how do I find out which storage snapshot and volume it is coming from?

Using the NetApp related commandlets would give me lists of all volumes and all snapshots the NetApp systems have, right? but which of those is the one in my current restore point instance?
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Re: Identify storage snapshot of a restore point

Post by lrhazi »

support gave us the answer:

It does require you to know what the name of the storage snapshot set is in Veeam, instead of being able to get to it from the NetApp storage host name, so you'll just need to make note of these.

Here's an example sequence of how to choose a particular storage snapshot from your DR NetApp:

$importedBackup = Get-VBRImportedEncryptedBackup -Name "leahyesx_AFF_DATA_N4_mirror"
$restorePoints = Get-VBRRestorePoint -Name "CSDBORAPRD01N"
$restorePoints | Where-Object {$_.Type -like "Snapshot"} | Where-Object {$_.BackupId -eq $importedBackup.Id} | Select -First 1
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests