Active IQ Unified Manager Discussions

Can you force a protection policy to use a specific SnapVault schedule in Protection Manager?

reide
5,204 Views

In TR-3487 SnapVault Best Practices Guide, it outlines how a user could use a host-based script to backup an Oracle database.  The script would put a database into hot backup mode and take an application-consistent snapshot of the database using a snapvault schedule (i.e sv_hourly).  For example:

[first commands to put the database into backup mode]

     rsh fas3050-pri snapvault snap create oracle sv_hourly

[end with commands to take the database out of backup mode]

Then, the SnapVault secondary has the same schedule specified with the -x option.  When the secondary initiates the SnapVault transfer, it sees sv_hourly.0 on the primary volume/qtree and uses that snapshot to determine what blocks to transfer to the secondary.

I want to achieve the same thing with a dataset in Protection Manager. I want a database host to coordinate the creation of the primary SnapVault snapshot using a schedule (i.e. sv_hourly.0).  Then, have my PM dataset & policy use that same snapvault schedule to determine what to back-up from the primary.  Doing this avoids the headache of having to "register" the primary snapshot with Protection Manager via an API call.

How can I do this with Protection Manager?   Clearly my protection policy would have to specify no local snapshots on the primary, as it should already exist (sv_hourly.0). I'm just not aware how you make the protection policy aware of an existing snapvault schedule on the primary.

13 REPLIES 13

smoot
5,165 Views

The most straightforward thing to do would be to code up a pre-backup script and a post-backup script. You attach these to the protection policy and we can invoke them before and after taking snapshots on the primary. It's actually configured as a single script and we invoke it twice. We send a parameter saying which invocation this is.

The other thing to do would be to use SnapManager for Oracle, which already knows how to work with Protection Manager.

rshiva
5,165 Views

Hi,

To Pete's point, pre-post scripting is the way to accomplish your task. The pre-post script in Protection Manager has a set of Environmental variables that can be specified at places where the application needs to be quiesced or released. For instance, the backup policy in protection manager is responsible for creating SnapVault relationships. If you specify a custom script in the backup protection policy (check screenshot 1) which does the job of identifying the environmental variables and its values then the script would be invoked six times with the following Environmental variables:

=============== BEGIN PRE_POST SCRIPT ===============

Mon Oct 4 02:14:37 EDT 2010

MANPATH=/usr/share/man:/opt/NTAPdfm/man

CONSOLE=/dev/pts/0

SELINUX_INIT=YES

SQLANY10=/opt/NTAPdfm/

TERM=linux

DP_POLICY_NAME=Back up

DP_RETENTION_TYPE=DP_DAILY

LD_LIBRARY_PATH=/opt/NTAPdfm/lib/:/opt/NTAPdfm/lib:/opt/NTAPdfm/plugins

INIT_VERSION=sysvinit-2.86

DP_SERIAL_NUMBER=1-50-000001

DP_BACKUP_STATUS=DP_BEFORE_SNAPSHOTS

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/NTAPdfm/bin:/opt/NTAPdfm/bin/:/opt/NTAPdfm/sbin/

runlevel=5

RUNLEVEL=5

DP_JOB_ID=553

PWD=/opt/NTAPdfm/sbin

LANG=en_US.UTF-8

previous=N

PREVLEVEL=N

DP_DATASET_NAME=snapvault

DP_POLICY_ID=60

SHLVL=3

HOME=/

DP_DATASET_ID=837

SATMP=/tmp

_=/usr/bin/printenv

=============== BEGIN PRE_POST SCRIPT ===============

Mon Oct 4 02:14:41 EDT 2010

MANPATH=/usr/share/man:/opt/NTAPdfm/man

CONSOLE=/dev/pts/0

SELINUX_INIT=YES

SQLANY10=/opt/NTAPdfm/

TERM=linux

DP_POLICY_NAME=Back up

DP_BACKUP_RESULT=DP_SUCCEEDED

DP_RETENTION_TYPE=DP_DAILY

LD_LIBRARY_PATH=/opt/NTAPdfm/lib/:/opt/NTAPdfm/lib:/opt/NTAPdfm/plugins

INIT_VERSION=sysvinit-2.86

DP_SERIAL_NUMBER=1-50-000001

DP_BACKUP_STATUS=DP_AFTER_SNAPSHOTS

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/NTAPdfm/bin:/opt/NTAPdfm/bin/:/opt/NTAPdfm/sbin/

runlevel=5

RUNLEVEL=5

DP_JOB_ID=553

PWD=/opt/NTAPdfm/sbin

LANG=en_US.UTF-8

previous=N

PREVLEVEL=N

DP_DATASET_NAME=snapvault

DP_POLICY_ID=60

SHLVL=3

HOME=/

DP_DATASET_ID=837

SATMP=/tmp

_=/usr/bin/printenv

=============== BEGIN PRE_POST SCRIPT ===============

Mon Oct 4 02:14:52 EDT 2010

MANPATH=/usr/share/man:/opt/NTAPdfm/man

CONSOLE=/dev/pts/0

SELINUX_INIT=YES

SQLANY10=/opt/NTAPdfm/

TERM=linux

DP_FROM_NODE_NAME=Primary data

DP_CONNECTION_ID=1

DP_POLICY_NAME=Back up

DP_RETENTION_TYPE=DP_DAILY

LD_LIBRARY_PATH=/opt/NTAPdfm/lib/:/opt/NTAPdfm/lib:/opt/NTAPdfm/plugins

INIT_VERSION=sysvinit-2.86

DP_SERIAL_NUMBER=1-50-000001

DP_BACKUP_STATUS=DP_BEFORE_PRIMARY_SNAPSHOTS

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/NTAPdfm/bin:/opt/NTAPdfm/bin/:/opt/NTAPdfm/sbin/

DP_TO_NODE_NAME=Backup

runlevel=5

RUNLEVEL=5

DP_JOB_ID=553

PWD=/opt/NTAPdfm/sbin

LANG=en_US.UTF-8

previous=N

PREVLEVEL=N

DP_DATASET_NAME=snapvault

DP_POLICY_ID=60

SHLVL=3

HOME=/

DP_DATASET_ID=837

SATMP=/tmp

_=/usr/bin/printenv

=============== BEGIN PRE_POST SCRIPT ===============

Mon Oct 4 02:15:04 EDT 2010

MANPATH=/usr/share/man:/opt/NTAPdfm/man

CONSOLE=/dev/pts/0

SELINUX_INIT=YES

SQLANY10=/opt/NTAPdfm/

TERM=linux

DP_FROM_NODE_NAME=Primary data

DP_CONNECTION_ID=1

DP_POLICY_NAME=Back up

DP_BACKUP_RESULT=DP_SUCCEEDED

DP_RETENTION_TYPE=DP_DAILY

LD_LIBRARY_PATH=/opt/NTAPdfm/lib/:/opt/NTAPdfm/lib:/opt/NTAPdfm/plugins

INIT_VERSION=sysvinit-2.86

DP_SERIAL_NUMBER=1-50-000001

DP_BACKUP_STATUS=DP_BEFORE_TRANSFERS

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/NTAPdfm/bin:/opt/NTAPdfm/bin/:/opt/NTAPdfm/sbin/

DP_TO_NODE_NAME=Backup

runlevel=5

RUNLEVEL=5

DP_JOB_ID=553

PWD=/opt/NTAPdfm/sbin

LANG=en_US.UTF-8

previous=N

PREVLEVEL=N

DP_DATASET_NAME=snapvault

DP_POLICY_ID=60

SHLVL=3

HOME=/

DP_DATASET_ID=837

SATMP=/tmp

_=/usr/bin/printenv

=============== BEGIN PRE_POST SCRIPT ===============

Mon Oct 4 02:16:08 EDT 2010

MANPATH=/usr/share/man:/opt/NTAPdfm/man

CONSOLE=/dev/pts/0

SELINUX_INIT=YES

SQLANY10=/opt/NTAPdfm/

TERM=linux

DP_FROM_NODE_NAME=Primary data

DP_CONNECTION_ID=1

DP_POLICY_NAME=Back up

DP_BACKUP_RESULT=DP_SUCCEEDED

DP_RETENTION_TYPE=DP_DAILY

LD_LIBRARY_PATH=/opt/NTAPdfm/lib/:/opt/NTAPdfm/lib:/opt/NTAPdfm/plugins

INIT_VERSION=sysvinit-2.86

DP_SERIAL_NUMBER=1-50-000001

DP_BACKUP_STATUS=DP_AFTER_TRANSFERS

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/NTAPdfm/bin:/opt/NTAPdfm/bin/:/opt/NTAPdfm/sbin/

DP_TO_NODE_NAME=Backup

runlevel=5

RUNLEVEL=5

DP_JOB_ID=553

PWD=/opt/NTAPdfm/sbin

LANG=en_US.UTF-8

previous=N

PREVLEVEL=N

DP_DATASET_NAME=snapvault

DP_POLICY_ID=60

SHLVL=3

HOME=/

DP_DATASET_ID=837

SATMP=/tmp

_=/usr/bin/printenv

=============== BEGIN PRE_POST SCRIPT ===============

Mon Oct 4 02:16:19 EDT 2010

MANPATH=/usr/share/man:/opt/NTAPdfm/man

CONSOLE=/dev/pts/0

SELINUX_INIT=YES

SQLANY10=/opt/NTAPdfm/

TERM=linux

DP_FROM_NODE_NAME=Primary data

DP_CONNECTION_ID=1

DP_POLICY_NAME=Back up

DP_BACKUP_RESULT=DP_SUCCEEDED

DP_RETENTION_TYPE=DP_DAILY

LD_LIBRARY_PATH=/opt/NTAPdfm/lib/:/opt/NTAPdfm/lib:/opt/NTAPdfm/plugins

INIT_VERSION=sysvinit-2.86

DP_SERIAL_NUMBER=1-50-000001

DP_BACKUP_STATUS=DP_AFTER_BACKUP_REGISTRATION

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/NTAPdfm/bin:/opt/NTAPdfm/bin/:/opt/NTAPdfm/sbin/

DP_TO_NODE_NAME=Backup

runlevel=5

RUNLEVEL=5

DP_JOB_ID=553

PWD=/opt/NTAPdfm/sbin

LANG=en_US.UTF-8

previous=N

PREVLEVEL=N

DP_DATASET_NAME=snapvault

DP_POLICY_ID=60

SHLVL=3

HOME=/

DP_DATASET_ID=837

SATMP=/tmp

_=/usr/bin/printenv

Besides, Protection Manager ensures that the custom script is executed successfully. If not the backup job would fail, which ensures that you don’t end up having inconsistent snapshots.

You can also check the thread: http://communities.netapp.com/thread/1954?tstart=0 for more details.

Thanks and regards

Shiva Raja

reide
5,165 Views

My goal was to avoid having scripts on the DFM server communicating with the Oracle database servers (where the database hot-backup script has to run).  However, I can see that using the backup script with PM would be much more robust and integrates much nicer with the protection policy.

Remaining question #1)  I was under the impression that the backup script was only called fout times by a Snapvault policy.  When did it go to six?  From the dfpm man page:

For backup connections (snapvault and QSM), an installed pre- and post-processing script will be called upto four times during the course of the backup.  It is called once right before taking snapshots on the primaries. It is called again before starting data transfer for backup relationships. It is called third time after data transfer is completed. It is called fourth time after the job has registered a backup in the Protection Manager.

Remaining question #2)  Is there ANY way - secret ninja way - to register the name of a specific snapshot with a Protection Manager without using the API?   Let's say my backup script knows the name of the snapshot that I need to SnapVault.  Could the backup script somehow register this name with the dataset so that SnapVault grabs that specific snapshot on the primary?

Thank you for the help with this question.

rshiva
5,165 Views

Hi Reide,

Her are my responses:

Remaining question # 1:

Yes, your are right - My example included a backup policy with local and remote backups, so the backups script will be called twice for local backups (before and after local snapshots) plus the script will called 4 times for the remote backups - You can check the value of DP_BACKUP_STATUS in my previous post.

Remaining question # 2:

Not that I'm aware of. I don't think that's possible today. Sorry 😞

Thanks and regards

Shiva Raja

reide
5,165 Views

Thanks Shiva!  Excellent information.

Reid

lafoucrier
5,165 Views

Hello everybody,

maybe things have moved on since this post was published, i will explain my needs :

Actually, we use Protection Manager and we need to be able to use a specific snapshot on the primary volume to run the Snapvault transfert to secondary volume, then register a secondary volume's snapshot in Prot Manager.

Am I able to do that with Prot Manager pre and post scripts?

Has someone already create those type of scripts? If yes could you let me aware of the API/CLI command and the method used?

Many thanks in advance,

Best regards,

Yannick

adaikkap
5,165 Views

Hi Yannick,

     Nothing has changed.  Either  you will have to use one of the snapmanager to do what you want, or use snapcreator, which can register any snapshot with PM.

All in all a normal dataset takes its own snapshot and does the update where in case of application dataset a named snapshot registered with PM is used to update the relationship.

Regards

adai

lafoucrier
5,165 Views

Hello Adai,

Thanks for your feed back,

My problem is that my platform is Hyper-V, and SMHV cannot at this time (and as long as i know) be aware of Protection Manager + Snapvault.

I explore a little bit what Snapcreator can do and in // I'm also searching script to trigger VSS writer for Hyper-V VMs before triggering Prot Manager => but it seems realy hard to find help about it.

Regards,

Yannick 

adaikkap
4,438 Views

Easiest way is to get snapcreator and write a plugin for Hyper -V. It might as well exist. Or you can use snapcreator to register external snapshot( in this case the ones taken by SMHV).

Regards

adai

lafoucrier
4,438 Views

It seems that nobody's working on it actually : https://communities.netapp.com/thread/16838 Do you've more information about it?

my main need will be to store Hyper-V "application consistent" backup on secondary (backup) Filer managed by PM, so snapcreator + SMHV does not seems to fit my needs for the moment, Am I correct?

thanks for your help.

Regards,

Yannick,

adaikkap
4,438 Views

HI Yannick,

     As I said earlier the latest version of snap creator helps you to register external snapshot not take by SC to register as a backup version in PM. This way you can register the SMHV created snapshot using SC into PM. Isnt it what you are looking for ?

Regards

adai

lafoucrier
4,438 Views

Hi Adai,

Yes I understand that now, I had a little more precision about it talking with Keith here :

https://communities.netapp.com/message/85685#85685

The main problem now (and I understand why it's difficult to work with Hyper-V CSV volume + VSS  for VMs application consistent backup ) is that SMHV take multiple snapshots to backup an single CSV volume (this behavior is explained in KB 2010607), so in my context that mean that for each volume's Snapshots I will register with Protection Manager I will do a Snapvault transfert for each Snapshot to archive the backups for a single volume... and I had many.

it's unfortunnatly not a perennial solution for us...

By the way for many thanks your time and information you provide.

Please Let me know if you heard about solutions for this.

For the moment I will continue to use crash consistent backup for CSV volumes, and maybe try to quiesce MSSQL Databases (my main "application backup problem") in another way.

until now we do not retain SMSQL tool because it will be difficult to implement (need to separate dbfiles, temp, snapinfo directory acrros many Luns), but maybe this will be the only solution...

Best regards,

Yannick,

smoot
5,165 Views
Remaining question #2)  Is there ANY way - secret ninja way - to register the name of a specific snapshot with a Protection Manager without using the API?   Let's say my backup script knows the name of the snapshot that I need to SnapVault.  Could the backup script somehow register this name with the dataset so that SnapVault grabs that specific snapshot on the primary?

Thank you for the help with this question.

Short answer: no.

Long answer: The secret ninja way is to use SnapManager for Oracle. It was written to do exactly what you're trying to accomplish, including not needing scripts on the DFM station. Have you evaluated that? It's not easy to get this correct and robust.

-- Pete

Public