2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Merge pull request #5044 from cxhong/5035

ADD NODE name to the /opt/xcat/xcatinfo for statelite image
This commit is contained in:
Yuan Bai 2018-04-04 10:03:09 +08:00 committed by GitHub
commit 8925cceff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 6 deletions

View File

@ -531,6 +531,18 @@ sub process_request {
# before packaging the image
system("umount $rootimg_dir/proc");
#put the image name, uuid and timestamp into diskless image when it is packed.
$callback->({ data => ["add image info to xcatinfo file"] });
`echo IMAGENAME="'$imagename'" > $rootimg_dir/opt/xcat/xcatinfo`;
my $uuid = `uuidgen`;
chomp $uuid;
`echo IMAGEUUID="'$uuid'" >> $rootimg_dir/opt/xcat/xcatinfo`;
my $timestamp = `date`;
chomp $timestamp;
`echo TIMESTAMP="'$timestamp'" >> $rootimg_dir/opt/xcat/xcatinfo`;
my $verb = "Packing";
my $temppath;

View File

@ -384,12 +384,6 @@ else # for common mode MODE=1,2,3,5 (updatenode,moncfg,node deployment)
if [ -z "$NODE" ]; then
NODE=`hostname -s`
fi
grep 'NODE' /opt/xcat/xcatinfo > /dev/null 2>&1
if [ $? -eq 0 ]; then
sed -i "s/NODE=.*/NODE=$NODE/" /opt/xcat/xcatinfo
else
echo "NODE=$NODE" >> /opt/xcat/xcatinfo
fi
downloaded=0; # have not downloaded the postscripts
# try the -m/-M input (P_SIP) if it is specified,
@ -693,6 +687,18 @@ else
echo "USEFLOWCONTROL=$new_fc" >> /opt/xcat/xcatinfo
fi
# Add Node name to /opt/xcat/xcatinfo
if [ -z "$NODE" ]; then
NODE=`hostname -s`
fi
grep 'NODE' /opt/xcat/xcatinfo > /dev/null 2>&1
if [ $? -eq 0 ]; then
sed -i "s/NODE=.*/NODE=$NODE/" /opt/xcat/xcatinfo
else
echo "NODE=$NODE" >> /opt/xcat/xcatinfo
fi
# Store the SERVICEGROUP into the xcatinfo file for node deployment, and also for updatenode -s
if [ $NODE_DEPLOYMENT -eq 1 ] || [ "$MODE" = "1" ]; then
sn_group=`grep '^SERVICEGROUP' /$xcatpost/mypostscript |cut -d= -f2 | tr -d \'\"`