From 1b40708287808243be27b83791b7d23f8b51b194 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Thu, 21 Jun 2012 16:41:17 -0700 Subject: Fixes ram_allocation_ratio based over subscription Fix for bug 1016273 Change-Id: I7f7b227e71e93b4bcded150791fb0b9e9df98e4c --- doc/source/devref/filter_scheduler.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc') 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. -- cgit