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

haizea-commit at mailman.cs.uchicago.edu haizea-commit at mailman.cs.uchicago.edu
Tue Jul 15 15:57:20 CDT 2008


Author: borja
Date: 2008-07-15 15:57:20 -0500 (Tue, 15 Jul 2008)
New Revision: 435

Modified:
   trunk/src/haizea/resourcemanager/slottable.py
Log:
Fix: When >1 VM is assigned to the same physical node, the resources_in_pnode attribute in the resource reservation was being incorrectly set to the per node resource request, not to the amount of resources consumed in the pnode (which was more than the per node resource request)

Modified: trunk/src/haizea/resourcemanager/slottable.py
===================================================================
--- trunk/src/haizea/resourcemanager/slottable.py	2008-07-11 15:50:40 UTC (rev 434)
+++ trunk/src/haizea/resourcemanager/slottable.py	2008-07-15 20:57:20 UTC (rev 435)
@@ -360,7 +360,10 @@
                 canfitinnode = canfit[physnode][0]
                 for i in range(1, canfitinnode+1):
                     nodeassignment[vnode] = physnode
-                    res[physnode] = resreq
+                    if res.has_key(physnode):
+                        res[physnode].incr(resreq)
+                    else:
+                        res[physnode] = ds.ResourceTuple.copy(resreq)
                     canfit[physnode][0] -= 1
                     canfit[physnode][1] -= 1
                     vnode += 1
@@ -375,7 +378,10 @@
                 canfitinnode = canfit[physnode][1]
                 for i in range(1, canfitinnode+1):
                     nodeassignment[vnode] = physnode
-                    res[physnode] = resreq
+                    if res.has_key(physnode):
+                        res[physnode].incr(resreq)
+                    else:
+                        res[physnode] = ResourceTuple.copy(resreq)
                     canfit[physnode][1] -= 1
                     vnode += 1
                     # Check if this will actually result in a preemption
@@ -628,7 +634,10 @@
                 if canfit[n]>0:
                     canfit[n] -= 1
                     mappings[vmnode] = n
-                    res[n] = resreq
+                    if res.has_key(n):
+                        res[n].incr(resreq)
+                    else:
+                        res[n] = ds.ResourceTuple.copy(resreq)
                     vmnode += 1
                     break
 
@@ -893,7 +902,7 @@
         
     def isFull(self, time):
         nodes = self.getAvailability(time)
-        avail = sum([node.capacity.getByType(constants.RES_CPU) for node in nodes.values()])
+        avail = sum([node.capacity.get_by_type(constants.RES_CPU) for node in nodes.values()])
         return (avail == 0)
     
 



More information about the Haizea-commit mailing list