From 6862de33b5d933f5e850bfa35b7676813f851188 Mon Sep 17 00:00:00 2001 From: nott Date: Wed, 29 Sep 2010 15:06:14 +0000 Subject: [PATCH] chkosimage - check req resources git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7722 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/aixinstall.pm | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/aixinstall.pm b/xCAT-server/lib/xcat/plugins/aixinstall.pm index ef089d471..8ad9da37b 100644 --- a/xCAT-server/lib/xcat/plugins/aixinstall.pm +++ b/xCAT-server/lib/xcat/plugins/aixinstall.pm @@ -1569,6 +1569,45 @@ sub chkosimage return 1; } + # + # check the diskless osimage def + # + if ($imagedef{$image_name}{nimtype} eq 'diskless') { + # must have spot, root or shared_root and paging + + if (!$imagedef{$image_name}{spot} ) { + my $rsp; + push @{$rsp->{data}}, "A diskless osimage must include a spot resource.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + } + + if (!$imagedef{$image_name}{paging} ) { + my $rsp; + push @{$rsp->{data}}, "A diskless osimage must include a paging resource.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + } + + # + # make sure they have either a root or a shared_root - but not both + # + + if (!$imagedef{$image_name}{root} && !$imagedef{$image_name}{shared_root} ) { + my $rsp; + push @{$rsp->{data}}, "A diskless osimage must include either a \'root\' or a 'shared_root\' resource.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + } + + # + # make sure they don't have both + # + if ($imagedef{$image_name}{root} && $imagedef{$image_name}{shared_root} ) { + my $rsp; + push @{$rsp->{data}}, "Cannot have both a \'root\' and a \'shared_root\' resources.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + } + + } + # # check to see if all the software is available in the lpp_source # directories