From c28d4a87f146f276576028e9fa3b8f6f6df96107 Mon Sep 17 00:00:00 2001 From: angli-xcat Date: Tue, 7 Jun 2011 08:59:53 +0000 Subject: [PATCH] This is to enable client to indicate options when mounting persistent directories on statelite(nfs/ramdisk) CNs, if not, "nolock,rsize=32768,tcp,timeo=14" will be used as default options. This implementation aims for RHEL6. SUSE to be implemented later. client can revise the statelite table to benefit from this, like: #node,image,statemnt,mntopts,comments,disable "935n02",,"192.168.0.244:/tmp","soft,timeo=200",, git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9753 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/anaconda.pm | 16 ++++++++++++++++ .../xcat/netboot/rh/dracut/xcat-prepivot.sh | 7 ++++++- .../share/xcat/netboot/rh/dracut/xcatroot | 7 ++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 2fc01b9e0..8205ae693 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -733,6 +733,22 @@ sub mknetboot $initrdstr = "xcat/netboot/$osver/$arch/$profile/initrd-stateless.gz"; } } + + if($statelite) + { + my $statelitetb = xCAT::Table->new('statelite'); + my $mntopts = $statelitetb->getAttribs({node => $node}, 'mntopts'); + + my $mntoptions = $mntopts->{'mntopts'}; + unless (defined($mntoptions)) + { + $kcmdline .= " MNTOPTS="; + } + else + { + $kcmdline .= " MNTOPTS=$mntoptions"; + } + } $bptab->setNodeAttribs( $node, { diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/xcat-prepivot.sh b/xCAT-server/share/xcat/netboot/rh/dracut/xcat-prepivot.sh index c8eeb0aee..22b0bc9b6 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/xcat-prepivot.sh +++ b/xCAT-server/share/xcat/netboot/rh/dracut/xcat-prepivot.sh @@ -46,7 +46,12 @@ if [ ! -z $SNAPSHOTSERVER ]; then mkdir -p $NEWROOT/$RWDIR/persistent MAXTRIES=5 ITER=0 - while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o nolock,rsize=32768,tcp,nfsvers=3,timeo=14; do + if [ -z $MNTOPTS ]; then + MNT_OPTIONS="nolock,rsize=32768,tcp,timeo=14" + else + MNT_OPTIONS=$MNTOPTS + fi + while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then echo "Your are dead, rpower $ME boot to play again." diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot index 759f85cea..f11ae4fa5 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot @@ -98,7 +98,12 @@ elif [ -r /rootimg-statelite.gz ]; then mkdir -p $NEWROOT/$RWDIR/persistent MAXTRIES=5 ITER=0 - while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o nolock,rsize=32768,tcp,timeo=14; do + if [ -z $MNTOPTS ]; then + MNT_OPTIONS="nolock,rsize=32768,tcp,timeo=14" + else + MNT_OPTIONS=$MNTOPTS + fi + while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then echo "You are dead, rpower $ME boot to play again."