Merge branch 'master' into lxc_devel
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 31 Aug 2012 10:00:11 +0000 (12:00 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 31 Aug 2012 10:00:11 +0000 (12:00 +0200)
Makefile
bootmanager.spec
source/configuration
source/steps/ChainBootNode.py
source/steps/InstallBootstrapFS.py
source/steps/InstallPartitionDisks.py
source/steps/InstallWriteConfig.py
source/steps/ValidateNodeInstall.py

index c2540fa..5b7c225 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,14 +8,12 @@
 # $ run export
 # and cut'n paste the export lines before you run make sync
 
-PLCHOST ?= testplc.onelab.eu
-
 ifdef PLC
 SSHURL:=root@$(PLC):/
 SSHCOMMAND:=ssh root@$(PLC)
 else
 ifdef PLCHOSTLXC
-SSHURL:=root@$(PLCHOST):/var/lib/lxc/$(GUESTNAME)/rootfs
+SSHURL:=root@$(PLCHOSTLXC):/var/lib/lxc/$(GUESTNAME)/rootfs
 SSHCOMMAND:=ssh root@$(PLCHOSTLXC) ssh $(GUESTHOSTNAME)
 else
 ifdef PLCHOSTVS
index 26ff831..e1d1755 100644 (file)
@@ -1,7 +1,7 @@
 #
 %define name bootmanager
-%define version 5.0
-%define taglevel 23
+%define version 5.1
+%define taglevel 2
 
 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
 
@@ -81,12 +81,19 @@ chmod 700 /var/log/bm
 /etc/plc.d/bootmanager
 
 %changelog
+* Wed Jul 18 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.1-2
+- pour the 5.0-22 and 5.0-23 features into the lxc mix
+
 * Mon Jul 09 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-23
 - added support for disks larger than 2Tb using gpt instead of msdos
 
 * 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
 
index 9f0fe74..9f5de06 100644 (file)
@@ -53,7 +53,7 @@ PLCONF_DIR=/etc/planetlab
 # this sets the size of the root logical volume,
 # after the root and swap has been created, remaining
 # goes to the vserver partition
-ROOT_SIZE=14G
+ROOT_SIZE=70G
 
 
 # override the swap size
@@ -80,7 +80,7 @@ MINIMUM_DISK_SIZE=17
 
 # total minimum disk size in GB if all usable disks are below this
 # size, the node cannot be installed
-TOTAL_MINIMUM_DISK_SIZE=50
+TOTAL_MINIMUM_DISK_SIZE=120
 
 
 # set of langugase for install (used in /etc/rpm/macros)
index 848cb3d..67ac5dd 100644 (file)
@@ -125,7 +125,7 @@ def Run( vars, log ):
     utils.sysexec_chroot( SYSIMG_PATH, cmd, log )
 
     # Re-generate initrd right before kexec call
-    MakeInitrd.Run( vars, log )
+    #MakeInitrd.Run( vars, log )
 
     # the following step should be done by NM
     UpdateNodeConfiguration.Run( vars, log )
@@ -151,8 +151,10 @@ def Run( vars, log ):
         option = 'smp'
 
     log.write( "Copying kernel and initrd for booting.\n" )
-    utils.sysexec( "cp %s/boot/kernel-boot%s /tmp/kernel" % (SYSIMG_PATH,option), log )
-    utils.sysexec( "cp %s/boot/initrd-boot%s /tmp/initrd" % (SYSIMG_PATH,option), log )
+    kversion = os.popen('rpm -r /tmp/mnt/sysimg -qa kernel | tail -1 | cut -c 8-').read().rstrip()
+
+    utils.sysexec( "cp %s/boot/vmlinuz-%s /tmp/kernel" % (SYSIMG_PATH,kversion), log )
+    utils.sysexec( "cp %s/boot/initramfs-%s.img /tmp/initrd" % (SYSIMG_PATH,kversion), log )
 
     BootAPI.save(vars)
 
@@ -189,7 +191,7 @@ def Run( vars, log ):
 
     utils.sysexec_noerr( "killall dhclient", log )
         
-    utils.sysexec_noerr( "umount -a -r -t ext2,ext3", log )
+    utils.sysexec_noerr( "umount -a -r -t ext2,ext3,btrfs", log )
     utils.sysexec_noerr( "modprobe -r lvm-mod", log )
     
     # modules that should not get unloaded
index c157db4..46c4045 100644 (file)
@@ -82,7 +82,7 @@ def Run( vars, 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"],
+    utils.sysexec( "mount -t btrfs %s %s/vservers" % (PARTITIONS["vservers"],
                                                      SYSIMG_PATH), log )
 
     vars['ROOT_MOUNTED']= 1
@@ -179,7 +179,7 @@ def Run( vars, log ):
                     SYSIMG_PATH + "/usr/boot/cacert.pem")
         file(SYSIMG_PATH + "/usr/boot/boot_server", "w").write(boot_server)
         shutil.copy("/usr/bootme/pubring.gpg", SYSIMG_PATH + "/usr/boot/pubring.gpg")
-        
+
     # For backward compatibility
     if os.path.exists("/usr/bootme"):
         utils.makedirs(SYSIMG_PATH + "/mnt/cdrom")
index b469330..778f84a 100644 (file)
@@ -158,17 +158,23 @@ def Run( vars, log ):
     # filesystems partitions names and their corresponding
     # reserved-blocks-percentages
     filesystems = {"root":5,"vservers":0}
-
-    # make the file systems
-    for fs in filesystems.keys():
-        # get the reserved blocks percentage
-        rbp = filesystems[fs]
-        devname = PARTITIONS[fs]
-        log.write("formatting %s partition (%s)%s.\n" % (fs,devname,txt))
-        utils.sysexec( "mkfs.ext2 -q %s -m %d -j %s" % (option,rbp,devname), log )
+    
+    # ROOT filesystem with ext2
+    fs = 'root'
+    rbp = filesystems[fs]
+    devname = PARTITIONS[fs]
+    log.write("formatting %s partition (%s)%s.\n" % (fs,devname,txt))
+    utils.sysexec( "mkfs.ext2 -q %s -m %d -j %s" % (option,rbp,devname), log )
+
+    # VSERVER filesystem with btrfs to support snapshoting and stuff
+    fs = 'vservers'
+    rbp = filesystems[fs]
+    devname = PARTITIONS[fs]
+    log.write("formatting %s partition (%s)%s.\n" % (fs,devname,txt))
+    utils.sysexec( "mkfs.btrfs %s" % (devname), log )
 
     # disable time/count based filesystems checks
-    for filesystem in ("root","vservers"):
+    for filesystem in ["root"]:
         utils.sysexec_noerr( "tune2fs -c -1 -i 0 %s" % PARTITIONS[filesystem], log)
 
     # save the list of block devices in the log
index d8b5a6e..2679748 100644 (file)
@@ -72,8 +72,8 @@ def Run( vars, log ):
     utils.sysexec_chroot( SYSIMG_PATH,
         "ln -sf /usr/share/zoneinfo/UTC /etc/localtime", log )
 
-    log.write( "Enabling ntp at boot\n" )
-    utils.sysexec_chroot( SYSIMG_PATH, "chkconfig ntpd on", log )
+    #log.write( "Enabling ntp at boot\n" )
+    #utils.sysexec_chroot( SYSIMG_PATH, "chkconfig ntpd on", log )
 
     log.write( "Creating system directory %s\n" % PLCONF_DIR )
     if not utils.makedirs( "%s/%s" % (SYSIMG_PATH,PLCONF_DIR) ):
@@ -86,7 +86,7 @@ def Run( vars, log ):
                  PARTITIONS["mapper-swap"] )
     fstab.write( "%s           /           ext3      defaults  1 1\n" % \
                  PARTITIONS["mapper-root"] )
-    fstab.write( "%s           /vservers   ext3      tagxid,defaults  1 2\n" % \
+    fstab.write( "%s           /vservers   btrfs     defaults  1 2\n" % \
                  PARTITIONS["mapper-vservers"] )
     fstab.write( "none         /proc       proc      defaults  0 0\n" )
     fstab.write( "none         /dev/shm    tmpfs     defaults  0 0\n" )
index c987170..5f63598 100644 (file)
@@ -83,7 +83,7 @@ def Run( vars, log ):
             
         utils.makedirs( SYSIMG_PATH )
 
-        for filesystem in ("root","vservers"):
+        for filesystem in ["root"]:
             try:
                 # first run fsck to prevent fs corruption from hanging mount...
                 log.write( "fsck %s file system\n" % filesystem )
@@ -101,6 +101,8 @@ def Run( vars, log ):
             else:
                 # disable time/count based filesystems checks
                 utils.sysexec_noerr( "tune2fs -c -1 -i 0 %s" % PARTITIONS[filesystem], log)
+        
+        # TODO: add fschk for btrfs vserver volume!! 
 
         try:
             # then attempt to mount them
@@ -123,7 +125,7 @@ def Run( vars, log ):
             VSERVERS_PATH = "%s/vservers" % SYSIMG_PATH
             utils.makedirs(VSERVERS_PATH)
             log.write( "mounting vserver partition in root file system\n" )
-            utils.sysexec("mount -t ext3 %s %s" % (PARTITIONS["vservers"], VSERVERS_PATH), log)
+            utils.sysexec("mount -t btrfs %s %s" % (PARTITIONS["vservers"], VSERVERS_PATH), log)
         except BootManagerException, e:
             log.write( "BootManagerException during mount of /vservers: %s\n" % str(e) )
             return -2
@@ -135,7 +137,8 @@ def Run( vars, log ):
     # these 2 links are created by our kernel's post-install scriplet
     log.write("Checking for a custom kernel\n")
     try:
-        os.stat("%s/boot/kernel-boot" % SYSIMG_PATH)
+        kversion = os.popen('rpm -r /tmp/mnt/sysimg -qa kernel | tail -1 | cut -c 8-').read().rstrip()
+        os.stat("%s/boot/vmlinuz-%s" % (SYSIMG_PATH,kversion))
     except OSError, e:            
         log.write( "Couldn't locate base kernel (you might be using the stock kernel).\n")
         return -3