summaryrefslogtreecommitdiffstats
path: root/doc/source
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-06-25 18:00:19 +0000
committerGerrit Code Review <review@openstack.org>2012-06-25 18:00:19 +0000
commit2c7aa901b9174a4a4f04c5f8a52ef6c9d2d5d27c (patch)
tree21775987dc6e3c91bd49a3b50af090ecece3cdce /doc/source
parent259cf1cd39a46b36f47014d1b9770b52a563e9df (diff)
parent1b40708287808243be27b83791b7d23f8b51b194 (diff)
Merge "Fixes ram_allocation_ratio based over subscription"
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.