don't unnecessarily shutdown/startup lvm between successful install and
authorAaron Klingaman <alk@cs.princeton.edu>
Thu, 2 Jun 2005 20:00:41 +0000 (20:00 +0000)
committerAaron Klingaman <alk@cs.princeton.edu>
Thu, 2 Jun 2005 20:00:41 +0000 (20:00 +0000)
chain boot

source/steps/InstallBootstrapRPM.py
source/steps/InstallUninitHardware.py
source/steps/ValidateNodeInstall.py

index 0a7750d..86d935d 100644 (file)
@@ -65,6 +65,8 @@ def Run( vars, log ):
     Sets the following variables:
     TEMP_BOOTCD_PATH     where the boot cd is remounted in the temp
                          path
+    ROOT_MOUNTED         set to 1 when the the base logical volumes
+                         are mounted.
     """
 
     log.write( "\n\nStep: Install: Bootstrapping RPM.\n" )
@@ -118,6 +120,9 @@ def Run( vars, log ):
     utils.sysexec( "mount -t ext3 %s %s/vservers" % (PARTITIONS["vservers"],
                                                      SYSIMG_PATH), log )
 
+    vars['ROOT_MOUNTED']= 1
+    
+
     # download and extract support tarball for
     # this step, which has everything
     # we need to successfully run
index 7a28612..e513997 100644 (file)
@@ -50,7 +50,9 @@ import utils
 def Run( vars, log ):
     """
     Unitializes hardware:
-    - unmount all previously mounted partitions
+    - unmount everything mounted during install, except the
+    /dev/planetlab/root and /dev/planetlab/vservers. This includes
+    calling swapoff for /dev/planetlab/swap.
 
     Except the following variables from the store:
     TEMP_PATH         the path to download and store temp files to
@@ -58,9 +60,6 @@ def Run( vars, log ):
                       (always starts with TEMP_PATH)
     PARTITIONS        dictionary of generic part. types (root/swap)
                       and their associated devices.
-    NODE_ID           the node_id from the database for this node
-
-                      this is needed to make any requests back to the server
 
     Sets the following variables:
     None
@@ -83,10 +82,6 @@ def Run( vars, log ):
         if PARTITIONS == None:
             raise ValueError, "PARTITIONS"
 
-        NODE_ID= vars["NODE_ID"]
-        if NODE_ID == "":
-            raise ValueError("NODE_ID")
-
     except KeyError, var:
         raise BootManagerException, "Missing variable in vars: %s\n" % var
     except ValueError, var:
@@ -107,31 +102,10 @@ def Run( vars, log ):
     log.write( "Unmounting proc.\n" )
     utils.sysexec( "umount %s/proc" % SYSIMG_PATH, log )
 
-    log.write( "Unmounting vserver partition.\n" )
-    utils.sysexec( "umount %s" % PARTITIONS["vservers"], log )
-
     log.write( "Unmounting rcfs file system in image.\n" )
     utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log )
 
-    log.write( "Unmounting system image.\n" )
-    utils.sysexec( "umount %s" % PARTITIONS["root"], log )
-
     log.write( "Shutting down swap\n" )
     utils.sysexec( "swapoff %s" % PARTITIONS["swap"], log )
 
-    # as one of the last steps, upload /var/log/messages if it exists
-
-    # send a notification that the install is complete
-    #action= "email"
-    #message= "installfinished"
-    #nodestate= ""
-    
-    #try:
-    #    result= utils.notifybootserver( BS_REQUEST, NODE_ID,
-    #                                         NODE_NONCE,
-    #                                         action, message, nodestate )
-    #except AlpinaError, desc:
-    #    log.write( "Unable to notify boot server of " \
-    #                   "install complete (not critical): %s" % desc )
-        
     return 1
index db4680c..d7bd721 100644 (file)
@@ -44,19 +44,19 @@ def Run( vars, log ):
     if 'ROOT_MOUNTED' in vars.keys():
         ROOT_MOUNTED= vars['ROOT_MOUNTED']
 
-    # old cds need extra utilities to run lvm
-    if BOOT_CD_VERSION[0] == 2:
-        compatibility.setup_lvm_2x_cd( vars, log )
-        
-    # simply creating an instance of this class and listing the system
-    # block devices will make them show up so vgscan can find the planetlab
-    # volume group
-    systeminfo().get_block_device_list()
-
     # mount the root system image if we haven't already.
     # capture BootManagerExceptions during the vgscan/change and mount
     # calls, so we can return 0 instead
     if ROOT_MOUNTED == 0:
+        # old cds need extra utilities to run lvm
+        if BOOT_CD_VERSION[0] == 2:
+            compatibility.setup_lvm_2x_cd( vars, log )
+            
+        # simply creating an instance of this class and listing the system
+        # block devices will make them show up so vgscan can find the planetlab
+        # volume group
+        systeminfo().get_block_device_list()
+
         try:
             utils.sysexec( "vgscan", log )
             utils.sysexec( "vgchange -ay planetlab", log )
@@ -89,5 +89,7 @@ def Run( vars, log ):
         log.write( "Node does not appear to be installed correctly:\n" )
         log.write( "missing file /boot/ initrd-boot or kernel-boot\n" )
         return 0
+
+    log.write( "Everything appears to be ok\n" )
     
     return 1