Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


CA-95053: VM.start must check if a host has enough memory. #1068

wants to merge 1 commit into from

3 participants


Signed-off-by: Jerome Maloberti

@jeromemaloberti jeromemaloberti CA-95053: VM.start must check if a host has enough memory.
Signed-off-by: Jerome Maloberti <>
@djs55 djs55 was assigned

Assigning to @djs55 for review



Sorry for the delay getting back to you. Unfortunately the code in this area is very confusing, making it impossible for me to check if a change is ok solely through code inspection. I think we need to rewrite and simplify this area!

For now, I would be happy if you could dev test two situations:

  1. with 2 hosts (1 host is full and 1 host is empty): VM.start always chooses the empty host
  2. with 2 hosts (both hosts are full): VM.start always chooses some host and runs the domain builder ("xenguest") on it. The domain builder will fail but this is ok. In future a "magic" domain builder which can do page sharing may not fail...




When I tested (few months ago, so I need to test again as soon as possible), the situation was:
1 - VM.start chooses the first host in the list (usually master) and try to start and eventually fails. The commit is fixing this case.
2 - VM.start doesn't even try to start the VM since no host has enough memory. In case a "magic" domain builder can eventually reclaim some memory, then the function evaluating the free memory on each host should be changed.


Closing this in favour of the derivative pull request PR#1216

@jonludlam jonludlam closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 11, 2013
  1. @jeromemaloberti

    CA-95053: VM.start must check if a host has enough memory.

    jeromemaloberti authored
    Signed-off-by: Jerome Maloberti <>
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  ocaml/xapi/
2  ocaml/xapi/
@@ -581,7 +581,7 @@ let vm_can_run_on_host __context vm snapshot host =
let host_metrics = Db.Host.get_metrics ~__context ~self:host in
Db.Host_metrics.get_live ~__context ~self:host_metrics in
let host_can_run_vm () =
- assert_can_boot_here ~__context ~self:vm ~host ~snapshot ~do_memory_check:false ();
+ assert_can_boot_here ~__context ~self:vm ~host ~snapshot ~do_memory_check:true ();
true in
try host_has_proper_version () && host_enabled () && host_live () && host_can_run_vm ()
with _ -> false
Something went wrong with that request. Please try again.