Comprehensive data protection for all workloads
Post Reply
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Post job command right after Vmware snapshot finishes

Post by Peejay62 »

As it is now we can have a post command run right after a job finishes. It would be usefull though to be able to start the / a post command immediately after the snapshot is made. Use case: we have some VM's that need some services stopped in order to have a good, consistent backup. So we stop those services first, than run the Veeam backup and after this finishes restart the services. Even the Veeam backup can take a considerable time to complete because ot the size or amount of data to be processed. During this time the services are unavailable. From a backup perspective i have the opnion this isn't needed as the VM is in snapshot mode. So, in order to shorten the time that the services are unavailable an option to "run post command on snapshot completion" would be more than welcome. Given the logic I see in the Veeam processing job, It sees al the actions and reports them back, right after the "creating VM snapshot" call there might be an opening to code that in ? Anyway, i think one calls this a feature request.

Thanks,

Peter
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by veremin »

Hi, Peter,

Have you considered using VMware pre-freeze/post-thaw scripts in order to stop certain services inside particular VMs and release them after the snapshot is made?

Thanks.
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by foggy »

Yep, it's right there. Note, that you should be using VMware Tools Quiescence instead of application aware-image processing to enable scripts execution.
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by Peejay62 »

I was under the impression that these scripts have to be "fired off". Or am I wrong on this one, do they automatically run, if defined and vmware tools quiescence is activated, once a snapshot is called and completes ? Then it's fine. For the visibility that something special is setup for a backup and from a managementperpective though having that coded into a backupjob would be even better from my point of view.
thanks for the input though,

bye Peter
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by foggy »

Yes, pre-freeze and post-thaw scripts are triggered automatically if VMware Tools Quiescence is enabled. It is actually the same as using vSphere Client to create snapshot with quiescence enabled.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by veremin »

For the visibility that something special is setup for a backup and from a managementperpective though having that coded into a backupjob would be even better from my point of view.
For now you can, probably, use job "description" field in order to write specific information regarding the job. This should give you, at least, some visibility regarding internal job/VM activity.

Thanks.
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by Peejay62 »

@freeze/thaw scripts, that sounds good. So, setup pre/post, enable quiescence. Obviously the snapshot only runs as soon as the pre-freeze completes (with success only)? Stopping the services can take a little while sometimes and if that fails, a backup isn't that usable anyway. I will do some testing with it.
As for my feature request, maybe it can be put on the list anyway... I have some more examples where this can be used, for example to send out a mail to our development department that they can continue their work. They do not have to wait for the complete job to finish. (The real, physical backup runs in the background then, from a logical perspective the backup is already made)
I agree @Vladimir using the job description field can be of assistence but as time progresses I wonder if you can enforce some standard in what is put in this field for it's free format. Somebody might as well forget to put it in there.. But anyway, thanks again for the suggestions,


Peter
dellock6
Veeam Software
Posts: 6137
Liked: 1928 times
Joined: Jul 26, 2009 3:39 pm
Full Name: Luca Dell'Oca
Location: Varese, Italy
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by dellock6 »

Peter,
you can simply add a send-mail command at the end of the pre-freeze script, so it would be sent to the right people just after the VM snapshot was created.
Be aware that another lock can happen during the snapshot commit, so probably you would also like to add the same kind of email at the beginning of the post-thaw script.

Luca.
Luca Dell'Oca
Principal EMEA Cloud Architect @ Veeam Software

@dellock6
https://www.virtualtothecore.com/
vExpert 2011 -> 2022
Veeam VMCE #1
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by Peejay62 »

Ok, thanks I keep that in mind.
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by Vitaliy S. »

Peejay62 wrote:As for my feature request, maybe it can be put on the list anyway... I have some more examples where this can be used, for example to send out a mail to our development department that they can continue their work. They do not have to wait for the complete job to finish.
dellock6 wrote:you can simply add a send-mail command at the end of the pre-freeze script, so it would be sent to the right people just after the VM snapshot was created.
....and if you don't want to deal with scripting you can install Veeam ONE and create an alarm that would be monitoring Veeam B&R snapshots. Once Veeam ONE detects it (or after some delay after detection), it can send an email notification to the dev team etc.

Hope this helps!
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by Peejay62 »

So I have done some testing with the pre-freeze and post-thaw scripting. Did everything by the book but I am not able to get it working properly (scripts aren't fired). Did some research and found out I am not the only one struggling with this. Even found references of "a known bug of unknown origin concerning the scripting will not work on random VM's". I found another, suitable solution mentioned by Vladimir in another thread : http://forums.veeam.com/microsoft-hyper ... 16579.html. Have a script under water check if the snapshot is complete and if so restart your services. I think this will be my way to go as long as/if I don't get that freeze and thaw working.
Anyone can share some experience on that?

thanks, Peter
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by veremin »

Hi, Peter,

I'm wondering what happens, if you take the snapshot manually. Will the scripts be fired or not?

Thanks.
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by Peejay62 »

Hi Vladimir,

no, tried that too, didn't work. I even activated vmware tools logging to see what happens (doesn't show much though), upgraded vmware tools but no success. Nothing fired.

Thanks, Peter
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by foggy »

Probably VMware support could shed a light on this behavior.
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by Peejay62 »

yes, maybe they can. But what I am wondering about is that freeze/thaw was some part of the VCB feature which is what I know kind of discontinued@Vmware. Anyway, I will ask support and see what they come up with.

thanks, Peter
tsightler
VP, Product Management
Posts: 6009
Liked: 2842 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by tsightler »

Pre-freeze/post-thaw are also supported with VADP and continue to work fine at least up through vSphere 5.1 (I actually haven't tested them with vSphere 5.5 and can't find anything that confirms or denies their functioning in this version). What version of vSphere are you on? Also, where are you placing the scripts on the guest VM (VMware seems to change the location for the scripts on every release, which is annoying to say the least). Also, you probably know this, but the scripts are only called if the quiescence option is selected when you take the snapshot.
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by Peejay62 »

Hi Tom,

we are on 5.1 update 2. Ik did everything as it is supposed to work, a master bat-file in the mentioned backupscripts.d subdir for Vmware tools. This script refers to the freeze and thaw script in the \windows directory. Defined like it is said by Vmware for the specific Vsphere release.
Quiscence option is indeed selected...
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by Vitaliy S. »

I haven't heard anything about these scripts being not supported any more, so it should work. BTW, here is a VMware KB article for more details > http://kb.vmware.com/selfservice/micros ... Id=1006671
tsightler
VP, Product Management
Posts: 6009
Liked: 2842 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by tsightler »

I believe that in 5.1 pre-freeze\post-thaw script should go directly in C:\Windows and the scripts should be named specifically pre-freeze-script.bat and post-thaw-script.bat. I don't believe that the method used between 3.5U2 to 5.0 of putting multiple batch files and calling in backupScript.d works anymore with 5.1 as VMware has come full circle and reverted back to 3.5U1 and prior behavior again (gotta love VMware, their consistency at being inconsistent is legendary). Also, if your VMs were created with recent versions of ESXi (5.x or newer) they may have EnableUUID set, which I understand can interfere with the running of these scripts so you might want to check that as well.
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Re: Post job command right after Vmware snapshot finishes

Post by Peejay62 »

Hi Tom,

thanks, I will take a look at EnableUUID to see if that solves anything. As far as the scripts are concerned, the scripts in c:\windows are exactly called that way. It should call them then i guess as backupScript.d isn't used anymore.

thanks, Peter
Post Reply

Who is online

Users browsing this forum: bct44, Bing [Bot], Ivan239, Mircea Dragomir, nikita.kozlenko and 165 guests