Subscribe

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

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.

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

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.

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

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

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

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.

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

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 Smiley Sad

Thanks and regards

Shiva Raja

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

Thanks Shiva!  Excellent information.

Reid

Re: Can you force a protection policy to use a specific SnapVault schedule in 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.

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

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

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

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

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

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

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