Has anyone figured out VCB 1.5 custom quiescing scripts?

Has anyone figured out VCB 1.5 custom quiescing scripts?

Has anyone played with the custom scripts for VCB 1.5 / ESX3.5U2?  According to the VM Backup Guide pg 52, the pre-freeze and post-thaw  scripts are now located under C:\Program Files\VMware\VMware  Tools\backupScripts.d.

For pre-freeze, it says "All scripts are invoked in ascending  alphabetical order with freeze as the first argument." I created a  pre-freeze-script.bat and a freeze_script_1.bat under that directory.  Neither worked. Also, C:\windows\pre-freeze-script.bat does not work  either...

Moderator" since there doesn't seem to be a VCB community, I posted here, please move if appropriate.

Dave


Bump..... :o(


1.Make sure you installed the latest VMtools on the guest.


2. We ended up using FREEZE.bat and that seems to work.


Thanks Jason -

I renamed C:\Program Files\VMware\VMware  Tools\backupScripts.d\freeze.bat to C:\Program Files\VMware\VMware  Tools\backupScripts.d\FREEZE.bat

That did not work. I ran a repair to vmware tools and then it worked. The file names are case sensitive.


I used C:\Program Files\VMware\VMware Tools\backupScripts.d\THAW.bat for the thaw script.

Dave


Hello,

the problem is that scripts are launched twice. Before and after creation of snapshot.

So before snapshot is made scripts are launched in ascending alphabetical order - freeze then thaw

and after creation of snapshot in descending order - first thaw for the  second time and then freeze ... as it written in backup guide

but I don't understand why it's like that ...


Here is what we have found out:


Each script in the backupscripts.d folder will get ran for EACH Argument  sent. So as a example before a backup snaps it will run each script in  that folder with the argument of FREEZE starting with freeze.bat in that  folder. When THAW is called the same thing happens.

So if you have 3 scripts in that directory each will get ran for FREEZE and each will run for THAW.

What we did was create 1 script that will take Arguments like FREEZE, THAW, FREEZEFAIL

you can verify this by creating 2 scripts in that directory that write  the current time to a file. Run a VCB job and you will see that file get  written to 4 times. 2 for the FREEZE and 2 for the THAW.


Hello,

Ok I understand but now how can I stop the database before the snap and start it after snap ?

If I have two scripts, first for stopping the databases and second for  starting them again, both scripts will run before and after the snap in  the different order. That's no use.

database will stop and start before snapshot and start again and stop after backup.

In the previous versions of VCB it was ok.


Something like this:

if "%1%" == "freeze" goto doFreeze

goto doThaw

:doFreeze

call c:\windows\pre-freeze.bat

goto EOF

:doThaw

call c:\windows\post-thaw.bat

so you would create 1 script and have a section for Freeze and Thaw...


Ok now it works.

The argument send by vcb was the missing factor ...

Thanks.


... there is one more thing

after FREEZE section of the script is done snapshot is being made but it's not completed but finished in 95% and waiting.

It is completed in 100% but not before a thaw section is done. Shouldn't snapshot be completed when database is stopped ?

Is it normal ?


Jason -

What did you actually name the script? Is this a uppercase / lowercase thing as well?

Dave


Lowser case. Freeze.bat


Hello,

It doesn't matter. VCB will execute anything that's in ...backuScripts.d folder.


I tried a few file names before. The FREEZE.bat and THAW.bat seem to  work no matter what the contents. But they execute twice. I think the "  IF %1 == Freeze" statement makes it non-case sensitive. I have to test  it out in my lab. On college tours with my daughter this week, so I have  limited connectivity...

Dave


This is correct. Each script in that folder will run regardless of name  for each operation. You will need to create 1 script that accepts Freeze  and Thaw as arguments.


OK. I re-ran all of the tests again. All versions are confirmed as  latest builds. I had to set the date back to allow the VM to power on  because of the issues with ESX3.5U2...

A script with "if %1% == "freeze'" as the first argument - it will execute as a pre freeze script.

A script with "if %1% == "thaw"" as the first argument - it will execute as a post thaw script.

If multiple scripts exist in backupScripts.d, AND the contain the  argument, they are executed in order as documented (reverse for thaw)


HOWEVER....


If the name of the file is freeze.bat, it will execute twice. If it is  called thaw.bat, it will also execute twice. This has been confirmed by  others.


Thanks to all for the assistance.

Dave


After further testing, I can confirm that ALL custom scripts placed in  the backupScripts.d directory will execute during both the pre-freeze  AND post-thaw events. This means that logic needs to be placed in the  script so that the desired result is gained. If no "IF' statements are  contained in the scripts, they will be executed during both the  pre-freeze and post-thaw events, which could be undesireable. I also  confirmed that these script names are NOT case-sensitive.


Hello,

thank you for this solution. I my situation it works only partly. If I  manually stop service and than manually execute script in  backupScripts.d directory script start service. If I start backup of VM  via VCB than VCB send "freeze" and script stop the service but after a  while job fail based on "Custom Pre-Freeze script failed". I don't know  where I would looking for error

Smiley Sad




You can try checking the logs on the VM under %TEMP% and on the ESX host in the VM's directory.


Dave

************************
"There is an island of opportunity in the middle of every difficulty. Miss that, though, and you're pretty much doomed."
despair.com


I would like more accurately specify error message. During creating snapshot I get message:

Creating quiesced snapshot failed ...... script in the virtual machine exited with non-zero return code.


If you did not do a "COMPLETE" install of VMware Tools, the sync driver  does not install. Run the VMware Tools installer and modify the install,  then add the sync driver. If you are running ESX3.5 add the VSS driver  too. See the attached screenshot.


Dave

************************
"There is an island of opportunity in the middle of every difficulty. Miss that, though, and you're pretty much doomed."
despair.com


I add VSS driver - still sthe same. It looks like VCB don't send THAW argument.


Can you post a copy of the script you are running?


I took script code from this thread. I change only directory with "execution" scripts.

if "%1%" == "freeze" goto doFreeze

goto doThaw

:doFreeze

call "c:\Program Files\VMware\VMware Tools\services_scripts\freeze.bat"

goto EOF

:doThaw

call "c:\Program Files\VMware\VMware Tools\services_scripts\thaw.bat"


Can you post " freeze.bat"


I'm not sure if the VSS driver actually NEEDS to pre-freeze / post-thaw.  VSS does it differently. Assuming you are running ESX 3.5U2


Dave

************************
"There is an island of opportunity in the middle of every difficulty. Miss that, though, and you're pretty much doomed."
despair.com


You wrote that I shoul add VSS driver. I think VSS is especially for databases.


You wrote that I shoul add VSS driver Smiley Wink. I think VSS is especially for databases.


I cant find it in the VM Backup Guide, but I think only the SYNC driver  uses the scripts. I believe the VSS driver just uses VSS and the script  is NOT required. The VSS driver takes care of quiescing the app and  disk.


Dave

************************
"There is an island of opportunity in the middle of every difficulty. Miss that, though, and you're pretty much doomed."
despair.com


Correct, If you are using VMware's VSS provider then it will be called automatically by VCB.


Some additional information:
If the VSS driver is installed together with the recent VMware Tools the  new location and behaviour is used for custum scripts. The scripts are  called every time you start to use VCB.

If you only have the the sync installed the old path under <%windir%>/system32 is used.

The above isnt true for a guest VM which runs the WinXP OS. Because of a bug the old location is always used. I have to to dig for the PR where VMware describes the problem.

This drives me nuts because my Target system was first a W2k3 and later i  testet with WinXP because i dont want to backup my 600GB production VM.

Here is my current script which works around for every of my problems.

Placed it under the new location ../VMware Tools/backupScripts.d
=========================================================
@echo off

if "%1%" == "" goto noParam
if "%1%" == "freeze" goto doFreeze
if "%1%" == "thaw" goto dothaw
if "%1%" == "freezeFail" goto dofreezefail
goto wrongParam


:doFreeze
call c:\windows\pre-freeze-script.bat
goto Ende

:dothaw
call c:\windows\post-thaw-script.bat
goto Ende

:dofreezefail
call c:\windows\post-freezefail-script.bat
goto Ende

:noParam
echo "Usage: %0 "
echo At least one Parameter is needed!
goto Ende

:wrongParam
echo "Usage: %0 "
echo "%1" is not a valid parameter!
goto Ende

:Ende
========================================================

Regards
Joerg

Remember if you found this or others answers helpful do not forget to award points by marking an answer as helpful or correct **


Some additional information:
If the VSS driver is installed together with the recent VMware Tools the  new location and behaviour is used for custom scripts. The scripts are  called every time you start to use VCB.

If you only have the the sync installed the old path under <%windir%>/ is used.

The above isnt true for a guest VM which runs the WinXP OS. Because of a bug the old location is always used. I have to to dig for the PR where VMware describes the problem.

This drives me nuts because my Target system was first a W2k3 and later i  testet with WinXP because i dont want to backup my 600GB production VM.

Here is my current script which works around for every of my problems.

Placed it under the new location ../VMware Tools/backupScripts.d
=========================================================
@echo off

if "%1%" == "" goto noParam
if "%1%" == "freeze" goto doFreeze
if "%1%" == "thaw" goto dothaw
if "%1%" == "freezeFail" goto dofreezefail
goto wrongParam


:doFreeze
call c:\windows\pre-freeze-script.bat
goto Ende

:dothaw
call c:\windows\post-thaw-script.bat
goto Ende

:dofreezefail
call c:\windows\post-freezefail-script.bat
goto Ende

:noParam
echo "Usage: %0 "
echo At least one Parameter is needed!
goto Ende

:wrongParam
echo "Usage: %0 "
echo "%1" is not a valid parameter!
goto Ende

:Ende
========================================================

Regards
Joerg

Remember if you found this or others answers helpful do not forget to award points by marking an answer as helpful or correct **


Altix, thank very much!!! Your script works.


Hello,

The scripts works fine!

I'm only wondering wherefor the freezefail is? What the meaning of this argument?

Can anyone tell?

Regards,

Matthijs


HA! I just saw your question..Only two months late....

Freezefail is when the freeze process returns a non-zero code, allows you to do a little error notification or cleanup.

Dave Convery
VMware vExpert 2009
http://www.dailyhypervisor.com

Careful. We don't want to learn from this.
Bill Watterson, "Calvin and Hobbes"


This document was generated from the following thread: Has anyone figured out VCB 1.5 custom quiescing scripts?

Version history
Revision #:
1 of 1
Last update:
‎10-30-2009 10:53 AM
Updated by: