Nova-compute raise exception when vcpu_pin_set is set to None or"".

Bug #1579664 reported by liuxiuli on 2016-05-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Davanum Srinivas (DIMS)
Newton
Medium
Lee Yarwood

Bug Description

Description
===========
In Mitaka, Nova-compute raise exception when vcpu_pin_set is set to None or"".And nova-compute fails to start.

Steps to reproduce
==================
Edit vcpu_pin_set=None or vcpu_pin_set=""
then restart nova-compute service

Expected result
===============
Get_vcpu_total returns total_pcpus, and nova-compute service starts successfully.

Actual result
=============
When set vcpu_pin_set to None, raise following exception and nova-compute service fails to start:
2016-05-10 09:00:02.835 TRACE nova.compute.manager Traceback (most recent call last):
2016-05-10 09:00:02.835 TRACE nova.compute.manager File "/opt/stack/nova/nova/compute/manager.py", line 6460, in update_available_resource
2016-05-10 09:00:02.835 TRACE nova.compute.manager rt.update_available_resource(context)
2016-05-10 09:00:02.835 TRACE nova.compute.manager File "/opt/stack/nova/nova/compute/resource_tracker.py", line 500, in update_available_resource
2016-05-10 09:00:02.835 TRACE nova.compute.manager resources = self.driver.get_available_resource(self.nodename)
2016-05-10 09:00:02.835 TRACE nova.compute.manager File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 5363, in get_available_resource
2016-05-10 09:00:02.835 TRACE nova.compute.manager data["vcpus"] = self._get_vcpu_total()
2016-05-10 09:00:02.835 TRACE nova.compute.manager File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 4958, in _get_vcpu_total
2016-05-10 09:00:02.835 TRACE nova.compute.manager available_ids = hardware.get_vcpu_pin_set()
2016-05-10 09:00:02.835 TRACE nova.compute.manager File "/opt/stack/nova/nova/virt/hardware.py", line 50, in get_vcpu_pin_set
2016-05-10 09:00:02.835 TRACE nova.compute.manager cpuset_ids = parse_cpu_spec(CONF.vcpu_pin_set)
2016-05-10 09:00:02.835 TRACE nova.compute.manager File "/opt/stack/nova/nova/virt/hardware.py", line 113, in parse_cpu_spec
2016-05-10 09:00:02.835 TRACE nova.compute.manager "expression %r") % rule)
2016-05-10 09:00:02.835 TRACE nova.compute.manager Invalid: Invalid inclusion expression 'None'

When set vcpu_pin_set to "", raise following exception and nova-compute service fails to start:
2016-05-10 08:55:18.558 TRACE nova.compute.manager Traceback (most recent call last):
2016-05-10 08:55:18.558 TRACE nova.compute.manager File "/opt/stack/nova/nova/compute/manager.py", line 6460, in update_available_resource
2016-05-10 08:55:18.558 TRACE nova.compute.manager rt.update_available_resource(context)
2016-05-10 08:55:18.558 TRACE nova.compute.manager File "/opt/stack/nova/nova/compute/resource_tracker.py", line 500, in update_available_resource
2016-05-10 08:55:18.558 TRACE nova.compute.manager resources = self.driver.get_available_resource(self.nodename)
2016-05-10 08:55:18.558 TRACE nova.compute.manager File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 5363, in get_available_resource
2016-05-10 08:55:18.558 TRACE nova.compute.manager data["vcpus"] = self._get_vcpu_total()
2016-05-10 08:55:18.558 TRACE nova.compute.manager File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 4971, in _get_vcpu_total
2016-05-10 08:55:18.558 TRACE nova.compute.manager if not (available_ids <= online_pcpus):
2016-05-10 08:55:18.558 TRACE nova.compute.manager TypeError: can only compare to a set

Environment
===========
Mitaka version and KVM driver

liuxiuli, I can only recreate the problem with vcpu_pin_set is set to "". when vcpu_pin_set is set to None it works fine. I'll upload a review, please try that and let me know.

Thanks,
Dims

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

Changed in nova:
assignee: nobody → Davanum Srinivas (DIMS) (dims-v)
status: New → In Progress
liuxiuli (liu-lixiu) wrote :

Sorry,it is my mistake, I do a new test in following version and have update the exception in the bug description.
[stack@SBCJSlot5Rack2Centos7 devstack]$ git log -1
commit 603fc0c6ec58a0fec060a1030e58b5f7e56794d4
Author: Mark Vanderwiel <email address hidden>
Date: Thu Mar 17 12:19:16 2016 -0500

description: updated

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

commit 8b199c6dff4c61169a9eb916511b716d8f20c015
Author: Davanum Srinivas <email address hidden>
Date: Mon May 9 08:23:25 2016 -0400

    Fix exception when vcpu_pin_set is set to ""

    We should treat vcpu_pin_set="", same as vcpu_pin_set=None and
    avoid the problem mentioned in the bug report.

    Closes-Bug: #1579664
    Change-Id: Ifa2b960aa74072ba668c9d028df108af6156fe40

Changed in nova:
status: In Progress → Fix Released
Matt Riedemann (mriedem) on 2016-10-14
Changed in nova:
importance: Undecided → Medium

Reviewed: https://review.openstack.org/386675
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=104f8cc4c41c77bd07503329710e622f27e11372
Submitter: Jenkins
Branch: stable/newton

commit 104f8cc4c41c77bd07503329710e622f27e11372
Author: Davanum Srinivas <email address hidden>
Date: Mon May 9 08:23:25 2016 -0400

    Fix exception when vcpu_pin_set is set to ""

    We should treat vcpu_pin_set="", same as vcpu_pin_set=None and
    avoid the problem mentioned in the bug report.

    Closes-Bug: #1579664
    Change-Id: Ifa2b960aa74072ba668c9d028df108af6156fe40
    (cherry picked from commit 8b199c6dff4c61169a9eb916511b716d8f20c015)

This issue was fixed in the openstack/nova 14.0.2 release.

This issue was fixed in the openstack/nova 15.0.0.0b1 development milestone.

This issue was fixed in the openstack/nova 14.0.2 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers