NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Active IQ Unified Manager Discussions

error Resize volume

Aswani_Kumar
3,433 Views

I wrote a perl code to resize size a volume (extend volume size by X mb).

 

I am getting following error.

Capture10.JPG

#!/usr/bin/perl

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

my $cmarray;
my $vserver;
my $volumeName;
my $volumesize;

GetOptions ("cmarray=s" => \$cmarray,
"vservername=s" => \$vserver,
"volumeName=s" => \$volumeName,
"volumesize=i" => \$volumesize) or die 'Illegal command parameters';

if (defined $volumesize && $volumesize < 0)
{
    die 'Negative volumesize argument not allowed: \''.$volumesize.'\'';
}

my $wfaUtil = WFAUtil->new();

$wfaUtil->sendLog('INFO','Connecting to array: '.$cmarray);
my $server = $wfaUtil->connect($cmarray,$vserver);

$wfaUtil->sendLog('INFO','Setting volume size : '.$volumesize.' on volume: '.$volumeName);
my $out = $wfaUtil->checkFailure('Failed running volume-size',$server->invoke('volume modify ',' -volume ',$volumeName,' -size ',' +',$volumesize.'m'));

1 REPLY 1

rwelshman
3,421 Views

Just guessing here, but you may have to provide that it is GB or MB or KB as well as the number value of the size.

Public