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

haizea-commit at mailman.cs.uchicago.edu haizea-commit at mailman.cs.uchicago.edu
Tue Sep 16 05:43:48 CDT 2008


Author: borja
Date: 2008-09-16 05:43:48 -0500 (Tue, 16 Sep 2008)
New Revision: 501

Modified:
   trunk/src/haizea/resourcemanager/configfile.py
   trunk/src/haizea/resourcemanager/rm.py
Log:
Added "dry run" to OpenNebula mode

Modified: trunk/src/haizea/resourcemanager/configfile.py
===================================================================
--- trunk/src/haizea/resourcemanager/configfile.py	2008-09-16 10:43:23 UTC (rev 500)
+++ trunk/src/haizea/resourcemanager/configfile.py	2008-09-16 10:43:48 UTC (rev 501)
@@ -591,6 +591,25 @@
             For now, this only makes sense if you're seeding Haizea with requests from
             the start (otherwise, it will start and immediately stop).
             """),            
+
+     Option(name        = "dry-run",
+            getter      = "dry-run",
+            type        = OPTTYPE_BOOLEAN,
+            required    = False,
+            default     = False,
+            doc         = """
+            This option is useful for testing.
+            If set to True, Haizea will fast-forward through time (note that this is
+            different that using the simulated clock, which has to be used with a tracefile;
+            with an Haizea/OpenNebula dry run, you will have to see OpenNebula with requests
+            before starting Haizea). You will generally want to set stop-when-no-more-leases
+            when doing a dry-run.
+            
+            IMPORTANT: Haizea will still send out enactment commands to OpenNebula. Make
+            sure you replace onevm with a dummy command that does nothing (or that reacts
+            in some way you want to test; e.g., by emulating a deployment failure, etc.)
+            """),            
+
     ]
     sections.append(opennebula)
     

Modified: trunk/src/haizea/resourcemanager/rm.py
===================================================================
--- trunk/src/haizea/resourcemanager/rm.py	2008-09-16 10:43:23 UTC (rev 500)
+++ trunk/src/haizea/resourcemanager/rm.py	2008-09-16 10:43:48 UTC (rev 501)
@@ -36,11 +36,8 @@
 import haizea.resourcemanager.enact as enact
 from haizea.resourcemanager.deployment.unmanaged import UnmanagedDeploymentScheduler
 from haizea.resourcemanager.deployment.imagetransfer import ImageTransferDeploymentScheduler
-from haizea.resourcemanager.enact.opennebula.info import OpenNebulaResourcePoolInfo
-from haizea.resourcemanager.enact.opennebula.vm import OpenNebulaVMEnactment
-from haizea.resourcemanager.enact.simulated.info import SimulatedResourcePoolInfo
-from haizea.resourcemanager.enact.simulated.vm import SimulatedVMEnactment
-from haizea.resourcemanager.enact.simulated.deployment import SimulatedDeploymentEnactment
+from haizea.resourcemanager.enact.opennebula import OpenNebulaResourcePoolInfo, OpenNebulaVMEnactment
+from haizea.resourcemanager.enact.simulated import SimulatedResourcePoolInfo, SimulatedVMEnactment, SimulatedDeploymentEnactment
 from haizea.resourcemanager.frontends.tracefile import TracefileFrontend
 from haizea.resourcemanager.frontends.opennebula import OpenNebulaFrontend
 from haizea.resourcemanager.frontends.rpc import RPCFrontend
@@ -169,10 +166,16 @@
         # The clock
         wakeup_interval = self.config.get("wakeup-interval")
         non_sched = self.config.get("non-schedulable-interval")
-        self.clock = RealClock(self, wakeup_interval, non_sched, True)
+        dry_run = self.config.get("dry-run")
+        fastforward = dry_run
+        self.clock = RealClock(self, wakeup_interval, non_sched, fastforward)
         
         # RPC server
-        self.rpc_server = None
+        if dry_run:
+            # No need for an RPC server when doing a dry run
+            self.rpc_server = None
+        else:
+            self.rpc_server = RPCServer(self)
         
         # Enactment modules
         info_enact = OpenNebulaResourcePoolInfo()



More information about the Haizea-commit mailing list