From ccddc9616a7104ff8b22853a94c68fd7bdd765ca Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 8 Feb 2011 21:33:06 +0000 Subject: [PATCH] -Pull in vm.othersettings on vm creation if specified git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8804 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index 27257dfcd..2419e9bbe 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -2528,7 +2528,20 @@ sub build_cfgspec { my $vpdtab = xCAT::Table->new('vpd'); $vpdtab->setNodeAttribs($node,{uuid=>$uuid}); } - return VirtualMachineConfigSpec->new( + my @optionvals; + if ($tablecfg{vm}->{$node}->[0]->{othersettings}) { + my $key; + my $value; + foreach (split /;/,$tablecfg{vm}->{$node}->[0]->{othersettings}) { + ($key,$value)=split /=/; + if ($value) { + push @optionvals,OptionValue->new(key=>$key,value=>$value); + } else { + push @optionvals,OptionValue->new(key=>$key); + } + } + } + my %specargs = ( name => $node, files => $vfiles, guestId=>$nodeos, @@ -2536,7 +2549,11 @@ sub build_cfgspec { numCPUs => $ncpus, deviceChange => \@devices, uuid=>$uuid, - ); + ); + if (@optionvals) { + $specargs{extraConfig}=\@optionvals; + } + return VirtualMachineConfigSpec->new(%specargs); } sub create_nic_devs {