Data Infrastructure Management Software Discussions

error Resize volume

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

Re: error Resize volume

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.

Cloud Volumes ONTAP
Review Banner
All Community Forums
Public