November 22, 2011

Making non-vss applications backups with netbackup


So, I have an application that that keeps writing even if a vss snapshot is running.

Wich could mean that the file that the application is writing to could be corrupt if restoring the vss image.

When using netbackup withc vmware backup, netbackup usesthe snapshot function in vmware to be sure that all files will be backuped, taking an image and leaving the disks read only, and all writes are written to a temporary location.

It only takes a second to change the writers to write to an alternate location, so if I have an application that have to be stopped och paused during backup, I only have to stop that application during the time when the snapshot is taken.
But how do I know when to stop the application and when to start it again?

1. Navigate to the folder where vmware tools are installedvmware1.PNG
2. Create a folder and rename it to backupScripts.dvmware2.PNG
3.Open "backupScripts.d" and create a script. Vmware calls all the scripts in that folder with %1, where %1 could be:

    freeze : before snapshot
    freezefail : when snapshot fails
    thaw : when snapshot is ready

To create an example script wich you can use to check your backup later if it really works:

if "%1" == "freeze" goto dofreeze
if "%1" == "freezeFail" goto dofreezeFail
if "%1" == "thaw" goto doThaw
goto EOF

:dofreeze
echo freeze > c:\freeze.txt
goto EOF

:dofreezeFail
echo freezefail > c:\freezefail.txt
goto EOF

:doThaw
echo thaw > c:\thaw.txt
goto EOF

:EOF

4. Name the script to whatever you want with .cmd or .bat.
vmware3.PNG

5. Start a snapshot on the server, to emulate what netbackup are doing, check "Quiesce guest file system" and uncheck "Snapshot the virtual machine's memory"
vmware4.PNG