Active IQ Unified Manager Discussions

error with 'OntapClusterAPI.pm

dblackwe
4,749 Views

I am working on a custom workflow for a customer and I am using much of the 0-day cluster setup from the automation store page.  However, most of those commands are generating this error, when I try to run them;

 

13:38:17.172 ERROR  [Rename Root Aggregate] Failed executing command. Exception: No definition for typedef inofile-version found at /opt/netapp/wfa/perl/nmsdk/OntapClusterAPI.pm line 79836, <STDIN> line 1.

 

I can't figure out what this is.  I have simply created new commands for some of the simpler ones, but I was hoping to use some of them.

 

Can anyone tell me what this is and whats causing it?

1 ACCEPTED SOLUTION

rkiran
4,602 Views

Hi,

As a workaround can you disable bindings validation using: $server->set_bindings_validation(0) and check if your has command has executed successfully.

View solution in original post

9 REPLIES 9

karale
4,725 Views

You might be having older version of NMSDK. What is the version of WFA?

dblackwe
4,704 Views

I am using the most current RC of 4.x on linux.

dblackwe
4,695 Views

Here is the code that is causing the error.

 

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

my $cluster;

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

my $wfaUtil = WFAUtil->new();
$wfaUtil->sendLog('INFO',"Connecting to cluster");
my $server = $wfaUtil->connect($cluster);

$wfaUtil->sendLog('INFO',"Rename root aggregate  ");
my @aggrList = aggrGetInfo();

foreach my $aggrDetails (@aggrList) {
    my ($aggregate, $aggregateOwner, $aggrDiskCount, $aggrIsRoot) = split (/,/,$aggrDetails);
    my $newAggrName = $aggregateOwner . "_root";
    if ($aggrIsRoot =~ m/true/) {
	if ($aggregate =~ m/$newAggrName/) {
	    $wfaUtil->sendLog('INFO',"Root aggregate for $aggregateOwner is named correctly.\n");
	}
	else {
	    #Rename aggregate
	    $newAggrName=~s/-/_/g;	
	    $wfaUtil->sendLog('INFO', "Rename of aggregate $aggregate to $newAggrName ");
	    $server->aggr_rename('aggregate', $aggregate,'new-aggregate-name',$newAggrName);
	    $wfaUtil->sendLog('INFO', 'Rename of a aggregate operation completed successfully.'); 
	} 
	#Fix root aggregate diskcount 
	if ($aggrDiskCount < 5 ) {
	    my $addDisks = 5 - $aggrDiskCount,;
	    $server->aggr_add('aggregate', $newAggrName,'disk-count',$addDisks);
	    $wfaUtil->sendLog('INFO', 'Rename of a aggregate operation completed successfully.');
	}
    } 
}


sub aggrGetInfo {
    # Initialize variables
    my @aggrs;
    my $aggrOwner;
    my $in = $server->aggr_get_iter();
    # Proccess the attributes  
    foreach my $aggrInfo (@{$in->{'attributes-list'}->{'aggr-attributes'}}) {
        my $aggrName = $aggrInfo->{'aggregate-name'};
        if (my $aggrOwnerAttrs = $aggrInfo->{'aggr-ownership-attributes'}) {
            $aggrOwner = $aggrOwnerAttrs->{'owner-name'};
        }
        if (my $aggrRaidAttrs = $aggrInfo->{'aggr-raid-attributes'}) {
            my $aggrIsRoot = $aggrRaidAttrs->{'has-local-root'};
            my $aggrDiskCount = $aggrRaidAttrs->{'disk-count'};
            my $aggrNameAndOwner = "$aggrName,$aggrOwner,$aggrDiskCount,$aggrIsRoot";
            push (@aggrs, $aggrNameAndOwner);
        }
    }
    return (@aggrs); 
}

sinhaa
4,680 Views

@dblackwe

 

Can you post what is the ONTAP version you are using?

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

dblackwe
4,678 Views

NetApp Release 9.0

dblackwe
4,620 Views

I can't fix my problem yet, but I know what is causing the error.  It's any command that does a data pull to get information from the cluster.  Take the following example;

 

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

my $cluster;
my $node;

GetOptions(
    "Cluster=s"   => \$cluster,
    "Node=s"	=> \$node,
) or die 'Illegal command parameters\n';

my $wfaUtil = WFAUtil->new();

$wfaUtil->sendLog('INFO',	"Connecting to the cluster: $cluster" );
my $server = $wfaUtil->connect($cluster);

my $oldAggr = aggrGetInfo();

my $newAggrName = $node . "_root";

$wfaUtil->sendLog('INFO',"Rename aggregate $oldAggr ");
eval {
    $server->aggr_rename('aggregate', $oldAggr, 'new-aggregate-name', $newAggrName);
    $wfaUtil->sendLog('INFO', 'Rename of aggregate operation completed successfully.');
};
if($@) {
    die "Failed to rename the Aggregate" . $@;
}

sub aggrGetInfo {
    # Initialize variables
    my @aggrs;
    my $aggrOwner;
    my $aggrName;
    my $in = $server->aggr_get_iter();
    # Proccess the attributes  
    foreach my $aggrInfo (@{$in->{'attributes-list'}->{'aggr-attributes'}}) {
	my $aggrOwnerAttrs = $aggrInfo->{'aggr-ownership-attributes'};
	$aggrOwner = $aggrOwnerAttrs->{'owner-name'};
	if (my $aggrOwner eq $node) {
		$aggrName = $aggrInfo->{'aggregate-name'};
	}
    }
    return ($aggrName); 
}

Before I added the aggrGetInfo section and just used hard coded entries, it worked fine.  After adding the section to pull information, I get the error.

rkiran
4,603 Views

Hi,

As a workaround can you disable bindings validation using: $server->set_bindings_validation(0) and check if your has command has executed successfully.

dblackwe
4,598 Views

That fixed it, but can you explain why?

karale
4,601 Views

Probably you need right content version. Check if downloading and importing pack from http://automationstore.netapp.com/pack-detail.shtml?packUuid=WFA_pack_for_managing_Clustered_Data_ONTAP&packVersion=1.1.0 will help

Public