From cb5e4be30b28e8ad121384d8c1371bf3a657b08e Mon Sep 17 00:00:00 2001 From: linggao Date: Mon, 21 Sep 2009 17:19:37 +0000 Subject: [PATCH] added provmethod in osimage table git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4187 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Schema.pm | 61 +++++++++++++++------------ xCAT-server/lib/perl/xCAT/SvrUtils.pm | 10 ++++- 2 files changed, 42 insertions(+), 29 deletions(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 3c0de7118..2ef9943d5 100644 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -390,7 +390,7 @@ nodetype => { os => 'The operating system deployed on this node. Valid values: AIX, rh*, centos*, fedora*, sles* (where * is the version #).', arch => 'The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64.', profile => 'Either the name of an xCAT osimage definition or a pointer to a kickstart or autoyast template to use for OS deployment of this node.', - provmethod => 'The provisioning method for node deployment. The valid values are install and netboot.', + provmethod => 'The provisioning method for node deployment. The valid values are install,netboot or an os image name from the osimage table', supportedarchs => 'Comma delimited list of architectures this node can execute.', nodetype => 'A comma-delimited list of characteristics of this node. Valid values: blade, vm (virtual machine), lpar, osi (OS image), hmc, fsp, ivm, bpa, mm, rsa, switch.', comments => 'Any user-written notes.', @@ -411,12 +411,13 @@ notification => { }, }, osimage => { - cols => [qw(imagename profile imagetype osname osvers osdistro osarch synclists comments disable)], + cols => [qw(imagename profile imagetype provmethod osname osvers osdistro osarch synclists comments disable)], keys => [qw(imagename)], table_desc => 'Basic information about an operating system image that can be used to deploy cluster nodes.', descriptions => { imagename => 'The name of this xCAT OS image definition.', imagetype => 'The type of operating system image this definition represents.', + provmethod => 'The provisioning method for node deployment. The valid values are install or netboot. It is not used by AIX.', profile => 'The node usage category. For example compute, service.', osname => 'Operating system name- AIX or Linux.', osvers => 'Not used.', @@ -1361,6 +1362,10 @@ push(@{$defspec{node}->{'attrs'}}, @nodeattrs); tabentry => 'osimage.imagetype', access_tabentry => 'osimage.imagename=attr:imagename', }, + {attr_name => 'provmethod', + tabentry => 'osimage.provmethod', + access_tabentry => 'osimage.imagename=attr:imagename', + }, {attr_name => 'profile', tabentry => 'osimage.profile', access_tabentry => 'osimage.imagename=attr:imagename', @@ -1389,42 +1394,42 @@ push(@{$defspec{node}->{'attrs'}}, @nodeattrs); # linuximage table# #################### {attr_name => 'template', - only_if => 'osname=Linux', + only_if => 'imagetype=linux', tabentry => 'linuximage.template', access_tabentry => 'linuximage.imagename=attr:imagename', }, {attr_name => 'pkglist', - only_if => 'osname=Linux', + only_if => 'imagetype=linux', tabentry => 'linuximage.pkglist', access_tabentry => 'linuximage.imagename=attr:imagename', }, {attr_name => 'pkgdir', - only_if => 'osname=Linux', + only_if => 'imagetype=linux', tabentry => 'linuximage.pkgdir', access_tabentry => 'linuximage.imagename=attr:imagename', }, {attr_name => 'otherpkglist', - only_if => 'osname=Linux', + only_if => 'imagetype=linux', tabentry => 'linuximage.otherpkglist', access_tabentry => 'linuximage.imagename=attr:imagename', }, {attr_name => 'otherpkgdir', - only_if => 'osname=Linux', + only_if => 'imagetype=linux', tabentry => 'linuximage.otherpkgdir', access_tabentry => 'linuximage.imagename=attr:imagename', }, {attr_name => 'exlist', - only_if => 'osname=Linux', + only_if => 'imagetype=linux', tabentry => 'linuximage.exlist', access_tabentry => 'linuximage.imagename=attr:imagename', }, {attr_name => 'postinstall', - only_if => 'osname=Linux', + only_if => 'imagetype=linux', tabentry => 'linuximage.postinstall', access_tabentry => 'linuximage.imagename=attr:imagename', }, {attr_name => 'rootimgdir', - only_if => 'osname=Linux', + only_if => 'imagetype=linux', tabentry => 'linuximage.rootimgdir', access_tabentry => 'linuximage.imagename=attr:imagename', }, @@ -1432,90 +1437,92 @@ push(@{$defspec{node}->{'attrs'}}, @nodeattrs); # nimimage table# #################### {attr_name => 'nimtype', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.nimtype', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'nimmethod', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.nimmethod', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'lpp_source', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.lpp_source', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'spot', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.spot', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'root', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.root', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'dump', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.dump', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'paging', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.paging', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'resolv_conf', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.resolv_conf', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'tmp', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.tmp', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'home', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.home', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'shared_home', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.shared_home', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'shared_root', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.shared_root', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'script', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.script', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'fb_script', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.fb_script', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'bosinst_data', + only_if => 'imagetype=NIM', tabentry => 'nimimage.bosinst_data', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'installp_bundle', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.installp_bundle', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'filesets', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.filesets', access_tabentry => 'nimimage.imagename=attr:imagename', }, {attr_name => 'mksysb', + only_if => 'imagetype=NIM', tabentry => 'nimimage.mksysb', access_tabentry => 'nimimage.imagename=attr:imagename', }, @@ -1524,7 +1531,7 @@ push(@{$defspec{node}->{'attrs'}}, @nodeattrs); # access_tabentry => 'nimimage.imagename=attr:imagename', # }, {attr_name => 'usercomment', - only_if => 'osname=AIX', + only_if => 'imagetype=NIM', tabentry => 'nimimage.comments', access_tabentry => 'nimimage.imagename=attr:imagename', }, diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index aa7500509..722fa0858 100644 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -477,9 +477,11 @@ sub update_tables_with_templates my $osname=$osver;; #like sles, rh, centos, windows my $ostype="Linux"; #like Linux, Windows + my $imagetype="linux"; if ($osver =~ /^win/) { $osname="windows"; $ostype="Windows"; + $imagetype="windows"; } else { until (-r "$::XCATROOT/share/xcat/install/$osname/" or not $osname) { chop($osname); @@ -570,7 +572,8 @@ sub update_tables_with_templates #TODO: check if there happen to be a row that has the same imagename but with different contents #now we can wirte the info into db my %key_col = (imagename=>$imagename); - my %tb_cols=(imagetype=>"install", + my %tb_cols=(imagetype=>$imagetype, + provmethod=>"install", profile=>$profile, osname=>$ostype, osvers=>$osver, @@ -628,9 +631,11 @@ sub update_tables_with_diskless_image my $osname=$osver;; #like sles, rh, centos, windows my $ostype="Linux"; #like Linux, Windows + my $imagetype="linux"; if ($osver =~ /^win/) { $osname="windows"; $ostype="Windows"; + $imagetype="windows"; } else { until (-r "$::XCATROOT/share/xcat/netboot/$osname/" or not $osname) { chop($osname); @@ -707,7 +712,8 @@ sub update_tables_with_diskless_image #TODO: check if there happen to be a row that has the same imagename but with different contents #now we can wirte the info into db my %key_col = (imagename=>$imagename); - my %tb_cols=(imagetype=>"netboot", + my %tb_cols=(imagetype=>$imagetype, + provmethod=>"netboot", profile=>$profile, osname=>$ostype, osvers=>$osver,