SMVI PRE/POST script for creating Application Consistent Backups using Snap Creator

by Extraordinary Contributor on ‎2011-08-30 07:50 AM

1) We needed to set TMP and TEMP env params since SMVI doesn't inherit standard env params when opening shell to execute script. This is required for Snap Creator.
2) You have to use goto's and if statements in bat script. I thought you could just create a .bat and set ENV param which told SMVI it was a PRE_BACKUP or POST_BACKUP.

Here is the SMVI bat script which runs Snap Creator:
set TEMP=C:\TEMP
set TMP=C:\TEMP


if %BACKUP_PHASE% == PRE_BACKUP goto pre_backup
if %BACKUP_PHASE% == POST_BACKUP goto post_backup
if %BACKUP_PHASE% == FAILED_BACKUP goto post_backup
goto end


:pre_backup
snapcreator.exe -profile maxdb -action quiesce -config_dir c:\scServer3.3.0\configs\maxdb -log_dir c:\scServer3.3.0\logs
goto end


:post_backup
snapcreator.exe -profile maxdb -action unquiesce -config_dir c:\scServer3.3.0\configs\maxdb -log_dir c:\scServer3.3.0\logs
goto end


:end

Comments
Frequent Contributor

Hello Keith,

I'm looking at a way to trigger Snap Creator execution in SMVI post backup phase. The idea is to use SC 3.6 capability to use an external snapshot for Snapvault update based on a specific regex.

So far, I can't use the principles in the script above as in my setup (and customer's one), Snap Creator server runs on a different host. What other alternatives do you see? 2 paths I had in mind:

- run Snap Creator independently at a later time than VSC/SMVI backup, hoping that the backup will be finished

- use PsExec from Microsoft to trigger SC execution, but I'm not that confident with such "technics"

Thanking you in advance for your help,

Kind regards,

Michel

Extraordinary Contributor

Why cant you install SC Agent on host where SMVI is installed?

Then you can set

SC_AGENT=hostname:9090

And then all CMDs will go to agent

You will need to add to agent.conf and allow command for smvi

command: smvi

for example

Otherwise you can execute SMVI and SC separately. SC will pickup the last snapshot that matches the regex when external snaps are used so it is important SC runs after SMVI and before a new SMVI job runs.

Hope this helps

Keith

Frequent Contributor

I initially went that way, but I've run into several limitations as VSC CLI is much more poor than its GUI counterpart: not possible to specify a user, no way to specify retention (snapshot number based or aged based). The "-user" parameter prompts for a user/password, and I had no success specifying a user using "smvi servercredentials".

I've created a batch file that calls SM-VI with some parameters, and when I run SC task, I see in target server's task manager a "cmd.exe" process, which leads me to think that smvi waits for some kind of input (I suppose credentials).

The way I've went afterwards is the one you described, i.e. running SC job separately but I was looking for more "chained" interaction.

Warning!

This NetApp Community is public and open website that is indexed by search engines such as Google. Participation in the NetApp Community is voluntary. All content posted on the NetApp Community is publicly viewable and available. This includes the rich text editor which is not encrypted for https.

In accordance to our Code of Conduct and Community Terms of Use DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information
  • Copyrighted materials without the permission of the copyright owner

Files and content that do not abide by the Community Terms of Use or Code of Conduct will be removed. Continued non-compliance may result in NetApp Community account restrictions or termination.