Instant Recovery stopping Veeam backups

PowerShell script exchange

Instant Recovery stopping Veeam backups

Veeam Logoby adrian.woodrup » Thu Feb 14, 2013 12:31 pm 2 people like this post

I'm not sure if this effects most people but a company pointed out that sometime an instant recovery was started (for testing or to convert to OVF) and was left running for a number of hours, this would overlap with the time the next backup was due to run causing the backup to stop from running. So I wrote this simple script to stop any running IR's.

Code: Select all
# Stop any running InstantRecovery Jobs before next backup starts
# Get the current running job(s)
$IR = Get-VBRInstantRecovery
# Select the Running IR VMs from the job
$IRStop = Get-VBRInstantRecovery | Where-Object {$IR.VMName}
# Checks to see if $IR has a value (i.e. if there is a IR running) if so stop it
$IfVMRunning = (!(test-path ('variable:'+$IR)))
If($IfVMRunning){
   Stop-VBRInstantRecovery $IRStop
   }


I realise this WILL be a problem for anyone in a DR situation that needs to run instant recovery for any reason, just thought I would share this if needed.
adrian.woodrup
Influencer
 
Posts: 14
Liked: 10 times
Joined: Thu Nov 01, 2012 8:44 am
Full Name: Adrian Woodrup

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests