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 protected]> 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 -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1735188 Title: PciDevice UUID field not populated Status in OpenStack Compute (nova): Fix Released Status in OpenStack Compute (nova) pike series: In Progress 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 To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1735188/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

