For people managing data protection, VSS is probably one of the best features Microsoft have released in the last 10 years. Since its launch this feature of the operating system have helped a lot in doing applications’ consistent backups, but most of all helped to dismiss all those dedicated agents for every application: with VSS what’s needed is only the VSS support from the application you need to protect, so a backup program only needs to connect to the OS’s VSS libraries, that will in turn manage applications’ VSS.
Nowadays there are several softwares supporting VSS, obviously all the Microsoft ones (Exchange, SQL, and even Active Directory for example), but also third party programs like for example Oracle DB (starting from 11g version).
Unfortunately, there also many softwares that still do not support VSS after all these 10 years. In my personal case, I was requested to create an application backup of Lotus Dominio, that does not support VSS. So this post has a double goal: to show you how to create a “application-aware” backup for Lotus Domino, and more in general to show how you can use VMware Tools to workaround the lack of VSS support.
First of all, as you can imagine from this post’s title, the virtual machine needs to have VMware tools installed and running. Tools allows a backup program to run two scripts, usually called pre-freeze and post-thaw, where you can configure and run activities to be executed before or after the vSphere snapshot. In this way, you can “quiesce” an application that has no VSS support, thus guaranteeing data integrity.
Once VMware tools are installed, you need to create the directory C:\Program Files\VMware\VMware Tools\backupscripts.d. If it’s already there, chances are some backup agent used in the past created it.
In this directory, you can create for instance a single script with all the needed commands in it. However, I use a different approach: I create a generic script, called master.bat, that helps me run the final script, pre-freeze and post-thaw This is the script code:
@echo off if "%1" == "freeze" goto dofreeze goto dothaw :dofreeze call c:scriptspre-freeze.bat goto EOF :dothaw call c:scriptspost-thaw.bat :EOF
In this way, script configuration is already completed, , so you can test commands by editing those two scripts until you find a good solution. This has always seemed to me a better method to manage the quiescence made with VMware Tools, but it’s not an absolute rule.
One the first section is configured, we can edit the two scripts. In many situations, sadly the only way to quiesce a program is to stop it completely and start it again after the snapshot, and Lotus Domino is no different. You will find around many examples where the two scripts only had inside commands like “net stop service” and “net start service”. In Lotus Dominio, the pre-freeze script is a little bit more complicated since we first stop the service, and then it checks for still active processes and kill them. This is the code:
pre-freeze.bat
Net Time \%computername% >> C:scripts\logs\freeze.log
rem *************************************** rem creates and inventory of all running Domino processes rem ***************************************
pslist | findstr /I /C:"nadminp" >>C:scriptslogspid.lst pslist | findstr /I /C:"naldaemn" >>C:scriptslogspid.lst pslist | findstr /I /C:"namgr" >>C:scriptslogspid.lst pslist | findstr /I /C:"ncalconn" >>C:scriptslogspid.lst pslist | findstr /I /C:"ncatalog" >>C:scriptslogspid.lst pslist | findstr /I /C:"nchronos" >>C:scriptslogspid.lst pslist | findstr /I /C:"ncollect" >>C:scriptslogspid.lst pslist | findstr /I /C:"ncompact" >>C:scriptslogspid.lst pslist | findstr /I /C:"nconvert" >>C:scriptslogspid.lst pslist | findstr /I /C:"ndesign" >>C:scriptslogspid.lst pslist | findstr /I /C:"ndircat" >>C:scriptslogspid.lst pslist | findstr /I /C:"ndrt" >>C:scriptslogspid.lst pslist | findstr /I /C:"ndsmgr" >>C:scriptslogspid.lst pslist | findstr /I /C:"nevent" >>C:scriptslogspid.lst pslist | findstr /I /C:"nfixup" >>C:scriptslogspid.lst pslist | findstr /I /C:"nhttp" >>C:scriptslogspid.lst pslist | findstr /I /C:"nhttpcgi" >>C:scriptslogspid.lst pslist | findstr /I /C:"nimap" >>C:scriptslogspid.lst pslist | findstr /I /C:"nimsgcnv" >>C:scriptslogspid.lst pslist | findstr /I /C:"nisesctl" >>C:scriptslogspid.lst pslist | findstr /I /C:"niseshlr" >>C:scriptslogspid.lst pslist | findstr /I /C:"nldap" >>C:scriptslogspid.lst pslist | findstr /I /C:"nlivecs" >>C:scriptslogspid.lst pslist | findstr /I /C:"nlnotes" >>C:scriptslogspid.lst pslist | findstr /I /C:"nlogin" >>C:scriptslogspid.lst pslist | findstr /I /C:"nmtc" >>C:scriptslogspid.lst pslist | findstr /I /C:"nnntp" >>C:scriptslogspid.lst pslist | findstr /I /C:"nnsadmin" >>C:scriptslogspid.lst pslist | findstr /I /C:"nnotesmm" >>C:scriptslogspid.lst pslist | findstr /I /C:"nobject" >>C:scriptslogspid.lst pslist | findstr /I /C:"nomsgcnv" >>C:scriptslogspid.lst pslist | findstr /I /C:"nosesctl" >>C:scriptslogspid.lst pslist | findstr /I /C:"noseshlr" >>C:scriptslogspid.lst pslist | findstr /I /C:"notes" >>C:scriptslogspid.lst pslist | findstr /I /C:"npop3c" >>C:scriptslogspid.lst pslist | findstr /I /C:"npop3" >>C:scriptslogspid.lst pslist | findstr /I /C:"nreport" >>C:scriptslogspid.lst pslist | findstr /I /C:"nrouter" >>C:scriptslogspid.lst pslist | findstr /I /C:"nreplica" >>C:scriptslogspid.lst pslist | findstr /I /C:"nsapdmn" >>C:scriptslogspid.lst pslist | findstr /I /C:"nsmtpmta" >>C:scriptslogspid.lst pslist | findstr /I /C:"nsmtp" >>C:scriptslogspid.lst pslist | findstr /I /C:"nstatlog" >>C:scriptslogspid.lst pslist | findstr /I /C:"nstaddin" >>C:scriptslogspid.lst pslist | findstr /I /C:"nstats" >>C:scriptslogspid.lst pslist | findstr /I /C:"nsched" >>C:scriptslogspid.lst pslist | findstr /I /C:"nservice" >>C:scriptslogspid.lst pslist | findstr /I /C:"nserver" >>C:scriptslogspid.lst pslist | findstr /I /C:"ntaskldr" >>C:scriptslogspid.lst pslist | findstr /I /C:"ntsvinst" >>C:scriptslogspid.lst pslist | findstr /I /C:"nupdate" >>C:scriptslogspid.lst pslist | findstr /I /C:"nupdall" >>C:scriptslogspid.lst pslist | findstr /I /C:"nwrdaemn" >>C:scriptslogspid.lst pslist | findstr /I /C:"nweb" >>C:scriptslogspid.lst pslist | findstr /I /C:"nxpcdmn" >>C:scriptslogspid.lst pslist | findstr /I /C:"nccmta" >>C:scriptslogspid.lst pslist | findstr /I /C:"ncctctl" >>C:scriptslogspid.lst pslist | findstr /I /C:"nccmctl" >>C:scriptslogspid.lst pslist | findstr /I /C:"nccttcp" >>C:scriptslogspid.lst pslist | findstr /I /C:"nccbctl" >>C:scriptslogspid.lst pslist | findstr /I /C:"nccmin" >>C:scriptslogspid.lst pslist | findstr /I /C:"nccmout" >>C:scriptslogspid.lst pslist | findstr /I /C:"nccdctl" >>C:scriptslogspid.lst pslist | findstr /I /C:"nccdin" >>C:scriptslogspid.lst pslist | findstr /I /C:"nccdout" >>C:scriptslogspid.lst pslist | findstr /I /C:"ngdsscan" >>C:scriptslogspid.lst pslist | findstr /I /C:"ngsscan" >>C:scriptslogspid.lst pslist | findstr /I /C:"ngstmgr" >>C:scriptslogspid.lst
rem *************************************** rem Stops Dominio daemon in a controller fashion rem ***************************************
net stop "Lotus Domino Server (LotusDominoData)"
rem *************************************** rem Wait a fair amount of time for processes to stop rem ***************************************
Sleep 300
rem *************************************** rem If some Domino processes are hanged, it kills all of them rem ***************************************
for /f "tokens=2" %%I in (C:scriptslogspid.lst ) do pskill %%I
Net Time \%computername% >> C:scriptslogsfreeze.log
the check the result of the script, we write the execution date of the script itself into the freeze.log file. The only parameter you can change is Sleep: in my example is 5 minutes, but you could have to increase it if you have huge programs or slow systems.
The start script is obviously much more simple:
post-thaw.bat
net start "Lotus Domino Server (LotusDominodata)"
These two scripts are executed by VMware tools when the creation of the virtual machine snapshot happens. In this way the application is stopped when the virtual machine is freezed, so its data are consistent. The stop can last few seconds or several minutes, depending on the activities recorded into the script and the speed of the underlying infrastructure. So you need to plan really carefully when to run this kind of backup, because you are going to create a disservice to users.
To test the script, you can simply run a snapshot in vCenter and ask for the VMware Tools quiescence. You will see how the snapshot creation process (usually lasting few seconds) now takes much more time, right because it needs to execute the script. This is how this behaviour is seen inside a backup software like Veeam.