Implement PGPU.get_remaining_capacity

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1438 from johnelse/pgpu-get-remaining-capacity

Implement PGPU.get_remaining_capacity
Whitespace: Formatting in Xapi_vm_helpers

$ camlp4o ocaml/xapi/xapi_vm_helpers.ml -printer o | md5sum
4f52a2cd7f2290d29e818aa4edbada31  -

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-5845: Modify select_host to take a host list

Modify the function in Xapi_vm_placement to take a list of hosts to choose from
rather than trying all hosts in the pool.

No behavioural change is expected after this changeset since the list being
passed in is currently the list of all hosts.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-5845: Use policy when choosing VM host and pGPU

At the pool-level, hosts are split into groups of equally-optimal hosts (based
on GPU_group.allocation_algorithm). The VM placement code is then run
sequentially on each of these groups (cf. was run before on all hosts in pool).
Only when exhausing this list of lists of hosts does it fail to start the VM.

At the host-level, a pGPU is selected according to the same
allocation_algorithm. If no capacity can be found then the VM_REQUIRES_VGPU
error is raised.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-5845: Use PGPU.get_remaining_capacity API call

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>