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 st...@apache.org on 2011/04/04 22:29:35 UTC

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

Author: stroucki
Date: Mon Apr  4 22:29:35 2011
New Revision: 1088809

URL: http://svn.apache.org/viewvc?rev=1088809&view=rev
Log:
Allow users to be allocated from their reserved machines, even if they
did not specify the machine by name.

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=1088809&r1=1088808&r2=1088809&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/agents/primitive.py (original)
+++ incubator/tashi/trunk/src/tashi/agents/primitive.py Mon Apr  4 22:29:35 2011
@@ -131,12 +131,17 @@ class Primitive(object):
 							if ((targetHost == None or allowElsewhere) and minMaxHost == None):
 								for h in hosts.values():
 									# if the machine is suitable to host a vm, lets look at it
-									# XXXstroucki: should we let users use their reserved machines here?
-									if (h.up == True and h.state == HostState.Normal and len(h.reserved) == 0):
+									if (h.up == True and h.state == HostState.Normal):
 										pass
 									else:
 										# otherwise find another machine
 										continue
+
+									# if it's reserved, see if we can use it
+									if ((len(h.reserved) > 0) and inst.userId not in h.reserved):
+										# reserved for somebody else, so find another machine
+										continue
+
 									# implement dense packing policy:
 									# consider this host if
 									# minMax has not been modified  or