PowerShell script exchange
Post Reply
Seb@stien
Novice
Posts: 3
Liked: never
Joined: Jan 15, 2016 1:31 pm
Contact:

Pre/Post Script for each VM

Post by Seb@stien »

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
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Pre/Post Script for each VM

Post by veremin »

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?
Seb@stien
Novice
Posts: 3
Liked: never
Joined: Jan 15, 2016 1:31 pm
Contact:

Re: Pre/Post Script for each VM

Post by Seb@stien »

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)
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Pre/Post Script for each VM

Post by PTide »

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.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Pre/Post Script for each VM

Post by veremin »

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.
Seb@stien
Novice
Posts: 3
Liked: never
Joined: Jan 15, 2016 1:31 pm
Contact:

Re: Pre/Post Script for each VM

Post by Seb@stien »

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 ?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Pre/Post Script for each VM

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests