Nova compute should work for non-continous pCPUs with vcpu pinning enabled.

Bug #1442546 reported by Sudipta Biswas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Sudipta Biswas

Bug Description

Environment: Openstack Juno. (Same code in the master as well).
Physical machine doesn't have continuous blocks of cpu in online state.
Online pCPUs are: 4,8 and 12.
vcpu pinning is enabled via the vcpu_pin_set attribute in /etc/nova/nova.conf
vcpu_pin_set="4,8,12"
The nova code in /nova/virt/libvirt/driver.py inside get_vcpu_total() is checking the length of available_ids from the nova.conf as:

if available_ids[-1] >= total_pcpus:
            raise exception.Invalid(_("Invalid vcpu_pin_set config, "
                                      "out of hypervisor cpu range."))

available_ids in this case contains [4,8,12].
The total pcpus count given by libvirt is 3 (number of on-line pcpus).
Hence the above check fails since it determines the total available CPUs as 12.

Nova should not expect the online CPUs to be continuous numbers always.
Filing a bug to address this.

Tags: libvirt
Changed in nova:
assignee: nobody → Sudipta Biswas (sbiswas7)
Revision history for this message
Sudipta Biswas (sbiswas7) wrote :

Also figured out that the present check is like this:

sorted(available_ids)[-1] >= total_pcpus

This allows us to detect the out of range pCPUs correctly.
For example if the range specified in the conf file is 0-16 and the total pcpus are only 10, then we would detect that as a invalid config. So the fix should be to retain this out of range behavior but the total_pcpus check needs to be improved.
Working on the same.

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/173187

Matt Riedemann (mriedem)
tags: added: libvirt
tags: added: juno-backport-potential kilo-backport-potential
description: updated
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit bead2f51f8ad651cc46f8436cb1b0c3f8a7c93a9
Author: Sudipta Biswas <email address hidden>
Date: Tue Apr 14 12:11:31 2015 +0530

    libvirt: Allow discrete online pCPUs for pinning

    Currently, the check for cpu pinning is a little broad and
    it doesn't allow pinning for discrete online pcpu sets if the
    cpuset ID exceeds the total number of online pcpus.

    The fix is for NUMA topology enabled hosts, where the list of
    online pcpus are obtained and compared with the list of IDs which
    are requested as a part of cpu pinning. If the IDs form a subset
    of the total online pcpus on the host, pinning is allowed.
    If not, old behavior is retained.

    Change-Id: I8cbd938f99e1eae9eeaa3bb27f492c95734bbfab
    Closes-Bug: #1442546

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-1 → 12.0.0
Revision history for this message
Tony Breeds (o-tony) wrote :

Removed the juno-backport-potential tag as well Juno is closed
Removed the kilo-backport-potential tag as this is a low priority bug that affected a narrow use case within the community and doesn't meet the stable criteria for "Phase II" support

tags: removed: juno-backport-potential kilo-backport-potential
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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