X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=source%2Fsteps%2FCheckForNewDisks.py;h=2a31d73c310f644f71d583949a029bdb962078f9;hb=20c30f74d8ce8bb6b0b81c51bd4124d8d1355803;hp=a952b0980bd4d03ffbb8876331b8b8e2cd94b4c0;hpb=bf52f9f0bc05f4aa948d6efb0d3ff27c956a2351;p=bootmanager.git diff --git a/source/steps/CheckForNewDisks.py b/source/steps/CheckForNewDisks.py index a952b09..2a31d73 100644 --- a/source/steps/CheckForNewDisks.py +++ b/source/steps/CheckForNewDisks.py @@ -15,6 +15,8 @@ import compatibility import utils import os +import ModelOptions + def Run( vars, log ): """ @@ -24,6 +26,7 @@ def Run( vars, log ): SYSIMG_PATH the path where the system image will be mounted BOOT_CD_VERSION A tuple of the current bootcd version MINIMUM_DISK_SIZE any disks smaller than this size, in GB, are not used + NODE_MODEL_OPTIONS the node's model options Set the following variables upon successfully running: ROOT_MOUNTED the node root file system is mounted @@ -47,6 +50,7 @@ def Run( vars, log ): if PARTITIONS == None: raise ValueError, "PARTITIONS" + NODE_MODEL_OPTIONS= vars["NODE_MODEL_OPTIONS"] except KeyError, var: raise BootManagerException, "Missing variable in vars: %s\n" % var except ValueError, var: @@ -107,16 +111,21 @@ def Run( vars, log ): log.write("To paranoid to add %s to vservers lvm.\n" % device) continue - log.write( "Attempting to add %s to the volume group\n" % device ) - if not InstallPartitionDisks.single_partition_device( device, vars, log ): log.write( "Unable to partition %s, not using it.\n" % device ) continue - log.write( "Successfully initialized %s\n" % device ) + log.write( "Successfully partitioned %s\n" % device ) + + if NODE_MODEL_OPTIONS & ModelOptions.RAWDISK: + log.write( "Running on a raw disk node, not using it.\n" ) + continue part_path= InstallPartitionDisks.get_partition_path_from_device( device, vars, log ) + + log.write( "Attempting to add %s to the volume group\n" % device ) + if not InstallPartitionDisks.create_lvm_physical_volume( part_path, vars, log ): log.write( "Unable to create lvm physical volume %s, not using it.\n" %