From f56a76f7d82ac52631bbdedbe29e814c4a1c9346 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 28 Sep 2009 17:59:43 +0000 Subject: [PATCH] -Allow specifying multiple sizes for different virtual drives git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4252 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index 78aceaf0e..339eccf66 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -913,7 +913,6 @@ sub mkvms { GetOptions( 'size|s=s' => \$disksize ); - $disksize = getUnits($disksize,'G',1024); my $node; $hyphash{$hyp}->{hostview} = get_hostview(hypname=>$hyp,conn=>$hyphash{$hyp}->{conn}); #,properties=>['config','configManager']); unless (validate_datastore_prereqs($nodes,$hyp)) { @@ -1193,7 +1192,8 @@ sub create_nic_devs { sub create_storage_devs { my $node = shift; my $sdmap = shift; - my $size = shift; + my $sizes = shift; + my @sizes = split /[,:]/, $sizes; my $scsicontrollerkey=0; my $idecontrollerkey=200; #IDE 'controllers' exist at 200 and 201 invariably, with no flexibility? #Cannot find documentation that declares this absolute, but attempts to do otherwise @@ -1209,6 +1209,9 @@ sub create_storage_devs { my %disktocont; my $dev; foreach (split /,/,$tablecfg{vm}->{$node}->[0]->{storage}) { + my $disksize = shift @sizes; + unless (scalar @sizes) { @sizes = ($disksize); } #if we emptied the array, stick the last entry back on to allow it to specify all remaining disks + $disksize = getUnits($disksize,'G',1024); s/\/$//; $backingif = VirtualDiskFlatVer2BackingInfo->new(diskMode => 'persistent', fileName => "[".$sdmap->{$_}."]"); @@ -1230,7 +1233,7 @@ sub create_storage_devs { controllerKey => $idecontrollerkey, key => $currkey++, unitNumber => $unitnum++, - capacityInKB => $size); + capacityInKB => $disksize); push @devs,VirtualDeviceConfigSpec->new(device => $dev, fileOperation => VirtualDeviceConfigSpecFileOperation->new('create'), operation => VirtualDeviceConfigSpecOperation->new('add'));