Data Backup and Recovery

Snapcreator and Zimbra

c_delporte
3,491 Views

hello communities,

i wanted to know of it's possible to have a backup and DR plan with snapcreator. IMT doest not support Zimbra in the "Host Application" section ...

Christophe

1 ACCEPTED SOLUTION

ktenzer
3,491 Views

Hi Christophe,

Absolutely!

Snap Creator provides two ways to create a solution for Zimbra:

1. APP_QUIESCE/UNQUIESCE/PRE_EXIT_CMDS

This thread explains how to do this using informix as the example

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

APP_QUIESCE_CMDS - Run before snapshot is taken and are agent aware

APP_UNQUIESCE_CMDS - Run after snapshot is taken and are agent aware

PRE_EXIT_CMDS - Run when error occurs and are agent aware. You would just want to do what you do for unquiesce here, maybe some extra error checking as well.

All you need to do is to figure out how to quiesce and unquiesce Zimbra from the CLI. The scAgent allows Snap Creator to run these commands remotely which provides a centralized solution. In addition SC can integrate with Protection Manager and provide restore (data from snapshot) as well as many other data protection solutions. They key is that we have a Zimbra consistent snapshot, then everything is possible.

2. Create a plug-in

To create a plug-in you should join the Snap Creator Developer community www.snapcreator.com. Currently there are some technical issues preventing some from logging in, we hope to have these addressed soon. Anyone with a NOW account should have access but again there are some technical issues.

A plug-in can be created in any programming or scripting language, so you could even do it in poweshell or unix shell script. A plug-in allows you to provide more advanced capabilities like recover or cloning. If you just care about automation of backup process then option 1 is easiest.

In the Snap Creator Developer community there are plenty of folks, including myself that will help you create / understand how to create plug-ins. It only takes about a hour to get started

Creating a plugin also allows you to share your solution with other's or other customers. If you are a partner or service provider this would be very interesting. A Plug-in finally could end up in the supported product one day so that is an advantage as well.

Here is an example of a shell script plug-in:

db2.sh

#!/bin/bash

case "$1" in

    "-describe" )

        echo "SC_DESCRIBE#OP#quiesce"

        echo "SC_DESCRIBE#OP#unquiesce"

        echo "SC_DESCRIBE#DESCRIPTION#Plug-in to handle DB2 database integration"

        echo "SC_DESCRIBE#PARAMETER#SCRIPT_DB2_DATABASE#DB2 database name#SCRIPT_DB2_DATABASE=value#dbname"

            echo "SC_DESCRIBE#PARAMETER#SCRIPT_DB2_CMD#The dbmcli command used for database operations#SCRIPT_DB2_CMD=value#/path/to/dbmcli"

        echo "describe completed successfully"

       

        exit 0;

        ;;

    "-quiesce" )

        echo "SC_MSG#INFO#[`date`]#Quiescing database $SCRIPT_DB2_DATABASE"

        echo "SC_MSG#INFO#[`date`]#Executing command dbmcli"

        # Perform write suspend

        RUN_CMD=`$SCRIPT_DB2_CMD -tv <<EOF

            connect to $SCRIPT_DB2_DATABASE;

            set write suspend for database;

            connect reset;`

        EXIT_CODE=$?

       

        if [ "$EXIT_CODE" -ne "0" ]; then

           

            echo "SC_MSG#ERROR#[`date`]#The dbmcli command failed with exit code $EXIT_CODE"

            echo "SC_MSG#DEBUG#[`date`]#$RUN_CMD"

            echo "SC_MSG#INFO#[`date`]#Quiescing database $SCRIPT_DB2_DATABASE failed"

            exit 1

        else

            echo "SC_MSG#INFO#[`date`]#The dbmcli command completed successfully"

            echo "SC_MSG#DEBUG#[`date`]#$RUN_CMD"

        fi

        echo "SC_MSG#INFO#[`date`]#Quiescing database $SCRIPT_DB2_DATABASE finished successfully"

        ;;

    "-unquiesce" )

        echo "SC_MSG#INFO#[`date`]#Unquiescing database $SCRIPT_DB2_DATABASE"

        echo "SC_MSG#INFO#[`date`]#Executing command dbmcli"

        # Perform write resume

        RUN_CMD=`$SCRIPT_DB2_CMD -tv <<EOF

            connect to $SCRIPT_DB2_DATABASE;

            set write resume for database;

            connect reset;`

       

        EXIT_CODE=$?

       

        if [ "$EXIT_CODE" -ne "0" ]; then

           

            echo "SC_MSG#ERROR#[`date`]#The dbmcli command failed with exit code $EXIT_CODE"

            echo "SC_MSG#DEBUG#[`date`]#$RUN_CMD"

            echo "SC_MSG#INFO#[`date`]#Unquiescing database $SCRIPT_DB2_DATABASE failed"

            exit 1

        else

            echo "SC_MSG#INFO#[`date`]#The dbmcli command completed successfully"

            echo "SC_MSG#DEBUG#[`date`]#$RUN_CMD"

        fi

        echo "SC_MSG#INFO#[`date`]#Unquiescing database $SCRIPT_DB2_DATABASE finished successfully"

        ;;

    * )

        echo "not implemented";

        exit 1

        ;;

esac

exit 0;

This is a real world example of how to create a shell script plugin with DB2 as database. SC offers a full DB2 plugin this was just an example to give you an idea of what is involved.

To use this plugin you would set following in config:

APP_NAME=db2.sh

SCRIPT_DB2_DATABASE=dbname

SCRIPT_DB2_CMD=/path/to/db2

Any key/value set in config is passed to plugin as environement variable

View solution in original post

2 REPLIES 2

ktenzer
3,492 Views

Hi Christophe,

Absolutely!

Snap Creator provides two ways to create a solution for Zimbra:

1. APP_QUIESCE/UNQUIESCE/PRE_EXIT_CMDS

This thread explains how to do this using informix as the example

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

APP_QUIESCE_CMDS - Run before snapshot is taken and are agent aware

APP_UNQUIESCE_CMDS - Run after snapshot is taken and are agent aware

PRE_EXIT_CMDS - Run when error occurs and are agent aware. You would just want to do what you do for unquiesce here, maybe some extra error checking as well.

All you need to do is to figure out how to quiesce and unquiesce Zimbra from the CLI. The scAgent allows Snap Creator to run these commands remotely which provides a centralized solution. In addition SC can integrate with Protection Manager and provide restore (data from snapshot) as well as many other data protection solutions. They key is that we have a Zimbra consistent snapshot, then everything is possible.

2. Create a plug-in

To create a plug-in you should join the Snap Creator Developer community www.snapcreator.com. Currently there are some technical issues preventing some from logging in, we hope to have these addressed soon. Anyone with a NOW account should have access but again there are some technical issues.

A plug-in can be created in any programming or scripting language, so you could even do it in poweshell or unix shell script. A plug-in allows you to provide more advanced capabilities like recover or cloning. If you just care about automation of backup process then option 1 is easiest.

In the Snap Creator Developer community there are plenty of folks, including myself that will help you create / understand how to create plug-ins. It only takes about a hour to get started

Creating a plugin also allows you to share your solution with other's or other customers. If you are a partner or service provider this would be very interesting. A Plug-in finally could end up in the supported product one day so that is an advantage as well.

Here is an example of a shell script plug-in:

db2.sh

#!/bin/bash

case "$1" in

    "-describe" )

        echo "SC_DESCRIBE#OP#quiesce"

        echo "SC_DESCRIBE#OP#unquiesce"

        echo "SC_DESCRIBE#DESCRIPTION#Plug-in to handle DB2 database integration"

        echo "SC_DESCRIBE#PARAMETER#SCRIPT_DB2_DATABASE#DB2 database name#SCRIPT_DB2_DATABASE=value#dbname"

            echo "SC_DESCRIBE#PARAMETER#SCRIPT_DB2_CMD#The dbmcli command used for database operations#SCRIPT_DB2_CMD=value#/path/to/dbmcli"

        echo "describe completed successfully"

       

        exit 0;

        ;;

    "-quiesce" )

        echo "SC_MSG#INFO#[`date`]#Quiescing database $SCRIPT_DB2_DATABASE"

        echo "SC_MSG#INFO#[`date`]#Executing command dbmcli"

        # Perform write suspend

        RUN_CMD=`$SCRIPT_DB2_CMD -tv <<EOF

            connect to $SCRIPT_DB2_DATABASE;

            set write suspend for database;

            connect reset;`

        EXIT_CODE=$?

       

        if [ "$EXIT_CODE" -ne "0" ]; then

           

            echo "SC_MSG#ERROR#[`date`]#The dbmcli command failed with exit code $EXIT_CODE"

            echo "SC_MSG#DEBUG#[`date`]#$RUN_CMD"

            echo "SC_MSG#INFO#[`date`]#Quiescing database $SCRIPT_DB2_DATABASE failed"

            exit 1

        else

            echo "SC_MSG#INFO#[`date`]#The dbmcli command completed successfully"

            echo "SC_MSG#DEBUG#[`date`]#$RUN_CMD"

        fi

        echo "SC_MSG#INFO#[`date`]#Quiescing database $SCRIPT_DB2_DATABASE finished successfully"

        ;;

    "-unquiesce" )

        echo "SC_MSG#INFO#[`date`]#Unquiescing database $SCRIPT_DB2_DATABASE"

        echo "SC_MSG#INFO#[`date`]#Executing command dbmcli"

        # Perform write resume

        RUN_CMD=`$SCRIPT_DB2_CMD -tv <<EOF

            connect to $SCRIPT_DB2_DATABASE;

            set write resume for database;

            connect reset;`

       

        EXIT_CODE=$?

       

        if [ "$EXIT_CODE" -ne "0" ]; then

           

            echo "SC_MSG#ERROR#[`date`]#The dbmcli command failed with exit code $EXIT_CODE"

            echo "SC_MSG#DEBUG#[`date`]#$RUN_CMD"

            echo "SC_MSG#INFO#[`date`]#Unquiescing database $SCRIPT_DB2_DATABASE failed"

            exit 1

        else

            echo "SC_MSG#INFO#[`date`]#The dbmcli command completed successfully"

            echo "SC_MSG#DEBUG#[`date`]#$RUN_CMD"

        fi

        echo "SC_MSG#INFO#[`date`]#Unquiescing database $SCRIPT_DB2_DATABASE finished successfully"

        ;;

    * )

        echo "not implemented";

        exit 1

        ;;

esac

exit 0;

This is a real world example of how to create a shell script plugin with DB2 as database. SC offers a full DB2 plugin this was just an example to give you an idea of what is involved.

To use this plugin you would set following in config:

APP_NAME=db2.sh

SCRIPT_DB2_DATABASE=dbname

SCRIPT_DB2_CMD=/path/to/db2

Any key/value set in config is passed to plugin as environement variable

keitha
3,491 Views

Christophe,

What did you decide to do? I'm curious to know..

Thanks

Keith

Public