[haizea-commit] r541 - trunk/src/haizea/resourcemanager/enact
haizea-commit at mailman.cs.uchicago.edu
haizea-commit at mailman.cs.uchicago.edu
Fri Nov 7 16:38:10 CST 2008
Author: borja
Date: 2008-11-07 16:38:08 -0600 (Fri, 07 Nov 2008)
New Revision: 541
Modified:
trunk/src/haizea/resourcemanager/enact/opennebula.py
Log:
Take enactment overhead into account by spacing OpenNebula commands (avoiding OpenNebula from getting saturated)
Modified: trunk/src/haizea/resourcemanager/enact/opennebula.py
===================================================================
--- trunk/src/haizea/resourcemanager/enact/opennebula.py 2008-11-07 22:37:18 UTC (rev 540)
+++ trunk/src/haizea/resourcemanager/enact/opennebula.py 2008-11-07 22:38:08 UTC (rev 541)
@@ -24,6 +24,7 @@
from pysqlite2 import dbapi2 as sqlite
import logging
import commands
+from time import sleep
class OpenNebulaResourcePoolInfo(ResourcePoolInfo):
ONEATTR2HAIZEA = { "TOTALCPU": constants.RES_CPU,
@@ -140,6 +141,12 @@
self.logger.debug("Command returned succesfully.")
else:
raise Exception, "Error when running onevm suspend (status=%i, output='%s')" % (status, output)
+ # Space out commands to avoid OpenNebula from getting saturated
+ # TODO: We should spawn out a thread to do this
+ # TODO: We should spawn out a thread to do this, so Haizea isn't
+ # blocking until all these commands end
+ interval = get_config().get("enactment-overhead").seconds
+ sleep(interval)
def resume(self, action):
for vnode in action.vnodes:
@@ -151,6 +158,11 @@
self.logger.debug("Command returned succesfully.")
else:
raise Exception, "Error when running onevm resume (status=%i, output='%s')" % (status, output)
+ # Space out commands to avoid OpenNebula from getting saturated
+ # TODO: We should spawn out a thread to do this, so Haizea isn't
+ # blocking until all these commands end
+ interval = get_config().get("enactment-overhead").seconds
+ sleep(interval)
def verify_suspend(self, action):
# TODO: Do a single query
More information about the Haizea-commit
mailing list