Active IQ Unified Manager Discussions

error Resize volume

Aswani_Kumar
2,859 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
2,847 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