[haizea-commit] r477 - trunk/src/haizea/resourcemanager

haizea-commit at mailman.cs.uchicago.edu haizea-commit at mailman.cs.uchicago.edu
Sat Aug 30 14:42:15 CDT 2008


Author: borja
Date: 2008-08-30 14:42:14 -0500 (Sat, 30 Aug 2008)
New Revision: 477

Modified:
   trunk/src/haizea/resourcemanager/configfile.py
Log:
- Made config options class-level variables instead of instance-level, so we can access the documentation without having to instantiate a configfile class.
- Added logfile option

Modified: trunk/src/haizea/resourcemanager/configfile.py
===================================================================
--- trunk/src/haizea/resourcemanager/configfile.py	2008-08-30 19:40:47 UTC (rev 476)
+++ trunk/src/haizea/resourcemanager/configfile.py	2008-08-30 19:42:14 UTC (rev 477)
@@ -25,530 +25,552 @@
 import ConfigParser
 
 class HaizeaConfig(Config):
-    def __init__(self, config):
-        sections = []
-        
-        # ============================= #
-        #                               #
-        #        GENERAL OPTIONS        #
-        #                               #
-        # ============================= #
 
-        general = Section("general", required=True)
-        general.options = \
-        [
-         Option(name        = "loglevel",
-                getter      = "loglevel",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                default     = "INFO",
-                valid       = ["STATUS","INFO","DEBUG","VDEBUG"],
-                doc         = """
-                Controls the level (and amount) of 
-                log messages. Valid values are:
-                
-                 - STATUS: Only print status messages
-                 - INFO: Slightly more verbose that STATUS
-                 - DEBUG: Prints information useful for debugging the scheduler.
-                 - VDEBUG: Prints very verbose information
-                   on the scheduler's internal data structures. Use only
-                   for short runs.        
-                """),
-         
-         Option(name        = "mode",
-                getter      = "mode",
-                type        = OPTTYPE_STRING,
-                required    = True,
-                valid       = ["simulated","opennebula"],
-                doc         = """
-                Sets the mode the scheduler will run in.
-                Currently the only valid values are "simulated" and
-                "opennebula". The "simulated" mode expects lease
-                requests to be provided through a trace file, and
-                all enactment is simulated. The "opennebula" mode
-                interacts with the OpenNebula virtual infrastructure
-                manager (http://www.opennebula.org/) to obtain lease
-                requests and to do enactment on physical resources.
-                See sample_opennebula.conf for description of
-                OpenNebula-specific options.                
-                """),
+    sections = []
+    
+    # ============================= #
+    #                               #
+    #        GENERAL OPTIONS        #
+    #                               #
+    # ============================= #
 
-         Option(name        = "lease-preparation",
-                getter      = "lease-preparation",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                default     = constants.DEPLOYMENT_UNMANAGED,
-                valid       = [constants.DEPLOYMENT_UNMANAGED,
-                               constants.DEPLOYMENT_PREDEPLOY,
-                               constants.DEPLOYMENT_TRANSFER],
-                doc         = """
-                Sets how the scheduler will handle the
-                preparation overhead of leases. Valid values are:
-                
-                 - unmanaged: The scheduler can assume that there
-                   is no deployment overhead, or that some
-                   other entity is taking care of it (e.g., one
-                   of the enactment backends)
-                 - predeployed-images: The scheduler can assume that
-                   all required disk images are predeployed on the
-                   physical nodes. This is different from "unmanaged"
-                   because the scheduler may still have to handle
-                   making local copies of the predeployed images before
-                   a lease can start.
-                 - imagetransfer: A disk image has to be transferred
-                   from a repository node before the lease can start.
-                """),
+    general = Section("general", required=True,
+                      doc = "This section is used for general options affecting Haizea as a whole.")
+    general.options = \
+    [
+     Option(name        = "loglevel",
+            getter      = "loglevel",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            default     = "INFO",
+            valid       = ["STATUS","INFO","DEBUG","VDEBUG"],
+            doc         = """
+            Controls the level (and amount) of 
+            log messages. Valid values are:
+            
+             - STATUS: Only print status messages
+             - INFO: Slightly more verbose that STATUS
+             - DEBUG: Prints information useful for debugging the scheduler.
+             - VDEBUG: Prints very verbose information
+               on the scheduler's internal data structures. Use only
+               for short runs.        
+            """),
 
-         Option(name        = "datafile",
-                getter      = "datafile",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                default     = None,
-                doc         = """
-                This is the file where statistics on
-                the scheduler's run will be saved to (waiting time of leases,
-                utilization data, etc.). If omitted, no data will be saved.
-                """),
+     Option(name        = "logfile",
+            getter      = "logfile",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            default     = "/var/tmp/haizea.log",
+            doc         = """
+            When running Haizea as a daemon, this option specifies the file
+            that log messages should be written to.        
+            """),
+     
+     Option(name        = "mode",
+            getter      = "mode",
+            type        = OPTTYPE_STRING,
+            required    = True,
+            valid       = ["simulated","opennebula"],
+            doc         = """
+            Sets the mode the scheduler will run in.
+            Currently the only valid values are "simulated" and
+            "opennebula". The "simulated" mode expects lease
+            requests to be provided through a trace file, and
+            all enactment is simulated. The "opennebula" mode
+            interacts with the OpenNebula virtual infrastructure
+            manager (http://www.opennebula.org/) to obtain lease
+            requests and to do enactment on physical resources.                
+            """),
 
-         Option(name        = "attributes",
-                getter      = "attributes",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                doc         = """
-                This option is used internally by Haizea when using
-                multiconfiguration files. See the multiconfiguration
-                documentation for more details.        
-                """)
-        ]
+     Option(name        = "lease-preparation",
+            getter      = "lease-preparation",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            default     = constants.DEPLOYMENT_UNMANAGED,
+            valid       = [constants.DEPLOYMENT_UNMANAGED,
+                           constants.DEPLOYMENT_PREDEPLOY,
+                           constants.DEPLOYMENT_TRANSFER],
+            doc         = """
+            Sets how the scheduler will handle the
+            preparation overhead of leases. Valid values are:
+            
+             - unmanaged: The scheduler can assume that there
+               is no deployment overhead, or that some
+               other entity is taking care of it (e.g., one
+               of the enactment backends)
+             - predeployed-images: The scheduler can assume that
+               all required disk images are predeployed on the
+               physical nodes. This is different from "unmanaged"
+               because the scheduler may still have to handle
+               making local copies of the predeployed images before
+               a lease can start.
+             - imagetransfer: A disk image has to be transferred
+               from a repository node before the lease can start.
+            """),
 
-        sections.append(general)
+     Option(name        = "datafile",
+            getter      = "datafile",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            default     = None,
+            doc         = """
+            This is the file where statistics on
+            the scheduler's run will be saved to (waiting time of leases,
+            utilization data, etc.). If omitted, no data will be saved.
+            """),
 
-        # ============================= #
-        #                               #
-        #      SCHEDULING OPTIONS       #
-        #                               #
-        # ============================= #
+     Option(name        = "attributes",
+            getter      = "attributes",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            doc         = """
+            This option is used internally by Haizea when using
+            multiconfiguration files. See the multiconfiguration
+            documentation for more details.        
+            """)
+    ]
 
-        scheduling = Section("scheduling", required=True)
-        scheduling.options = \
-        [
-         Option(name        = "wakeup-interval",
-                getter      = "wakeup-interval",
-                type        = OPTTYPE_TIMEDELTA,
-                required    = False,
-                default     = TimeDelta(seconds=60),
-                doc         = """
-                Interval at which Haizea will wake up
-                to manage resources and process pending requests.
-                This option is not used when using a simulated clock,
-                since the clock will skip directly to the time where an
-                event is happening.
-                """),
+    sections.append(general)
 
-         Option(name        = "backfilling",
-                getter      = "backfilling",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                default     = None,
-                valid       = [constants.BACKFILLING_OFF,
-                               constants.BACKFILLING_AGGRESSIVE,
-                               constants.BACKFILLING_CONSERVATIVE,
-                               constants.BACKFILLING_INTERMEDIATE],
-                doc         = """
-                Backfilling algorithm to use. Valid values are:
-                
-                 - off: don't do backfilling
-                 - aggressive: at most 1 reservation in the future
-                 - conservative: unlimited reservations in the future
-                 - intermediate: N reservations in the future (N is specified
-                   in the backfilling-reservations option)
-                """),
+    # ============================= #
+    #                               #
+    #      SCHEDULING OPTIONS       #
+    #                               #
+    # ============================= #
 
-         Option(name        = "backfilling-reservations",
-                getter      = "backfilling-reservations",
-                type        = OPTTYPE_INT,
-                required    = False,
-                required_if = [(("scheduling","backfilling"),constants.BACKFILLING_INTERMEDIATE)],
-                doc         = """
-                Number of future reservations to allow when
-                using the "intermediate" backfilling option.
-                """),
+    scheduling = Section("scheduling", required=True,
+                         doc = "The options in this section control how Haizea schedules leases.")
+    scheduling.options = \
+    [
+     Option(name        = "wakeup-interval",
+            getter      = "wakeup-interval",
+            type        = OPTTYPE_TIMEDELTA,
+            required    = False,
+            default     = TimeDelta(seconds=60),
+            doc         = """
+            Interval at which Haizea will wake up
+            to manage resources and process pending requests.
+            This option is not used when using a simulated clock,
+            since the clock will skip directly to the time where an
+            event is happening.
+            """),
 
-         Option(name        = "suspension",
-                getter      = "suspension",
-                type        = OPTTYPE_STRING,
-                required    = True,
-                valid       = [constants.SUSPENSION_NONE,
-                               constants.SUSPENSION_SERIAL,
-                               constants.SUSPENSION_ALL],
-                doc         = """
-                Specifies what can be suspended. Valid values are:
-                
-                 - none: suspension is never allowed
-                 - serial-only: only 1-node leases can be suspended
-                 - all: any lease can be suspended                
-                """),
+     Option(name        = "backfilling",
+            getter      = "backfilling",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            default     = None,
+            valid       = [constants.BACKFILLING_OFF,
+                           constants.BACKFILLING_AGGRESSIVE,
+                           constants.BACKFILLING_CONSERVATIVE,
+                           constants.BACKFILLING_INTERMEDIATE],
+            doc         = """
+            Backfilling algorithm to use. Valid values are:
+            
+             - off: don't do backfilling
+             - aggressive: at most 1 reservation in the future
+             - conservative: unlimited reservations in the future
+             - intermediate: N reservations in the future (N is specified
+               in the backfilling-reservations option)
+            """),
 
-         Option(name        = "suspend-threshold-factor",
-                getter      = "suspend-threshold-factor",
-                type        = OPTTYPE_INT,
-                required    = False,
-                default     = 0,
-                doc         = """
-                Documentation                
-                """),
+     Option(name        = "backfilling-reservations",
+            getter      = "backfilling-reservations",
+            type        = OPTTYPE_INT,
+            required    = False,
+            required_if = [(("scheduling","backfilling"),constants.BACKFILLING_INTERMEDIATE)],
+            doc         = """
+            Number of future reservations to allow when
+            using the "intermediate" backfilling option.
+            """),
 
-         Option(name        = "force-suspend-threshold",
-                getter      = "force-suspend-threshold",
-                type        = OPTTYPE_TIMEDELTA,
-                required    = False,
-                doc         = """
-                Documentation                
-                """),
+     Option(name        = "suspension",
+            getter      = "suspension",
+            type        = OPTTYPE_STRING,
+            required    = True,
+            valid       = [constants.SUSPENSION_NONE,
+                           constants.SUSPENSION_SERIAL,
+                           constants.SUSPENSION_ALL],
+            doc         = """
+            Specifies what can be suspended. Valid values are:
+            
+             - none: suspension is never allowed
+             - serial-only: only 1-node leases can be suspended
+             - all: any lease can be suspended                
+            """),
 
-         Option(name        = "migration",
-                getter      = "migration",
-                type        = OPTTYPE_BOOLEAN,
-                required    = True,
-                doc         = """
-                Specifies whether leases can be migrated from one
-                physical node to another. Valid values are "True" or "False"                
-                """),
+     Option(name        = "suspend-threshold-factor",
+            getter      = "suspend-threshold-factor",
+            type        = OPTTYPE_INT,
+            required    = False,
+            default     = 0,
+            doc         = """
+            Documentation                
+            """),
 
-         Option(name        = "what-to-migrate",
-                getter      = "what-to-migrate",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                required_if = [(("scheduling","migration"),True)],
-                default     = constants.MIGRATE_NONE,
-                valid       = [constants.MIGRATE_NONE,
-                               constants.MIGRATE_MEM,
-                               constants.MIGRATE_MEMDISK],
-                doc         = """
-                Specifies what data has to be moved around when
-                migrating a lease. Valid values are:
-                
-                 - nothing: migration can be performed without transferring any
-                   files.
-                 - mem: only the memory must be transferred
-                 - mem+disk: both the memory and the VM disk image must be
-                   transferred                
-                """),
+     Option(name        = "force-suspend-threshold",
+            getter      = "force-suspend-threshold",
+            type        = OPTTYPE_TIMEDELTA,
+            required    = False,
+            doc         = """
+            Documentation                
+            """),
 
-         Option(name        = "non-schedulable-interval",
-                getter      = "non-schedulable-interval",
-                type        = OPTTYPE_TIMEDELTA,
-                required    = False,
-                default     = TimeDelta(seconds=10),
-                doc         = """
-                The minimum amount of time that must pass between
-                when a request is scheduled to when it can actually start.
-                The default should be good for most configurations, but
-                may need to be increased if you're dealing with exceptionally
-                high loads.                
-                """)
+     Option(name        = "migration",
+            getter      = "migration",
+            type        = OPTTYPE_BOOLEAN,
+            required    = True,
+            doc         = """
+            Specifies whether leases can be migrated from one
+            physical node to another. Valid values are "True" or "False"                
+            """),
 
-        ]
-        sections.append(scheduling)
-        
-        # ============================= #
-        #                               #
-        #      SIMULATION OPTIONS       #
-        #                               #
-        # ============================= #
-        
-        simulation = Section("simulation", required=False,
-                             required_if = [(("general","mode"),"simulated")] )
-        simulation.options = \
-        [
-         Option(name        = "clock",
-                getter      = "clock",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                default     = constants.CLOCK_REAL,
-                valid       = [constants.CLOCK_REAL,
-                               constants.CLOCK_SIMULATED],
-                doc         = """
-                Type of clock to use in simulation:
-                
-                 - "simulated": A simulated clock that fastforwards through
-                    time. Can only use the tracefile request
-                    frontend
-                 - "real": A real clock is used, but simulated resources and
-                   enactment actions are used. Can only use the RPC
-                   request frontend.                
-                """),
+     Option(name        = "what-to-migrate",
+            getter      = "what-to-migrate",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            required_if = [(("scheduling","migration"),True)],
+            default     = constants.MIGRATE_NONE,
+            valid       = [constants.MIGRATE_NONE,
+                           constants.MIGRATE_MEM,
+                           constants.MIGRATE_MEMDISK],
+            doc         = """
+            Specifies what data has to be moved around when
+            migrating a lease. Valid values are:
+            
+             - nothing: migration can be performed without transferring any
+               files.
+             - mem: only the memory must be transferred
+             - mem+disk: both the memory and the VM disk image must be
+               transferred                
+            """),
 
-         Option(name        = "starttime",
-                getter      = "starttime",
-                type        = OPTTYPE_DATETIME,
-                required    = False,
-                required_if = [(("simulation","clock"),constants.CLOCK_SIMULATED)],
-                doc         = """
-                Time at which simulated clock will start.                
-                """),
+     Option(name        = "non-schedulable-interval",
+            getter      = "non-schedulable-interval",
+            type        = OPTTYPE_TIMEDELTA,
+            required    = False,
+            default     = TimeDelta(seconds=10),
+            doc         = """
+            The minimum amount of time that must pass between
+            when a request is scheduled to when it can actually start.
+            The default should be good for most configurations, but
+            may need to be increased if you're dealing with exceptionally
+            high loads.                
+            """)
 
-         Option(name        = "nodes",
-                getter      = "simul.nodes",
-                type        = OPTTYPE_INT,
-                required    = True,
-                doc         = """
-                Number of nodes in the simulated cluster                
-                """) ,               
+    ]
+    sections.append(scheduling)
+    
+    # ============================= #
+    #                               #
+    #      SIMULATION OPTIONS       #
+    #                               #
+    # ============================= #
+    
+    simulation = Section("simulation", required=False,
+                         required_if = [(("general","mode"),"simulated")],
+                         doc = "This section is used to specify options when Haizea runs in simulation" )
+    simulation.options = \
+    [
+     Option(name        = "clock",
+            getter      = "clock",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            default     = constants.CLOCK_REAL,
+            valid       = [constants.CLOCK_REAL,
+                           constants.CLOCK_SIMULATED],
+            doc         = """
+            Type of clock to use in simulation:
+            
+             - "simulated": A simulated clock that fastforwards through
+                time. Can only use the tracefile request
+                frontend
+             - "real": A real clock is used, but simulated resources and
+               enactment actions are used. Can only use the RPC
+               request frontend.                
+            """),
 
-         Option(name        = "resources",
-                getter      = "simul.resources",
-                type        = OPTTYPE_STRING,
-                required    = True,
-                doc         = """
-                Resources in each node. Five types of resources
-                are recognized right now:
-                
-                 - CPU: Number of processors per node
-                 - Mem: Memory (in MB)
-                 - Net (in): Inbound network bandwidth (in Mbps) 
-                 - Net (out): Outbound network bandwidth (in Mbps) 
-                 - Disk: Disk space in MB (not counting space for disk cache)
-                """),
+     Option(name        = "starttime",
+            getter      = "starttime",
+            type        = OPTTYPE_DATETIME,
+            required    = False,
+            required_if = [(("simulation","clock"),constants.CLOCK_SIMULATED)],
+            doc         = """
+            Time at which simulated clock will start.                
+            """),
 
-         Option(name        = "imagetransfer-bandwidth",
-                getter      = "imagetransfer-bandwidth",
-                type        = OPTTYPE_INT,
-                required    = True,
-                doc         = """
-                Bandwidth (in Mbps) available for image transfers.
-                This would correspond to the outbound network bandwidth of the
-                node where the images are stored.                
-                """),
+     Option(name        = "nodes",
+            getter      = "simul.nodes",
+            type        = OPTTYPE_INT,
+            required    = True,
+            doc         = """
+            Number of nodes in the simulated cluster                
+            """) ,               
 
-         Option(name        = "suspendresume-rate",
-                getter      = "simul.suspendresume-rate",
-                type        = OPTTYPE_FLOAT,
-                required    = True,
-                doc         = """
-                Rate at which VMs are assumed to suspend (in MB of
-                memory per second)                
-                """),
+     Option(name        = "resources",
+            getter      = "simul.resources",
+            type        = OPTTYPE_STRING,
+            required    = True,
+            doc         = """
+            Resources in each node. Five types of resources
+            are recognized right now:
+            
+             - CPU: Number of processors per node
+             - Mem: Memory (in MB)
+             - Net (in): Inbound network bandwidth (in Mbps) 
+             - Net (out): Outbound network bandwidth (in Mbps) 
+             - Disk: Disk space in MB (not counting space for disk cache)
+            """),
 
-         Option(name        = "stop-when",
-                getter      = "stop-when",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                default     = constants.STOPWHEN_ALLDONE,
-                valid       = [constants.STOPWHEN_ALLDONE,
-                               constants.STOPWHEN_BESUBMITTED,
-                               constants.STOPWHEN_BEDONE],
-                doc         = """
-                When using the simulated clock, this specifies when the
-                simulation must end. Valid options are:
-                
-                 - all-leases-done: All requested leases have been completed
-                   and there are no queued/pending requests.
-                 - besteffort-submitted: When all best-effort leases have been
-                   submitted.
-                 - besteffort-done: When all best-effort leases have been
-                   completed.                
-                """),
+     Option(name        = "imagetransfer-bandwidth",
+            getter      = "imagetransfer-bandwidth",
+            type        = OPTTYPE_INT,
+            required    = True,
+            doc         = """
+            Bandwidth (in Mbps) available for image transfers.
+            This would correspond to the outbound network bandwidth of the
+            node where the images are stored.                
+            """),
 
-         Option(name        = "status-message-interval",
-                getter      = "status-message-interval",
-                type        = OPTTYPE_INT,
-                required    = False,
-                default     = None,
-                doc         = """
-                If specified, the simulated clock will print a status
-                message with some basic statistics. This is useful to keep track
-                of long simulations. The interval is specified in minutes.                
-                """)
+     Option(name        = "suspendresume-rate",
+            getter      = "simul.suspendresume-rate",
+            type        = OPTTYPE_FLOAT,
+            required    = True,
+            doc         = """
+            Rate at which VMs are assumed to suspend (in MB of
+            memory per second)                
+            """),
 
-        ]
-        sections.append(simulation)
-        
+     Option(name        = "stop-when",
+            getter      = "stop-when",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            default     = constants.STOPWHEN_ALLDONE,
+            valid       = [constants.STOPWHEN_ALLDONE,
+                           constants.STOPWHEN_BESUBMITTED,
+                           constants.STOPWHEN_BEDONE],
+            doc         = """
+            When using the simulated clock, this specifies when the
+            simulation must end. Valid options are:
+            
+             - all-leases-done: All requested leases have been completed
+               and there are no queued/pending requests.
+             - besteffort-submitted: When all best-effort leases have been
+               submitted.
+             - besteffort-done: When all best-effort leases have been
+               completed.                
+            """),
 
-        # ============================= #
-        #                               #
-        #      DEPLOYMENT OPTIONS       #
-        #     (w/ image transfers)      #
-        #                               #
-        # ============================= #
+     Option(name        = "status-message-interval",
+            getter      = "status-message-interval",
+            type        = OPTTYPE_INT,
+            required    = False,
+            default     = None,
+            doc         = """
+            If specified, the simulated clock will print a status
+            message with some basic statistics. This is useful to keep track
+            of long simulations. The interval is specified in minutes.                
+            """)
 
-        imgtransfer = Section("deploy-imagetransfer", required=False,
-                             required_if = [(("general","lease-deployment"),"imagetransfer")])
-        imgtransfer.options = \
-        [
-         Option(name        = "transfer-mechanism",
-                getter      = "transfer-mechanism",
-                type        = OPTTYPE_STRING,
-                required    = True,
-                valid       = [constants.TRANSFER_UNICAST,
-                               constants.TRANSFER_MULTICAST],
-                doc         = """
-                Specifies how disk images are transferred. Valid values are:
-                 - unicast: A disk image can be transferred to just one node at a time
-                   (NOTE: Not currently supported)
-                 - multicast: A disk image can be multicast to multiple nodes at 
-                   the same time.                
-                """),
+    ]
+    sections.append(simulation)
+    
 
-         Option(name        = "avoid-redundant-transfers",
-                getter      = "avoid-redundant-transfers",
-                type        = OPTTYPE_BOOLEAN,
-                required    = False,
-                default     = True,
-                doc         = """
-                Specifies whether the scheduler should take steps to
-                detect and avoid redundant transfers (e.g., if two leases are
-                scheduled on the same node, and they both require the same disk
-                image, don't transfer the image twice; allow one to "piggyback"
-                on the other). There is generally no reason to set this option
-                to False.
-                """),
+    # ============================= #
+    #                               #
+    #      DEPLOYMENT OPTIONS       #
+    #     (w/ image transfers)      #
+    #                               #
+    # ============================= #
 
-         Option(name        = "force-imagetransfer-time",
-                getter      = "force-imagetransfer-time",
-                type        = OPTTYPE_TIMEDELTA,
-                required    = False,
-                doc         = """
-                Documentation                
-                """),
-                
-         Option(name        = "diskimage-reuse",
-                getter      = "diskimage-reuse",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                required_if = None,
-                default     = constants.REUSE_NONE,
-                valid       = [constants.REUSE_NONE,
-                               constants.REUSE_IMAGECACHES],
-                doc         = """
-                Specifies whether disk image caches should be created
-                on the nodes, so the scheduler can reduce the number of transfers
-                by reusing images. Valid values are:
-                
-                 - none: No image reuse
-                 - image-caches: Use image caching algorithm described in Haizea
-                   publications
-                """),
+    imgtransfer = Section("deploy-imagetransfer", required=False,
+                         required_if = [(("general","lease-deployment"),"imagetransfer")],
+                         doc = """
+                         When lease deployment with disk image transfers is selected,
+                         this section is used to control image deployment parameters.""")
+    imgtransfer.options = \
+    [
+     Option(name        = "transfer-mechanism",
+            getter      = "transfer-mechanism",
+            type        = OPTTYPE_STRING,
+            required    = True,
+            valid       = [constants.TRANSFER_UNICAST,
+                           constants.TRANSFER_MULTICAST],
+            doc         = """
+            Specifies how disk images are transferred. Valid values are:
+            
+             - unicast: A disk image can be transferred to just one node at a time
+               (NOTE: Not currently supported)
+             - multicast: A disk image can be multicast to multiple nodes at 
+               the same time.                
+            """),
 
-         Option(name        = "diskimage-cache-size",
-                getter      = "diskimage-cache-size",
-                type        = OPTTYPE_INT,
-                required    = False,
-                required_if = [(("deploy-imagetransfer","diskimage-reuse"),True)],
-                doc         = """
-                Specifies the size (in MB) of the disk image cache on
-                each physical node.                
-                """)
-        ]
-        sections.append(imgtransfer)
+     Option(name        = "avoid-redundant-transfers",
+            getter      = "avoid-redundant-transfers",
+            type        = OPTTYPE_BOOLEAN,
+            required    = False,
+            default     = True,
+            doc         = """
+            Specifies whether the scheduler should take steps to
+            detect and avoid redundant transfers (e.g., if two leases are
+            scheduled on the same node, and they both require the same disk
+            image, don't transfer the image twice; allow one to "piggyback"
+            on the other). There is generally no reason to set this option
+            to False.
+            """),
 
-        # ============================= #
-        #                               #
-        #      TRACEFILE OPTIONS        #
-        #                               #
-        # ============================= #
+     Option(name        = "force-imagetransfer-time",
+            getter      = "force-imagetransfer-time",
+            type        = OPTTYPE_TIMEDELTA,
+            required    = False,
+            doc         = """
+            Documentation                
+            """),
+            
+     Option(name        = "diskimage-reuse",
+            getter      = "diskimage-reuse",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            required_if = None,
+            default     = constants.REUSE_NONE,
+            valid       = [constants.REUSE_NONE,
+                           constants.REUSE_IMAGECACHES],
+            doc         = """
+            Specifies whether disk image caches should be created
+            on the nodes, so the scheduler can reduce the number of transfers
+            by reusing images. Valid values are:
+            
+             - none: No image reuse
+             - image-caches: Use image caching algorithm described in Haizea
+               publications
+            """),
 
-        tracefile = Section("tracefile", required=False)
-        tracefile.options = \
-        [
-         Option(name        = "tracefile",
-                getter      = "tracefile",
-                type        = OPTTYPE_STRING,
-                required    = True,
-                doc         = """
-                Path to tracefile to use.                
-                """),
+     Option(name        = "diskimage-cache-size",
+            getter      = "diskimage-cache-size",
+            type        = OPTTYPE_INT,
+            required    = False,
+            required_if = [(("deploy-imagetransfer","diskimage-reuse"),True)],
+            doc         = """
+            Specifies the size (in MB) of the disk image cache on
+            each physical node.                
+            """)
+    ]
+    sections.append(imgtransfer)
 
-         Option(name        = "imagefile",
-                getter      = "imagefile",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                doc         = """
-                Path to list of images to append to lease requests.
-                If omitted, the images in the tracefile are used.                
-                """),
+    # ============================= #
+    #                               #
+    #      TRACEFILE OPTIONS        #
+    #                               #
+    # ============================= #
 
-         Option(name        = "injectionfile",
-                getter      = "injectionfile",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                doc         = """
-                Path to file with leases to "inject" into the tracefile.                
-                """),      
+    tracefile = Section("tracefile", required=False, 
+                        doc="""
+                        When reading in requests from a tracefile, this section is used
+                        to specify the tracefile and other parameters.""")
+    tracefile.options = \
+    [
+     Option(name        = "tracefile",
+            getter      = "tracefile",
+            type        = OPTTYPE_STRING,
+            required    = True,
+            doc         = """
+            Path to tracefile to use.                
+            """),
 
-         Option(name        = "add-overhead",
-                getter      = "add-overhead",
-                type        = OPTTYPE_STRING,
-                required    = False,
-                default     = constants.RUNTIMEOVERHEAD_NONE,
-                valid       = [constants.RUNTIMEOVERHEAD_NONE,
-                               constants.RUNTIMEOVERHEAD_ALL,
-                               constants.RUNTIMEOVERHEAD_BE],
-                doc         = """
-                Documentation                
-                """),   
+     Option(name        = "imagefile",
+            getter      = "imagefile",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            doc         = """
+            Path to list of images to append to lease requests.
+            If omitted, the images in the tracefile are used.                
+            """),
 
-         Option(name        = "bootshutdown-overhead",
-                getter      = "bootshutdown-overhead",
-                type        = OPTTYPE_TIMEDELTA,
-                required    = False,
-                default     = TimeDelta(seconds=0),
-                doc         = """
-                Specifies how many seconds will be alloted to
-                boot and shutdown of the lease.                
-                """),      
+     Option(name        = "injectionfile",
+            getter      = "injectionfile",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            doc         = """
+            Path to file with leases to "inject" into the tracefile.                
+            """),      
 
-         Option(name        = "runtime-slowdown-overhead",
-                getter      = "runtime-slowdown-overhead",
-                type        = OPTTYPE_FLOAT,
-                required    = False,
-                default     = 0,
-                doc         = """
-                Adds a runtime overhead (in %) to the lease duration.                
-                """)
-                      
-        ]
-        sections.append(tracefile)
-        
-        # ============================= #
-        #                               #
-        #      OPENNEBULA OPTIONS       #
-        #                               #
-        # ============================= #
+     Option(name        = "add-overhead",
+            getter      = "add-overhead",
+            type        = OPTTYPE_STRING,
+            required    = False,
+            default     = constants.RUNTIMEOVERHEAD_NONE,
+            valid       = [constants.RUNTIMEOVERHEAD_NONE,
+                           constants.RUNTIMEOVERHEAD_ALL,
+                           constants.RUNTIMEOVERHEAD_BE],
+            doc         = """
+            Documentation                
+            """),   
 
-        opennebula = Section("opennebula", required=False,
-                             required_if = [(("general","mode"),"opennebula")])
-        opennebula.options = \
-        [
-         Option(name        = "db",
-                getter      = "one.db",
-                type        = OPTTYPE_STRING,
-                required    = True,
-                doc         = """
-                Location of OpenNebula database.                
-                """),
+     Option(name        = "bootshutdown-overhead",
+            getter      = "bootshutdown-overhead",
+            type        = OPTTYPE_TIMEDELTA,
+            required    = False,
+            default     = TimeDelta(seconds=0),
+            doc         = """
+            Specifies how many seconds will be alloted to
+            boot and shutdown of the lease.                
+            """),      
 
-         Option(name        = "onevm",
-                getter      = "onevm",
-                type        = OPTTYPE_INT,
-                required    = True,
-                doc         = """
-                Location of OpenNebula "onevm" command.                
-                """),
+     Option(name        = "runtime-slowdown-overhead",
+            getter      = "runtime-slowdown-overhead",
+            type        = OPTTYPE_FLOAT,
+            required    = False,
+            default     = 0,
+            doc         = """
+            Adds a runtime overhead (in %) to the lease duration.                
+            """)
+                  
+    ]
+    sections.append(tracefile)
+    
+    # ============================= #
+    #                               #
+    #      OPENNEBULA OPTIONS       #
+    #                               #
+    # ============================= #
 
-         Option(name        = "suspendresume-rate-estimate",
-                getter      = "one.suspendresume-rate-estimate",
-                type        = OPTTYPE_FLOAT,
-                required    = False,
-                default     = 32,
-                doc         = """
-                Rate at which VMs are estimated to suspend (in MB of
-                memory per second)                
-                """),
-        ]
-        sections.append(opennebula)
+    opennebula = Section("opennebula", required=False,
+                         required_if = [(("general","mode"),"opennebula")],
+                         doc = """
+                         This section is used to specify OpenNebula parameters,
+                         necessary when using Haizea as an OpenNebula scheduling backend.""")
+    opennebula.options = \
+    [
+     Option(name        = "db",
+            getter      = "one.db",
+            type        = OPTTYPE_STRING,
+            required    = True,
+            doc         = """
+            Location of OpenNebula database.                
+            """),
 
-        Config.__init__(self, config, sections)
+     Option(name        = "onevm",
+            getter      = "onevm",
+            type        = OPTTYPE_INT,
+            required    = True,
+            doc         = """
+            Location of OpenNebula "onevm" command.                
+            """),
+
+     Option(name        = "suspendresume-rate-estimate",
+            getter      = "one.suspendresume-rate-estimate",
+            type        = OPTTYPE_FLOAT,
+            required    = False,
+            default     = 32,
+            doc         = """
+            Rate at which VMs are estimated to suspend (in MB of
+            memory per second)                
+            """),
+    ]
+    sections.append(opennebula)
+    
+    def __init__(self, config):
+        Config.__init__(self, config, self.sections)
         
         self.attrs = {}
         if self._options["attributes"] != None:



More information about the Haizea-commit mailing list