X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=source%2Fsteps%2FInstallBootstrapFS.py;h=1cd35074675d972501a705790e93ab2a5b9d3352;hb=d1a0576bd8422e66051ebb0fc2f41b2d7438039a;hp=c157db46aeccd74d6f70755855bf629c5b46b354;hpb=b202556d5c80ba00eb4caf7ea7cf110187c3cdf0;p=bootmanager.git diff --git a/source/steps/InstallBootstrapFS.py b/source/steps/InstallBootstrapFS.py index c157db4..1cd3507 100644 --- a/source/steps/InstallBootstrapFS.py +++ b/source/steps/InstallBootstrapFS.py @@ -7,7 +7,7 @@ # All rights reserved. # expected /proc/partitions format -import os, sys, string +import os, string import popen2 import shutil import traceback @@ -80,23 +80,29 @@ def Run( vars, log ): log.write( "mounting root file system\n" ) utils.sysexec( "mount -t ext3 %s %s" % (PARTITIONS["root"],SYSIMG_PATH), log ) - log.write( "mounting vserver partition in root file system\n" ) - utils.makedirs( SYSIMG_PATH + "/vservers" ) - utils.sysexec( "mount -t ext3 %s %s/vservers" % (PARTITIONS["vservers"], - SYSIMG_PATH), log ) + fstype = 'ext3' if vars['virt']=='vs' else 'btrfs' + + one_partition = VARS['ROOT_SIZE']=='-1' + + if (not one_partition): + log.write( "mounting vserver partition in root file system (type %s)\n"%fstype ) + utils.makedirs( SYSIMG_PATH + "/vservers" ) + utils.sysexec( "mount -t %s %s %s/vservers" % \ + (fstype, PARTITIONS["vservers"], SYSIMG_PATH), log ) + + if vars['virt']=='lxc': + # NOTE: btrfs quota is supported from version: >= btrfs-progs-0.20 (f18+) + # older versions will not recongize the 'quota' command. + log.write( "Enabling btrfs quota on %s/vservers\n"%SYSIMG_PATH ) + utils.sysexec_noerr( "btrfs quota enable %s/vservers" % SYSIMG_PATH ) vars['ROOT_MOUNTED']= 1 - # call getNodeFlavour - try: - node_flavour = BootAPI.call_api_function(vars, "GetNodeFlavour", (NODE_ID,) ) - nodefamily = node_flavour['nodefamily'] - extensions = node_flavour['extensions'] - plain = node_flavour['plain'] - except: - raise BootManagerException ("Could not call GetNodeFlavour - need PLCAPI-5.0") - + # this is now retrieved in GetAndUpdateNodeDetails + nodefamily = vars['nodefamily'] + extensions = vars['extensions'] # the 'plain' option is for tests mostly + plain = vars['plain'] if plain: download_suffix=".tar" uncompress_option=""