PowerShell script exchange
Post Reply
jdw
Technology Partner
Posts: 11
Liked: 3 times
Joined: Apr 18, 2016 11:26 pm
Full Name: JD Wallace
Location: Seattle, WA
Contact:

Snapshot Names for Snapshot-Only Jobs

Post by jdw »

Is it possible to get the names or other unique identifier for storage snapshots created by a specific backup session of a Snapshot-Only job?
I'm interested in particular for storage arrays leveraging the Universal-Storage API.

soncscy
Veeam Legend
Posts: 396
Liked: 190 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey Carel
Contact:

Re: Snapshot Names for Snapshot-Only Jobs

Post by soncscy »

Heya JD,

https://helpcenter.veeam.com/docs/backu ... ml?ver=100

Does that work for you? I don't have a Universal Storage, but for my Netapp it works great with the respective Netapp command.

jhoughes
Veeam Software
Posts: 278
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: Snapshot Names for Snapshot-Only Jobs

Post by jhoughes »

That should work since he's looking for this within Pure.

Hey JD, will ping you later about the tweet. ;)
Husband, Father, Solutions Architect, Geek Extraordinaire | @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion

jdw
Technology Partner
Posts: 11
Liked: 3 times
Joined: Apr 18, 2016 11:26 pm
Full Name: JD Wallace
Location: Seattle, WA
Contact:

Re: Snapshot Names for Snapshot-Only Jobs

Post by jdw »

Thanks you two.

I don't think this is quite what I'm looking for, but maybe I just need to think through it a bit more.

Here is a bit more context. I'm creating a post-job script that is intended to be run at the end of a Snapshot Only Backup Job in order to go do some work with the snapshot(s) that was just created. I can use Get-VBRBackupSession to get a handle to the session that the executing script was just called from, but I need to use that to somehow get the name of the snapshots. I could try to construct the snapshot name from the job name and such, but it appears to include a string of characters that from as far as I've been able to tell is randomly generated.

If I'm understating correctly, Get-StoragePluginSnapshot will get a snapshot object if I know the name of the snap or the volume it is a snap of... but I have neither of those values.

jdw
Technology Partner
Posts: 11
Liked: 3 times
Joined: Apr 18, 2016 11:26 pm
Full Name: JD Wallace
Location: Seattle, WA
Contact:

Re: Snapshot Names for Snapshot-Only Jobs

Post by jdw »

I came up with a workaround. It's a bit clunky but it works. If there is a way to query the actual snapshot that would be cleaner, but I'm happy with this.

I construct the snapshot name prefix from the job name, which is known. I then use Get-StoragePluginSnapshot to return all snaps that match that name (meaning they were created by some session of that job). Then just compare the snapshot creation time to the job session creation time. If the snapshot is newer, it must have been created by that session (since it's a post-job script).

https://github.com/jdwallace/PureStorag ... VBRJob.ps1

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests