From 526742c7569b05771d783d4ad849d46463f1d34c Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Thu, 16 Sep 2010 22:26:39 +0000 Subject: [PATCH] added option to config file for direct attach control git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7482 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/pods/man8/xcatsetup.8.pod | 7 ++++-- xCAT-server/lib/xcat/plugins/setup.pm | 32 +++++++++++++++++++++------ 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/xCAT-client/pods/man8/xcatsetup.8.pod b/xCAT-client/pods/man8/xcatsetup.8.pod index 499239232..50355ce81 100644 --- a/xCAT-client/pods/man8/xcatsetup.8.pod +++ b/xCAT-client/pods/man8/xcatsetup.8.pod @@ -24,9 +24,11 @@ Note: currently the B command has only been implemented and tested f The B is organized in stanza format and supports the keywords in the sample file below. Comment lines begin with "#". Stanzas can be ommitted if you do not want to define that type of object. +Note that currently hostname ranges must have simple format, like the examples in this sample file. xcat-site: domain = cluster.com + use-direct-fsp-control = 1 xcat-hmcs: hostname-range = hmc1-hmc3 @@ -103,7 +105,8 @@ The name before the colon is the node name of the frame BPC. The numbers after to assign to the groups of CECs in that frame from bottom to top. Each supernode contains 4 CECs, unless it is immediately followed by "(#)", in which case the number in parenthesis indicates how many CECs are in this supernode. -The following lists which database attributes are filled in for each stanza: +The following lists which database attributes are filled in as a result of each stanza. Note that depending on the values +in the stanza, some attributes might not be filled in. =over 15 @@ -141,7 +144,7 @@ nodelist table: node, groups hosts table: node, ip -ppc table: node, supernode +ppc table: node, supernode, hcp nodetype table: node, nodetype diff --git a/xCAT-server/lib/xcat/plugins/setup.pm b/xCAT-server/lib/xcat/plugins/setup.pm index 134e8e92e..36a0b742d 100644 --- a/xCAT-server/lib/xcat/plugins/setup.pm +++ b/xCAT-server/lib/xcat/plugins/setup.pm @@ -273,16 +273,26 @@ sub writeframe { # Using the frame group, write: nodetype.nodetype, nodehm.mgt $tables{'nodetype'}->setNodeAttribs('frame', {nodetype => 'bpa'}); - $tables{'nodehm'}->setNodeAttribs('frame', {mgt => 'hmc'}); # Using the frame group, num-frames-per-hmc, hmc hostname-range, write regex for: ppc.node, ppc.hcp, ppc.id # The frame # should come from the nodename my $idregex = '|\D+(\d+)|(0+$1)|'; + my %hash = (id => $idregex); + + if ($STANZAS{'xcat-site'}->{'use-direct-fsp-control'}) { + $tables{'nodehm'}->setNodeAttribs('frame', {mgt => 'fsp'}); + my $hcpregex = '|(.+)|($1)|'; # its managed by itself + $hash{hcp} = $hcpregex; + } + else { + $tables{'nodehm'}->setNodeAttribs('frame', {mgt => 'hmc'}); + # let lsslp fill in the hcp + } + # Calculate which hmc manages this frame by dividing by num-frames-per-hmc - my $framesperhmc = $STANZAS{'xcat-frames'}->{'num-frames-per-hmc'}; - #todo: this is wrong! Switch frames and cecs over to direct attach - my $hmcregex = '|\D+(\d+)|((($1-1)/' . $framesperhmc . ')+1)|'; - $tables{'ppc'}->setNodeAttribs('frame', {id => $idregex, hcp => $hmcregex}); + #my $framesperhmc = $STANZAS{'xcat-frames'}->{'num-frames-per-hmc'}; + + $tables{'ppc'}->setNodeAttribs('frame', \%hash); # Write vpd-file to vpd table my $filename = fullpath($STANZAS{'xcat-frames'}->{'vpd-file'}, $cwd); @@ -330,9 +340,17 @@ sub writecec { # Using the cec group, write: nodetype.nodetype, nodehm.mgt $tables{'nodetype'}->setNodeAttribs('cec', {nodetype => 'fsp'}); - $tables{'nodehm'}->setNodeAttribs('cec', {mgt => 'hmc'}); - # Do we need to write regex for ppc.hcp and ppc.parent? Of will lsslp do all that? + # Write regex for ppc.hcp. lsslp will fill in parent. + if ($STANZAS{'xcat-site'}->{'use-direct-fsp-control'}) { + $tables{'nodehm'}->setNodeAttribs('cec', {mgt => 'fsp'}); + my $hcpregex = '|(.+)|($1)|'; # its managed by itself + $tables{'ppc'}->setNodeAttribs('cec', {hcp => $hcpregex}); + } + else { + $tables{'nodehm'}->setNodeAttribs('cec', {mgt => 'hmc'}); + # let lsslp fill in the hcp + } # Write supernode-list in ppc.supernode #todo: handle the !sequential option