PciDevice UUID field not populated

Bug #1735188 reported by Stephen Finucane
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Matt Riedemann
Pike
Fix Released
High
Lee Yarwood

Bug Description

After upgrade 16.0.0 to 17.0.0, we see an error when trying to boot VM with sriov port.
In nova logs I see this trace:

2017-11-23 12:09:36.028 1 INFO nova.service [req-af2ce51c-73fc-4ea4-9b67-0c71c80f031a - - - - -] Updating service version for nova-compute on compute-0.localdomain from 16 to 22
2017-11-23 12:09:36.284 1 WARNING nova.compute.monitors [req-af2ce51c-73fc-4ea4-9b67-0c71c80f031a - - - - -] Excluding nova.compute.monitors.cpu monitor virt_driver. Not in the list of enabl
ed monitors (CONF.compute_monitors).
2017-11-23 12:09:36.942 1 WARNING nova.pci.utils [req-af2ce51c-73fc-4ea4-9b67-0c71c80f031a - - - - -] No net device was found for VF 0000:05:11.0: PciDeviceNotFoundById: PCI device 0000:05:1
1.0 not found
2017-11-23 12:09:37.479 1 ERROR nova.compute.manager [req-af2ce51c-73fc-4ea4-9b67-0c71c80f031a - - - - -] Error updating resources for node compute-0.localdomain.: ValueError: Field `uuid' c
annot be None
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nova/conductor/manager.py", line 123, in _object_dispatch
    return getattr(target, method)(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 184, in wrapper
    result = fn(cls, context, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/nova/objects/pci_device.py", line 458, in get_by_compute_node
    db_dev_list)
  File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 1121, in obj_make_list
    **extra_args)
  File "/usr/lib/python2.7/site-packages/nova/objects/pci_device.py", line 194, in _from_db_object
    setattr(pci_device, key, db_dev[key])
  File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 72, in setter
    field_value = field.coerce(self, name, value)
  File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/fields.py", line 193, in coerce
    return self._null(obj, attr)

  File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/fields.py", line 171, in _null
    raise ValueError(_("Field `%s' cannot be None") % attr)

ValueError: Field `uuid' cannot be None

Revision history for this message
Lee Yarwood (lyarwood) wrote :

> 16.0.0 to 17.0.0

FYI that should read 15.0.8 to 16.0.3

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/523914

Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
status: New → In Progress
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/523914
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=e727437b0ccdcc15e8ccd9b7a7c232a878dadd2d
Submitter: Zuul
Branch: master

commit e727437b0ccdcc15e8ccd9b7a7c232a878dadd2d
Author: Matt Riedemann <email address hidden>
Date: Wed Nov 29 10:36:22 2017 -0500

    Fix ValueError when loading old pci device record

    Old pci_devices records might not have a uuid value set
    and when we load those out of the database, the
    PciDevice._from_db_object code was blindly trying to set
    the PciDevice.uuid field to None, which fails because the
    PciDevice.uuid field is not nullable.

    This change fixes the problem by skipping the 'uuid' field
    if it's not set in the db record so that we can auto-generate
    a uuid later and update the object with it, which also performs
    our online data migration.

    This is similar to how we handle the uuid online migration for
    other objects like compute nodes, services and migrations.

    Change-Id: I5de0979e280004c1ce0acc99d69cc96089a704f8
    Closes-Bug: #1735188

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

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/524157

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

Reviewed: https://review.openstack.org/524157
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b1aa3ed01769f75b2fff16fb4e77269686c061b3
Submitter: Zuul
Branch: stable/pike

commit b1aa3ed01769f75b2fff16fb4e77269686c061b3
Author: Matt Riedemann <email address hidden>
Date: Wed Nov 29 10:36:22 2017 -0500

    Fix ValueError when loading old pci device record

    Old pci_devices records might not have a uuid value set
    and when we load those out of the database, the
    PciDevice._from_db_object code was blindly trying to set
    the PciDevice.uuid field to None, which fails because the
    PciDevice.uuid field is not nullable.

    This change fixes the problem by skipping the 'uuid' field
    if it's not set in the db record so that we can auto-generate
    a uuid later and update the object with it, which also performs
    our online data migration.

    This is similar to how we handle the uuid online migration for
    other objects like compute nodes, services and migrations.

    Change-Id: I5de0979e280004c1ce0acc99d69cc96089a704f8
    Closes-Bug: #1735188
    (cherry picked from commit e727437b0ccdcc15e8ccd9b7a7c232a878dadd2d)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.0.0b2

This issue was fixed in the openstack/nova 17.0.0.0b2 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.0.4

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

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.