summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorJoe Gordon <jogo@cloudscaling.com>2012-07-17 12:30:21 -0700
committerJoe Gordon <jogo@cloudscaling.com>2012-07-17 19:59:51 -0700
commit2ebfbb03f0fa58121ada861cc8c6695a88c3e846 (patch)
tree35c0f61dd7680f1dc97ffb3376a7a8ad1fba4e07 /nova
parentacb158714c562d3142bf2f3f560dc374daa2df7d (diff)
Add debug output to RamFilter
Change-Id: I83650f052dd8f0961a72a70aaf57c486bfdee8e0
Diffstat (limited to 'nova')
-rw-r--r--nova/scheduler/filters/ram_filter.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/nova/scheduler/filters/ram_filter.py b/nova/scheduler/filters/ram_filter.py
index 7f79c1923..c2bcfbf7f 100644
--- a/nova/scheduler/filters/ram_filter.py
+++ b/nova/scheduler/filters/ram_filter.py
@@ -39,5 +39,11 @@ class RamFilter(filters.BaseHostFilter):
free_ram_mb = host_state.free_ram_mb
total_usable_ram_mb = host_state.total_usable_ram_mb
used_ram_mb = total_usable_ram_mb - free_ram_mb
- return (total_usable_ram_mb * FLAGS.ram_allocation_ratio -
- used_ram_mb >= requested_ram)
+ usable_ram = (total_usable_ram_mb * FLAGS.ram_allocation_ratio -
+ used_ram_mb)
+ if not usable_ram >= requested_ram:
+ LOG.debug(_("%(host_state)s does not have %(requested_ram)s MB "
+ "usable ram, it only has %(usable_ram)s MB usable ram."),
+ locals())
+ return False
+ return True