merge master into lxc_devel
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 29 Jun 2012 09:55:38 +0000 (11:55 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 29 Jun 2012 09:55:38 +0000 (11:55 +0200)
support for disks larger than 2TB
display downloading and extracting duration at install-time

bootmanager.spec
source/steps/CheckForNewDisks.py
source/steps/InstallBootstrapFS.py
source/steps/InstallPartitionDisks.py
source/systeminfo.py

index b92697b..2d8d09e 100644 (file)
@@ -81,10 +81,16 @@ chmod 700 /var/log/bm
 /etc/plc.d/bootmanager
 
 %changelog
+* Tue May 15 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-22
+- bootmanager log clearly states duration of download and extraction of node image
+
 * Fri Apr 13 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.1-1
 - first working draft for dealing with f16 nodes
 - not expected to work with mainline nodes (use 5.0 for that for now)
 
+* Fri Apr 13 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-21
+- no significant change, just checkpoint as 5.1 is addressing lxc
+
 * Thu Jul 07 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-20
 - be more explicit on the node conf_file actually used
 - did this after a former PLC node tried to boot at PLE with its PLC plnode.txt still on a usb stick
index e5af3f1..14523d8 100644 (file)
@@ -91,7 +91,7 @@ def Run( vars, log ):
         # just to be extra paranoid, ignore the device if it already has
         # an lvm partition on it (new disks won't have this, and that is
         # what this code is for, so it should be ok).
-        cmd = "sfdisk -l %s | grep -q 'Linux LVM'" % device 
+        cmd = "parted -l %s | grep -q lvm$" % device 
         has_lvm= utils.sysexec_noerr(cmd, log)
         if has_lvm:
             log.write( "It appears %s has lvm already setup on it.\n" % device)
index 47e2748..46c4045 100644 (file)
@@ -122,13 +122,16 @@ def Run( vars, log ):
         source_hash_file= "/boot/%s.sha1sum" % (tarball)
         dest_hash_file= "%s/%s.sha1sum" % (SYSIMG_PATH, tarball)
 
+        time_beg=time.time()
+        log.write( "downloading %s\n" % source_file )
         # 30 is the connect timeout, 14400 is the max transfer time in
         # seconds (4 hours)
-        log.write( "downloading %s\n" % source_file )
         result = bs_request.DownloadFile( source_file, None, None,
                                          1, 1, dest_file,
                                          30, 14400)
-
+        time_end=time.time()
+        duration=int(time_end-time_beg)
+        log.write("Done downloading (%s seconds)\n"%duration)
         if result:
             # Download SHA1 checksum file
             log.write( "downloading sha1sum for %s\n"%source_file)
@@ -140,9 +143,13 @@ def Run( vars, log ):
             if not utils.check_file_hash(dest_file, dest_hash_file):
                 raise BootManagerException, "FATAL: SHA1 checksum does not match between %s and %s" % (source_file, source_hash_file)
                 
+            
+            time_beg=time.time()
             log.write( "extracting %s in %s\n" % (dest_file,SYSIMG_PATH) )
             result = utils.sysexec( "tar -C %s -xpf %s %s" % (SYSIMG_PATH,dest_file,uncompress_option), log )
-            log.write( "Done\n")
+            time_end=time.time()
+            duration=int(time_end-time_beg)
+            log.write( "Done extracting (%s seconds)\n"%duration)
             utils.removefile( dest_file )
         else:
             # the main tarball is required
index 2362758..9ecdc86 100644 (file)
@@ -265,7 +265,11 @@ def single_partition_device_2_x ( device, vars, log):
         # get the device
         dev= parted.Device(device)
         # create a new partition table
-        disk= parted.freshDisk(dev,'msdos')
+        try:
+            disk= parted.freshDisk(dev,'msdos')
+        # use gpt as a fallback for disks larger than 2TB
+        except:
+            disk= parted.freshDisk(dev,'gpt')
         # create one big partition on each block device
         constraint= parted.constraint.Constraint (device=dev)
         geometry = parted.geometry.Geometry (device=dev, start=0, end=1)
index bc605de..9754f5c 100755 (executable)
@@ -150,10 +150,14 @@ def get_block_device_list(vars = {}, log = sys.stderr):
         # so, lets run sfdisk -l (list partitions) against
         # most possible block devices, that way they show
         # up when it comes time to do the install.
+
+        # 27.6.2012 - Using parted instead of sfdisk, assuming
+        # that doing so respects the behavior mentioned above.
+
         devicenames = valid_blk_names.keys()
         devicenames.sort()
         for devicename in devicenames:
-            os.system( "sfdisk -l /dev/%s > /dev/null 2>&1" % devicename )
+            os.system( "parted -l /dev/%s > /dev/null 2>&1" % devicename )
 
         # touch file
         fb = open(DEVICES_SCANNED_FLAG,"w")