XenAPI VCPU information unavailable

Bug #1192528 reported by Bob Ball
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Aditi Raveesh

Bug Description

Debugging output from the resource tracker
2013-06-19 10:56:53.538 DEBUG nova.compute.resource_tracker [-] Hypervisor: VCPU information unavailable from (pid=4514) _report_hypervisor_resource_view /opt/stack/nova/nova/compute/resource_tracker.py:339

This is because get_available_resource in the XenAPI driver returns 0 for vCPUs present and vCPUs in use.

We should instead have a maximum number of vCPUs - probably a multiple of the pCPUs - and report the number of vCPUs accurately.

At the same time, we should consider removing the xenhost xapi plugin host_data call, and just calling "host.get_rec" directly from nova-compute.

Tags: xenserver
Bob Ball (bob-ball)
tags: added: xenserver
Changed in nova:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
John Garbutt (johngarbutt) wrote :

Looking at Horizon, this now looks bad. Need to report vCPUs

vCPU info missing, and storage (in use) info looks a bit dodgy too.

Changed in nova:
importance: Low → Medium
description: updated
description: updated
Revision history for this message
Bob Ball (bob-ball) wrote :

This is medium because it breaks a CPU scheduler filter

Revision history for this message
Aditi Raveesh (aditirav) wrote :

From the VM record, it is possible to get the max number of vCPUs and the percentage of each being used.
We can derive the number of vCPUs used, using this information.

Is this the only issue being faced?

Changed in nova:
assignee: nobody → Aditi Raveesh (aditirav)
Revision history for this message
Bob Ball (bob-ball) wrote :

This defect is talking about the host statistics returned by http://git.openstack.org/cgit/openstack/nova/tree/nova/virt/xenapi/driver.py#n436

Yes, you can get per VM statistics - see http://git.openstack.org/cgit/openstack/nova/tree/nova/virt/xenapi/vm_utils.py#n1703. However, if you list_vms then for each ref call "VM.get_VCPUs_max" then that's all that's needed for the total vCPUs used.

I'm not quite sure what should be returned here - looking at the libvirt driver as an example it sets vCPU max to the number of physical processors - which doesn't allow operators to decide how much to over-commit by, and you will easily exceed this "maximum"

Revision history for this message
Bob Ball (bob-ball) wrote :

The host CPU utilisation can probably be retrieved from host, getting host_CPUs, then for each of them reading the "utilisation" field" - see http://docs.vmd.citrix.com/XenServer/6.1.0/1.0/en_gb/api/?c=host and http://docs.vmd.citrix.com/XenServer/6.1.0/1.0/en_gb/api/?c=host_cpu

The VM CPU utilisation can likewise be obtained, e.g. xe vm-param-get uuid=82cdbbaf-338f-85d4-82d2-8f4f00a0971d param-name=VCPUs-utilisation. In XenAPI that's obtained from the VM-metrics record referenced from the VM object.

Revision history for this message
Bob Ball (bob-ball) wrote :

Sorry - I should have said that given we're primarily interested in the host, I think getting the metrics from the host over CPU utilisation will be closer than adding up all of the vCPU metrics. That'll include any usage in Dom0 such as that used for qemu.

Revision history for this message
Aditi Raveesh (aditirav) wrote :

@Bob Ball, yes using the host_cpu information makes sense.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/66597
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8761a7b9c8a967d2b5bf7b690115af98ee0cbd0e
Submitter: Jenkins
Branch: master

commit 8761a7b9c8a967d2b5bf7b690115af98ee0cbd0e
Author: Bob Ball <email address hidden>
Date: Tue Jan 14 15:07:39 2014 +0000

    XenAPI: Report the CPU details correctly

    Driver was not filling in the cpu_count in the correct field.
    Also added VM vcpu count

    Change-Id: I6339d7fd4faffcd5320fd86b55ff3a5e3515e2bf
    Closes-bug: 1192528

Changed in nova:
status: Triaged → Fix Committed
Changed in nova:
milestone: none → icehouse-3
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-3 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.