The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to register at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Active IQ Unified Manager Discussions

error with 'OntapClusterAPI.pm

dblackwe

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

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

dblackwe

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.

karale

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

rkiran

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

dblackwe

That fixed it, but can you explain why?

dblackwe

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

@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

NetApp Release 9.0

karale

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

dblackwe

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

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public