summaryrefslogtreecommitdiffstats
path: root/doc/source
diff options
context:
space:
mode:
authorJoe Gordon <jogo@cloudscaling.com>2012-06-21 16:41:17 -0700
committerJoe Gordon <jogo@cloudscaling.com>2012-06-21 17:49:16 -0700
commit1b40708287808243be27b83791b7d23f8b51b194 (patch)
tree9406d98103551219d2e0b35b98bd5d99c384f4ec /doc/source
parent3252371afca71f57c171569676d5de70439d5384 (diff)
downloadnova-1b40708287808243be27b83791b7d23f8b51b194.tar.gz
nova-1b40708287808243be27b83791b7d23f8b51b194.tar.xz
nova-1b40708287808243be27b83791b7d23f8b51b194.zip
Fixes ram_allocation_ratio based over subscription
Fix for bug 1016273 Change-Id: I7f7b227e71e93b4bcded150791fb0b9e9df98e4c
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/devref/filter_scheduler.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/source/devref/filter_scheduler.rst b/doc/source/devref/filter_scheduler.rst
index 5ae5bcd4e..91cf0e5a0 100644
--- a/doc/source/devref/filter_scheduler.rst
+++ b/doc/source/devref/filter_scheduler.rst
@@ -62,7 +62,9 @@ code. For example class |RamFilter| has the next realization:
instance_type = filter_properties.get('instance_type')
requested_ram = instance_type['memory_mb']
free_ram_mb = host_state.free_ram_mb
- return free_ram_mb * FLAGS.ram_allocation_ratio >= requested_ram
+ 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
Here `ram_allocation_ratio` means the virtual RAM to physical RAM allocation
ratio (it is 1.5 by default). Really, nice and simple.