From f9fb4b8b0c8d912310252ea2eb5fbf9e1dc9a05b Mon Sep 17 00:00:00 2001 From: yinle Date: Mon, 5 Dec 2011 02:49:30 +0000 Subject: [PATCH] Fix bug 3445173 : xcatsetup give the wrong id for lpars, adjust the way of calculating node id. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11121 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/setup.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/setup.pm b/xCAT-server/lib/xcat/plugins/setup.pm index fb2b3e140..7278107f4 100644 --- a/xCAT-server/lib/xcat/plugins/setup.pm +++ b/xCAT-server/lib/xcat/plugins/setup.pm @@ -1118,7 +1118,7 @@ sub writelpar { my %ppchash; my %nodeposhash; #$ppchash{id} = '|^\D+\d+\D+\d+\D+(\d+)\D*$|(($1-1)*4+1)|'; #todo: this is p7 ih specific - $ppchash{id} = '|^\D+\d+\D+\d+\D+(\d+)\D*$|($1+0)|'; + #$ppchash{id} = '|^\D+\d+\D+\d+\D+(\d+)\D*$|($1+0)|'; # convert between the lpar name and the cec name. Assume that numbers are the same, but the base can be different my $regex = '|^\D+(\d+)\D+(\d+)\D+\d+\D*$|' . "$cecprimbase" . '($1)' . "$cecsecbase" .'($2)' . $cecattach . '|'; $ppchash{hcp} = $regex; @@ -1126,6 +1126,20 @@ sub writelpar { $ppchash{nodetype} = 'lpar'; #print Dumper($CECPOSITIONS); $tables{'ppc'}->setNodeAttribs('lpar', \%ppchash); + #adjust the node id for the p7ih node + my $numpercec = $STANZAS{'xcat-lpars'}->{'num-lpars-per-cec'}; + unless ($numpercec) { + errormsg("Please specify num-lpars-cec", 5); + return 1; + } + my %idhash; + my $j = 0; + foreach my $nn (@$nodes) { + my $id = ($j % $numpercec) * 4 + 1; + $j++; + $idhash{$nn}->{id} = $id; + } + $tables{'ppc'}->setNodesAttribs(\%idhash); #todo: for now, let the nodepos attrs for the cec be good enough #$nodeposhash{rack} = {rack => $CECPOSITIONS->{$cecname}->[0]->{rack}, u => $CECPOSITIONS->{$cecname}->[0]->{u}};