PowerShell script exchange
Post Reply
aschillling
Novice
Posts: 9
Liked: never
Joined: Sep 15, 2017 7:52 pm
Full Name: Andrew W Schilling
Contact:

Check the current VM backup session for the VM name?

Post by aschillling »

I'm trying to write pre-freeze and post thaw scripts that will stop and restart services on a dependent VM based on the VM being backed up.

Right now I don't have individual jobs for each VM and I'd rather not. I was hoping there was a way to have the pre-freeze and post-thaw scripts check which VM was being backed up and run the script if it matched the one I need.

The problem is that I have an Application Aware SQL backup running on one machine and when the quiesce happens the application server stops talking to the SQL server and never recovers. If I can stop the application services with the pre-freeze and start the with the post-thaw, I won't have to wake someone up in the middle of the night to start the services.
aschillling
Novice
Posts: 9
Liked: never
Joined: Sep 15, 2017 7:52 pm
Full Name: Andrew W Schilling
Contact:

Re: Check the current VM backup session for the VM name?

Post by aschillling »

I'm getting close. I can find the exact session info I need and assume it's the Status or Operation field I want to look at but don't know what the potential values for that field are to make the decision to run the script.

Code: Select all

$BackupTask = [Veeam.Backup.Core.CBackupSession]::FindLastByJob((Get-VBRJob -Name $JobName).Id) | Get-VBRTaskSession -Name $ServerName
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Check the current VM backup session for the VM name?

Post by veremin »

Not sure whether I follow you on that. You say Application Aware Image Processing freezes VSS-related activities inside given VM successfully, but fails at unfreezing those afterwards, right?
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests