/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
# 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)
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)
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
# 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)
# 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")