Subscribe

WFA workflow - Perl Binding API - snapmirror_destroy

I am writing a WFA workflow which deletes a snapmirror relationship. The code works fine if a snapmirror relatioship exists. But, 'snapmirror_destroy' throws an error if  a snapmirror relationship does not exist. I would like to ignore this error.  I tried 'eval', 'if' & 'try'. But havent figured out how to make the workflow finish succeffuly. Any ideas how I can accomplish this?

 

 

 ERROR:

14:42:23.654 ERROR  [cDOT_snapmirror_delete_v1.0 ] Failed executing command. Exception: Relationship with destination vserver01:sm_vol_7mode_cdot_snapmirror not found. (entry doesn't exist) (15661)

 

 

use strict;
use WFAUtil;
use Getopt::Long;

 
my $DestinationVserver; 
my $DestinationVolume; 
my $ClusterFQDN;  
my $sminfo = {};


GetOptions (
            "DestinationVserver=s" => \$DestinationVserver,
            "DestinationVolume=s" => \$DestinationVolume,
            "ClusterFQDN=s" => \$ClusterFQDN,
           ) or die "Illegal Command Parameters \n"; 


my $wfaUtil = WFAUtil->new();

my $server = $wfaUtil->connect($ClusterFQDN);

$wfaUtil->sendLog( 'INFO','Deleteing snapmirror relationship...');

my %init_input = ('destination-location' => "$DestinationVserver:$DestinationVolume");

try {
  $server->snapmirror_destroy(%init_input)
} catch {
  $wfaUtil->sendLog( 'INFO','A snapmirror relationship was not found'); 
}