This function is not available until xCAT 2.8 is release.

Lissa K. Valletta
8-3/B10
Poughkeepsie, NY 12601
(tie 293) 433-3102





From:   "Pocina, Goran" <[email protected]>
To:     xCAT Users Mailing list <[email protected]>
Date:   12/13/2012 10:36 AM
Subject:        Re: [xcat-user] xCAT db access from postscripts



That design looks quite nice.   That should scale and be very fast.
Thanks!

From: Xiao Peng Wang [mailto:[email protected]]
Sent: Tuesday, December 11, 2012 9:30 PM
To: xCAT Users Mailing list
Cc: xCAT Users Mailing list
Subject: Re: [xcat-user] xCAT db access from postscripts



Technically, using the 'curl' or 'rest api' to get attributes for a node is
fine, but it will affect the deployment performance for bunch of nodes
since xcatd needs to handle the request for every nodes.

Recently, xCAT added a new feature that customer could define that which
attributes should be exported to the node for running of the postscript.
Refer to the following doc:

http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Updatenode_Performance_Enhancements#Add_a_Template_for_mypostscript


Thanks
Best Regards
----------------------------------------------------------------------
Wang Xiaopeng (王晓朋)
IBM China System Technology Laboratory
Tel: 86-10-82453455
Email: [email protected]
Address: 28,ZhongGuanCun Software Park,No.8 Dong Bei Wang West Road,
Haidian District Beijing P.R.China 100193

Inactive hide details for "Pocina, Goran" ---2012/12/12 06:10:30---See
questions at end... For RH & CentOS builds, a profile's "Pocina, Goran"
---2012/12/12 06:10:30---See questions at end... For RH & CentOS builds, a
profile's kickstart template goes through macro pr

From: "Pocina, Goran" <[email protected]>
To: xCAT Users Mailing list <[email protected]>,
Date: 2012/12/12 06:10
Subject: [xcat-user] xCAT db access from postscripts




See questions at end…

For RH & CentOS builds, a profile’s kickstart template goes through macro
processing
that allows it to access xCAT attribute values.

For a long time it bugged me that postscripts don’t go through the same
macro processing, until
a colleague pointed out that it should be possible for postscripts to use
curl to pull any
attributes they need during the install.   Very nice xCAT feature!!
Here’s one possible postscript that could
be called by other postscripts to load a node’s attributes into the current
shell environment:

/install/postscripts/getnodeattr:

      ATTRF=/var/log/xcat/attr.$NODE
      mkdir �Cp $(dirname $ATTRF)
      if [ ! -f $ATTRF ] ; then
              curl -k
      https://$MASTER/xcatws/nodes/$NODE?userName=wsuser&password=wspd  >
      $ATTRF.xml ||
                      exit 8
      fi
      # Convert
      #   <tr><td>addkcmdline</td><td>sshd</td></tr>
      # to
      #   export ATTR_addkcmdline="sshd"
      #
      sed -e '/^<[/]*table/d' \
              -e "s/<tr><td>/export ATTR_/" \
              -e 's;</td><td>;=";' \
              -e 's;</td></tr>;";' < ${ATTRF}.xml > $ATTRF
      # load into the environment
      .  $ATTRF || exit 7

To use this, one would call:          “.  /xcatpost/getnodeattr”
from within a postscript.  The wsuser user and policy must, of course, be
set up first.

Question 1. Is there any reason not to use curl and the REST API from
postscripts during an install?   Does this duplicate existing xCAT
functionality?

Question 2.  It’s difficult to protect  the “wsuser” password coded
into /install/postscripts/getnodeattr.   The file can’t be made read-only
root, for example, because httpd needs to be able to read it.   Is there a
way to limit “wsuser” to GET calls?

Thanks,

Goran
------------------------------------------------------------------------------

LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user
------------------------------------------------------------------------------

LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user

<<inline: graycol.gif>>

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user

Reply via email to