[haizea-commit] r441 - in trunk: etc src/haizea/common src/haizea/resourcemanager

haizea-commit at mailman.cs.uchicago.edu haizea-commit at mailman.cs.uchicago.edu
Mon Jul 21 04:33:32 CDT 2008


Author: borja
Date: 2008-07-21 04:33:32 -0500 (Mon, 21 Jul 2008)
New Revision: 441

Modified:
   trunk/etc/sample_opennebula.conf
   trunk/src/haizea/common/config.py
   trunk/src/haizea/common/constants.py
   trunk/src/haizea/resourcemanager/rm.py
Log:
Added "wakeup-interval" and "non-schedulable-interval" to [opennebula] section (these options were previously hardcoded)

Modified: trunk/etc/sample_opennebula.conf
===================================================================
--- trunk/etc/sample_opennebula.conf	2008-07-16 17:21:36 UTC (rev 440)
+++ trunk/etc/sample_opennebula.conf	2008-07-21 09:33:32 UTC (rev 441)
@@ -11,12 +11,31 @@
 # Description: Location of OpenNebula database.
 db: /home/borja/files/db/one.db
 
+# Option: onevm
+# Required: Yes
+# Description: Location of OpenNebula "onevm" command.
+onevm: /home/borja/bin/onevm
+
+# Option: wakeup-interval
+# Required: No (default is 60 seconds)
+# Description: Interval at which Haizea will wake up
+#   to process pending requests in OpenNebula.
+wakeup-interval: 60
+
 # Option: suspendresume-rate-estimate
-# Required: Yes
+# Required: No (default is 32 MB/s)
 # Description: Rate at which VMs are estimated to suspend (in MB of
 #   memory per second)
 suspendresume-rate-estimate: 50
 
+# Option: non-schedulable-interval
+# Required: No (default is 10 seconds)
+# Description: 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.
+non-schedulable-interval: 10
 
 
 # ============================= #
@@ -30,7 +49,7 @@
 [general]
 loglevel: INFO
 mode: opennebula
-datadir: /var/tmp/haizea/results
+datafile: /var/tmp/haizea/results.dat
 lease-deployment: unmanaged
 
 [scheduling]

Modified: trunk/src/haizea/common/config.py
===================================================================
--- trunk/src/haizea/common/config.py	2008-07-16 17:21:36 UTC (rev 440)
+++ trunk/src/haizea/common/config.py	2008-07-21 09:33:32 UTC (rev 441)
@@ -186,9 +186,24 @@
     def getONEvm(self):
         return self.config.get(constants.OPENNEBULA_SEC, constants.ONEVM_OPT)
 
+    def get_wakeup_interval(self):
+        if not self.config.has_option(constants.OPENNEBULA_SEC, constants.WAKEUPINTERVAL_OPT):
+            return 60
+        else:
+            return self.config.getint(constants.OPENNEBULA_SEC, constants.WAKEUPINTERVAL_OPT)
+
     def getONESuspendResumeRate(self):
-        return self.config.getint(constants.OPENNEBULA_SEC, constants.ESTIMATESUSPENDRATE_OPT)
+        if not self.config.has_option(constants.OPENNEBULA_SEC, constants.ESTIMATESUSPENDRATE_OPT):
+            return 32
+        else:
+            return self.config.getint(constants.OPENNEBULA_SEC, constants.ESTIMATESUSPENDRATE_OPT)
 
+    def get_non_schedulable_interval(self):
+        if not self.config.has_option(constants.OPENNEBULA_SEC, constants.NONSCHEDULABLE_OPT):
+            return 10
+        else:
+            return self.config.getint(constants.OPENNEBULA_SEC, constants.NONSCHEDULABLE_OPT)
+
     #
     # SCHEDULING OPTIONS
     #

Modified: trunk/src/haizea/common/constants.py
===================================================================
--- trunk/src/haizea/common/constants.py	2008-07-16 17:21:36 UTC (rev 440)
+++ trunk/src/haizea/common/constants.py	2008-07-21 09:33:32 UTC (rev 441)
@@ -149,6 +149,8 @@
 DB_OPT = "db"
 ONEVM_OPT = "onevm"
 ESTIMATESUSPENDRATE_OPT = "suspendresume-rate-estimate"
+WAKEUPINTERVAL_OPT = "wakeup-interval"
+NONSCHEDULABLE_OPT = "non-schedulable-interval"
 
 DEPLOY_IMAGETRANSFER_SEC = "deploy-imagetransfer"
 TRANSFER_MECHANISM_OPT = "transfer-mechanism"

Modified: trunk/src/haizea/resourcemanager/rm.py
===================================================================
--- trunk/src/haizea/resourcemanager/rm.py	2008-07-16 17:21:36 UTC (rev 440)
+++ trunk/src/haizea/resourcemanager/rm.py	2008-07-21 09:33:32 UTC (rev 441)
@@ -88,8 +88,11 @@
             # In simulation, we can only use the tracefile frontend
             self.frontends = [TracefileFrontend(self, self.clock.get_start_time())]
         elif mode == "opennebula":
+            
             # The clock
-            self.clock = RealClock(self, 5)
+            wakeup_interval = config.get_wakeup_interval()
+            non_sched = config.get_non_schedulable_interval()
+            self.clock = RealClock(self, wakeup_interval, non_sched)
     
             # Resource pool
             self.resourcepool = ResourcePool(self)
@@ -478,7 +481,7 @@
     debugging purposes (however, unlike the simulated clock, the clock will
     always skip a fixed amount of time into the future).
     """
-    def __init__(self, rm, quantum, fastforward = False):
+    def __init__(self, rm, quantum, non_sched, fastforward = False):
         """Initializes the real clock.
         
         Arguments:
@@ -493,8 +496,10 @@
         else:
             self.lastwakeup = roundDateTime(now())
         self.starttime = self.get_time()
+        self.nextschedulable = None
         self.nextperiodicwakeup = None
         self.quantum = TimeDelta(seconds=quantum)
+        self.non_sched = TimeDelta(seconds=non_sched)
                
     def get_time(self):
         """See docstring in base Clock class."""
@@ -509,7 +514,7 @@
 
     def get_next_schedulable_time(self):
         """See docstring in base Clock class."""
-        return self.nextperiodicwakeup    
+        return self.nextschedulable    
     
     def run(self):
         """Runs the real clock through time.
@@ -545,12 +550,15 @@
                 self.lastwakeup = roundDateTime(self.get_time())
             self.rm.logger.status("Wake-up time recorded as %s" % self.lastwakeup, constants.CLOCK)
                 
+            # Next schedulable time
+            self.nextschedulable = roundDateTime(self.lastwakeup + self.non_sched)
+            
             # Next wakeup time
             self.nextperiodicwakeup = roundDateTime(self.lastwakeup + self.quantum)
 
             # Wake up the resource manager
             self.rm.process_reservations(self.lastwakeup)
-            self.rm.process_requests(self.nextperiodicwakeup)
+            self.rm.process_requests(self.nextschedulable)
             
             # Determine if there's anything to do before the next wakeup time
             nextchangepoint = self.rm.get_next_changepoint()
@@ -588,7 +596,7 @@
 
 if __name__ == "__main__":
     from haizea.common.config import RMConfig
-    CONFIGFILE = "../../../etc/sample.conf"
+    CONFIGFILE = "../../../etc/sample_opennebula.conf"
     CONFIG = RMConfig.fromFile(CONFIGFILE)
     RM = ResourceManager(CONFIG)
     RM.start()
\ No newline at end of file



More information about the Haizea-commit mailing list