PowerShell script exchange
Post Reply
DS_FCE
Lurker
Posts: 2
Liked: never
Joined: Nov 21, 2022 6:45 pm
Contact:

Pause backup if replication is currently running

Post by DS_FCE »

I am looking to script a pre-backup check to make sure Veeam doesn't attempt a hyper-v checkpoint if Hyper-V is currently running replication.

Since the replication generally completes in a few seconds its not always a problem. So the wait timeout would be quite minimal.

We find if veeam and replication run at the same time, it can break the replication and force us to manually resume.

I'm quite good with powershell scripts, but I figured someone else has to have run into this already before.
Mildur
Product Manager
Posts: 9848
Liked: 2606 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Pause backup if replication is currently running

Post by Mildur »

Hi

Are you talking about native HyperV replication outside of veeam?

Thanks
Fabian
Product Management Analyst @ Veeam Software
DS_FCE
Lurker
Posts: 2
Liked: never
Joined: Nov 21, 2022 6:45 pm
Contact:

Re: Pause backup if replication is currently running

Post by DS_FCE »

Hello Fabian,
Yes, Native replication.
Mildur
Product Manager
Posts: 9848
Liked: 2606 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Pause backup if replication is currently running

Post by Mildur »

Hello

Thanks for your answer.
I cannot provide you a complete script for HyperV. But let's see if others have something.

With Veeam, you can do Pre-Job/Post-Job and Pre-Freeze/Post-Thaw scripts.
The Pre-Job script runs on the backup server before the job is doing its task. The Pre-Freeze script runs within the guest vm.
If you want to check if a replication is currently running, you need to do that before a Hyper-V is doing a checkpoint of a single VM.
You would need Pre-Freeze scripts which connects from within the Guest OS VM to the HyperV server per Powershell and check if a replication task is currently running.

Or you can use Pre-Job scripts and suspend Hyper-V replication for all VMs while the backup job is running.
Use a Post-Job script to resume the replication.
- Suspend-VMReplication
- Resume-VMReplication

Have you considered using Veeam replication jobs?
If you use Veeam replication jobs, you won't see these problems. Veeam would be aware of the running replication.

Thanks
Fabian
Product Management Analyst @ Veeam Software
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests