From e38a8fbe3c286ca3b2d4939664ddb9fc35cb8e5a Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 10 Jul 2009 19:08:06 +0000 Subject: [PATCH] -Support diskless guests by using the cfgdatastore attribute if defined allowing storage to be blank git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3758 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/VMCommon.pm | 2 +- xCAT-server/lib/xcat/plugins/esx.pm | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/VMCommon.pm b/perl-xCAT/xCAT/VMCommon.pm index 6bb7d8d84..14907f2d7 100644 --- a/perl-xCAT/xCAT/VMCommon.pm +++ b/perl-xCAT/xCAT/VMCommon.pm @@ -18,7 +18,7 @@ sub grab_table_data{ #grab table data relevent to VM guest nodes $callback->({data=>["Cannot open vm table"]}); return; } - $cfghash->{vm} = $vmtab->getNodesAttribs($noderange,['node','host','migrationdest','storage','memory','cpus','nics','bootorder','virtflags']); + $cfghash->{vm} = $vmtab->getNodesAttribs($noderange,['node','host','migrationdest','cfgstore','storage','memory','cpus','nics','bootorder','virtflags']); my $mactab = xCAT::Table->new("mac",-create=>1); my $nrtab= xCAT::Table->new("noderes",-create=>1); $cfghash->{mac} = $mactab->getAllNodeAttribs(['mac'],1); diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index 04337724d..ab6ce054c 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -1092,7 +1092,11 @@ sub register_vm_callback { sub getcfgdatastore { my $node = shift; my $dses = shift; - my $cfgdatastore = $tablecfg{vm}->{$node}->[0]->{storage}; #TODO: need a new cfglocation field in case of stateless guest? + my $cfgdatastore = $tablecfg{vm}->{$node}->[0]->{cfgstore}; + unless ($cfgdatastore) { + $cfgdatastore = $tablecfg{vm}->{$node}->[0]->{storage}; + #TODO: if multiple drives are specified, make sure to split this out + } $cfgdatastore =~ s/,.*$//; $cfgdatastore =~ s/\/$//; $cfgdatastore = "[".$dses->{$cfgdatastore}."]";