You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tashi-commits@incubator.apache.org by mr...@apache.org on 2009/09/23 18:53:04 UTC

svn commit: r818201 - /incubator/tashi/trunk/src/tashi/agents/primitive.py

Author: mryan3
Date: Wed Sep 23 18:53:04 2009
New Revision: 818201

URL: http://svn.apache.org/viewvc?rev=818201&view=rev
Log:
Added some code to make the scheduler only complain once if it can't find a place to put a VM


Modified:
    incubator/tashi/trunk/src/tashi/agents/primitive.py

Modified: incubator/tashi/trunk/src/tashi/agents/primitive.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/agents/primitive.py?rev=818201&r1=818200&r2=818201&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/agents/primitive.py (original)
+++ incubator/tashi/trunk/src/tashi/agents/primitive.py Wed Sep 23 18:53:04 2009
@@ -50,6 +50,7 @@
 	
 	def start(self):
 		oldInstances = {}
+		muffle = {}
 		while True:
 			try:
 				# Generate a list of VMs/host
@@ -109,8 +110,11 @@
 								self.log.info("Scheduling instance %s (%d mem, %d cores, %d uid) on host %s" % (inst.name, inst.memory, inst.cores, inst.userId, minMaxHost.name))	
 								self.client.activateVm(i, minMaxHost)
 								load[minMaxHost.id] = load[minMaxHost.id] + [i]
+								muffle.clear()
 							else:
-								self.log.info("Failed to find a suitable place to schedule %s" % (inst.name))
+								if (inst.name not in muffle):
+									self.log.info("Failed to find a suitable place to schedule %s" % (inst.name))
+									muffle[inst.name] = True
 						except Exception, e:
 							self.log.exception("Failed to schedule or activate %s" % (inst.name))
 				time.sleep(self.scheduleDelay)