From 99af6b0de696f9f455cfcbca64eed0fa91154f80 Mon Sep 17 00:00:00 2001 From: yinle Date: Mon, 9 Apr 2012 08:53:57 +0000 Subject: [PATCH] Fix bug 3516024: xcatsetup can't define service/storage node over 1 bb git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12163 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/setup.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/setup.pm b/xCAT-server/lib/xcat/plugins/setup.pm index 09bd16aee..b39369234 100644 --- a/xCAT-server/lib/xcat/plugins/setup.pm +++ b/xCAT-server/lib/xcat/plugins/setup.pm @@ -1205,18 +1205,21 @@ sub findSNsinBB { my $framerange = $STANZAS{'xcat-frames'}->{'hostname-range'}; my $framename = parsenoderange($framerange); my $framebase = $$framename{'primary-start'}; + my $cecrange = $STANZAS{'xcat-cecs'}->{'hostname-range'}; + my $cecname = parsenoderange($cecrange); + my $cecbasenum = $$cecname{'secondary-start'}; foreach my $p (@snpositions) { my $cecbase = 0; - my $frame = $framebase; - #my $frame = $framebase; + my $frame = int($framebase) + ($bb -1) * $framesperbb; while ($p > ($cecbase + ($NUMCECSINFRAME{$frame}||$cecsperframe))) { # p is not in this frame, go on to the next $cecbase += $NUMCECSINFRAME{$frame} || $cecsperframe; $frame++; #print "cecbase=$cecbase, frame=$frame\n"; - if ($frame >= ($framebase+$framesperbb)) { errormsg("Can not find $sntext node position $p in building block $bb.",9); return 0; } + my $frametmp = $frame - ($bb -1) * $framesperbb; + if ($frametmp >= ($framebase+$framesperbb)) { errormsg("Can not find $sntext node position $p in building block $bb.",9); return 0; } } - my $cecinframe = $p - $cecbase; + my $cecinframe = $p - $cecbase + $cecbasenum - 1; #my $nodename = $primbase . sprintf("%0${primlen}d", $frame) . $secbase . sprintf("%0${seclen}d", $cecinframe) . $tertbase . sprintf("%0${tertlen}d", 1); my $nodename = buildNodename($frame, $cecinframe, 1, $primbase, $primlen, $secbase, $seclen, $tertbase, $tertlen); #print "nodename=$nodename\n";