Pre/Post Script for each VM

PowerShell script exchange

Pre/Post Script for each VM

Veeam Logoby Seb@stien » Fri Jan 15, 2016 1:38 pm

Hello,

Is there any way to run a script before and after for a specific vm backup in a backup job of X vm ?

I know we can run a pre freeze/post thaw script (but only at the start of backup) and we can run a pre / post script for the backup job itself but the idea is to stop a specific service before the job and restart it after (for a specific application on a windows vm)

Is someone have an idea ?

Thank you

Seb@stien
Seb@stien
Novice
 
Posts: 3
Liked: never
Joined: Fri Jan 15, 2016 1:31 pm

Re: Pre/Post Script for each VM

Veeam Logoby v.Eremin » Mon Jan 18, 2016 2:25 pm

Could I ask you why the specific service should be sitting in stopped state till the backup is done and cannot be started as soon as the helper snapshot is created?
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Pre/Post Script for each VM

Veeam Logoby Seb@stien » Mon Jan 25, 2016 7:19 am

Hello,

When the snapshot is committed (after backup of one vm), one service of an *hot* application (not exactly the service itself, but some processes launched by the service) stops for an unknown reason :(

To restart this application, we must stop all the services associated et restart them (restart only the stopped service doesn't work)
Seb@stien
Novice
 
Posts: 3
Liked: never
Joined: Fri Jan 15, 2016 1:31 pm

Re: Pre/Post Script for each VM

Veeam Logoby PTide » Mon Jan 25, 2016 8:42 am

Hi,

but the idea is to stop a specific service before the job and restart it after (for a specific application on a windows vm)
Is it an option to use pre-job scripts that sends remote commands to stop services to specific windows VMs and after the job is finished post-job script sends command to start services?

Thank you.
PTide
Veeam Software
 
Posts: 3021
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: Pre/Post Script for each VM

Veeam Logoby v.Eremin » Mon Jan 25, 2016 11:08 am

And if the job has more than one VMs as its source, move the VM in question down to the very bottom, so that it will be the last to be backed up. In this case, pre-freeze script will freeze the said service and post-job script will unfreeze it, once the job is finished. Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Pre/Post Script for each VM

Veeam Logoby Seb@stien » Mon Jan 25, 2016 3:04 pm

There is more than one vm (about 10) and we cannot wait the end of the job to do it on all vm

Is there Something to know the end of backup (on the vm itself) in Event viewer for example ?
Seb@stien
Novice
 
Posts: 3
Liked: never
Joined: Fri Jan 15, 2016 1:31 pm

Re: Pre/Post Script for each VM

Veeam Logoby v.Eremin » Mon Jan 25, 2016 3:39 pm

Not sure whether we are on the same page here. What we (me and Pavel) were trying to suggest is to

- move VM down in the list (source settings of backup job)
- use pre-freeze script to freeze certain application
- use post-job script to unfreeze the application

Based on my understanding, this would give exactly what you're after. The application will be frozen as soon as backup job starts to process the said VM, and it would be unfrozen by post-job activity, once the VM is backed up (Since it's the last VM to be backed up).

Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 2 guests