Active IQ Unified Manager Discussions

WFA to abort all running snapmirrors

blando
8,185 Views

Hi all, Hope I can find help here configuring my first workflow.

 

In my network, I have many remote locations, been mirrored or vaulted to one SVM located in the center.

Due to WAN bandwitch and amount of data, there are always some mirrors still running on mornings.

I am trying to build, Or customize the built-in "abort snapmirror relationship" workflow. What I want to do is to let it run on the destination SVM- And Abort all running mirrors.

 

Problems I run into are:

If I configure the destination cluster and SVM, It will only "see" the first relationship I have, out of many.

If I configure it with Destination volume- How can I do it? Is there a way to use a wildcard search, or somehow configure it run on all relationships?

 

All clusters are at least 8.2.2 cDOT. no 8.3.X for now. 

WFA version 3.1P1

 

Thank you!!

 

Itay

 

 

1 ACCEPTED SOLUTION

JoelEdstrom
8,161 Views

Hi Blando,

 

Have you looked at using the 'repeat row' function and having the row repeat based on resources in a group?  It'll let you iterate through a set of commands for every member/row round using a filter or finder.  You could hardcode individual cluster/vserver names if you want - in the example below I'm using a user input variable instead.

 

wfa_repeat_row_3.1.PNG

 

 

I mocked up a quick workflow in WFA 3.1 that would iterate through each SnapMirror relationship and attached it to this thread.  I didn't have time today to actaully test it out today (the previews all look good), but it looks like it would do the trick on a per-vserver basis.  If you wanted to I'm sure you could nest this workflow in a separate workflow that iterates through a list of vservers.

 

It's worth noting I don't have access to any 8.2.X cDOT clusters right now and primarily use 8.3+; but could spin up some simulators in my home lab if you get stuck with something.

 

Let me know if you have any questions, happy to help.

View solution in original post

12 REPLIES 12

JoelEdstrom
8,162 Views

Hi Blando,

 

Have you looked at using the 'repeat row' function and having the row repeat based on resources in a group?  It'll let you iterate through a set of commands for every member/row round using a filter or finder.  You could hardcode individual cluster/vserver names if you want - in the example below I'm using a user input variable instead.

 

wfa_repeat_row_3.1.PNG

 

 

I mocked up a quick workflow in WFA 3.1 that would iterate through each SnapMirror relationship and attached it to this thread.  I didn't have time today to actaully test it out today (the previews all look good), but it looks like it would do the trick on a per-vserver basis.  If you wanted to I'm sure you could nest this workflow in a separate workflow that iterates through a list of vservers.

 

It's worth noting I don't have access to any 8.2.X cDOT clusters right now and primarily use 8.3+; but could spin up some simulators in my home lab if you get stuck with something.

 

Let me know if you have any questions, happy to help.

vinothini
8,096 Views

Hi,

 

"Abort Snapmirror relationship" workflow supports volume level Snapmirror abort for single selected volume. You can use WFA row repetition option to select all the volume to run ‘Abort Snapmirror’.

Please refer the attached sample workflow to perform iteration of command.

 

Workflow name : Abort Snapmirror relationship_Test

Developed on :WFA 3.1

blando
8,094 Views

Hi Vinothini,

I import the DAR file to WFA. But I simply don't see it after that in Designer page.

Is it related to this message that I get? "The dar file contains NetApp certified content which is not signed by NetApp."

 

Thank you,

Itay

 

vinothini
8,092 Views

Hi Itay,

 

Please find the attached uncerficated sample workflow.

 

Regards,

Vinothini M.

blando
8,088 Views

Hi Joel,

Thanks for helping out here.

 

Your workflow looks like what I'm looking for. I have only 1 destination Vserver- So I either mark it or hard coded it later.

WHat I think doesn't work is this: Once the workflow identifies the first relationship that is not "transferring" , If fails the execution with error message:

"Failed to abort transfer for the relationship cluster://Vserver/dest_vol_name: No transfer to abort."

 

How can we force it to continue to the next one?

 

Thank you,

Blando

 

GaurabBanerjee
8,077 Views

Hi Blando,

 

There is no way to do a force continuation to the next iteration (when one has failed due to some reason) other than command manipulation in WFA.

 

You can manipulate your command in interest, using the below APIs

  1. getWfaWorkflowParameter
  2. addWfaWorkflowParameter

Do not write flat eval/catch code rather use the output from the above APIs.

use strict;
use .....

my $Cluster;
my .......
my $ErrorIfUnsuccessful = 'true';
my $SkipIfPreviousError = 'false';
my $lunPreviousErrorCode = "0";
my $lunPreviousErrorReason;

GetOptions(
    "Cluster=s"             => \$Cluster,
    ......
) or die 'Illegal command parameters';

my $wfa_util = WFAUtil->new();

if ($SkipIfPreviousError eq 'true') {
    $lunPreviousErrorCode = $wfa_util->getWfaWorkflowParameter('lun_previous_error_code');
}
if ($lunPreviousErrorCode ne "0") {
    $wfa_util->sendLog('INFO', "Changing state of LUN $LunName has been skipped due to unsuccessful completion of previous step(s)");
    $lunPreviousErrorReason = $wfa_util->getWfaWorkflowParameter('lun_previous_error_reason');
    $wfa_util->sendLog('INFO', "Estimated previous error: $lunPreviousErrorReason");
}
else {
    eval {
        $wfa_util->sendLog('INFO', 'Connecting to cluster: ' . $Cluster);

        # DO SOMETHING ......

       $wfa_util->addWfaWorkflowParameter('lun_previous_error_code', 0, 0);
    };

    if ($ErrorIfUnsuccessful eq 'true') {
        $wfa_util->checkEvalFailure("Failed to change state (to $ChangeState) for LUN '$LunName'", $@);
    }
    else {
        if ($@) {
            my ($error_reason, $error_code) = $wfa_util->getEvalErrorReasonAndCode($@);
            $wfa_util->sendLog('ERROR', "Failed to change state (to $ChangeState) for LUN '$LunName': $error_reason ($error_code)");
            $wfa_util->addWfaWorkflowParameter('lun_previous_error_code', $error_code, 0);
            $wfa_util->addWfaWorkflowParameter('lun_previous_error_reason', $error_reason, 0);
        }
    }
}

This is an example of manupulation of code of our interest. This will also do skipping of further steps in one iteration upon failure in one step. At the same time you need to control the command instance in an intelegent way as well.

You can refer to the pack “Foreign LUN Import” from the store.

 

Thanks,

Gaurab

blando
8,042 Views

Hi,

OK, So I was working with the workflow I got from Joel.

I was able to pin point it to the destination Vserver. Also the way that I found in order to make it continue running even if it gets into relationship that is not "tranfrerring" was this:

In the "Abort SnapMirror command, at the end of it it shows:

 

...

$wfa_util->checkEvalFailure(
"Failed to abort transfer for the relationship $DestinationCluster://$DestinationVserver/$DestinationVolume",
$@

...

 

I removed the '$@' and it keeps on to the next relationship anyway. So it's good. But what does '$@' means anyway? Smiley Happy

 

ALso scheduled it, and it works great !

 

My first ever workflow 🙂

 

Thanks!!

 

blando
8,037 Views

Forgot to ask this:

 

WHen I create a schedule, Is there a way to configure it to run on specific days of the week, like Mon-Fri only?

 

thank you!

 

Blando

 

GaurabBanerjee
8,036 Views

Hi Blando,

 

It is a Perl special variable to catch error during eval execution (could be a syntax error as well).

When an eval finishes, you want to know whether it exited normally or whether it caught a fatal error. If the eval caught a fatal error, it returns undef and puts the error message in the $@ special variable, perhaps something like: Illegal division by zero.

 

Hope this helps.

 

Thanks,

Gaurab

JoelEdstrom
7,160 Views

I'm glad you were able to get this working!

 

The WFA schedule engine is...lacking...so you'll need to setup 5 individual 'weekly' schedules, one schedule for each day Mon-Fri, and setup a recurring execution for each of the schedules.  It's not as pretty as it could be but it works.

blando
7,150 Views

Thanks Joel,

I create 5 weekly schedules. 

Do I also need to clone the workflow 5 times, and accosiate 1 workflow to 1 schedule?

 

Or I didn't understand something here? Smiley Indifferent

 

Thanks

Itay

 

JoelEdstrom
7,132 Views

 

No need to clone the workflow.  When you go to execute the workflow select 'execute recurrently' and you'll have a dropdown of the schedules you made.  Run this process through 5 times, once for each workflow, and it sounds like you'll be all set.

 

wfa_execute_recur.png

Public