Rename database fields

PGPU.capacity -> PGPU.size
VGPU_type.PGPU_footprint -> VGPU_type.size

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1434 from johnelse/rename-fields-to-size

Rename database fields
Update comments

Signed-off-by: John Else <john.else@citrix.com>
CP-5924: Add a function to help with PGPU capacity tracking

Signed-off-by: John Else <john.else@citrix.com>
CP-5924: Implement GPU_group.get_remaining_capacity

Signed-off-by: John Else <john.else@citrix.com>
CP-5924: Add GPU_group.get_remaining_capacity to CLI

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1435 from johnelse/cp-5924

Implement GPU_group.get_remaining_capacity
CP-5923: Add GPU-related helper functions to test_common.ml

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1436 from johnelse/vgpu-unit-test-basics

Add GPU-related helper functions to test_common.ml
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>
Merge pull request #1437 from simonjbeaumont/cp-5845-impl

Use GPU group allocation algorithm for choosing hosts and pGPUs for VMs
CP-5923: Add some generic code for vGPU testing

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1439 from johnelse/vgpu-test-generic

Add some generic code for vGPU testing
CP-5923: Add the test input as an argument to extract_output

Signed-off-by: John Else <john.else@citrix.com>
CP-5923: Add a couple of basic tests of get_remaining_capacity

Signed-off-by: John Else <john.else@citrix.com>