← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1798172] Re: Ironic driver tries to update the compute_node's UUID which of course fails in case of existing compute_nodes

 

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

commit 498413074d1f11688123b6b592d5c204dc7b5ef2
Author: Matt Riedemann <mriedem.os@xxxxxxxxx>
Date:   Tue Oct 16 16:23:54 2018 -0400

    Ignore uuid if already set in ComputeNode.update_from_virt_driver
    
    Change Ia69fabce8e7fd7de101e291fe133c6f5f5f7056a sets the
    ComputeNode.uuid to whatever the virt driver reports if the
    virt driver reports a uuid, like in the case of ironic.
    
    However, that breaks upgrades for any pre-existing compute
    node records which have a random uuid since ComputeNode.uuid
    is a read-only field once set.
    
    This change simply ignores the uuid from the virt driver
    resources dict if the ComputeNode.uuid is already set.
    
    The bug actually shows up in the ironic grenade CI job
    logs in stable/rocky but didn't fail the nova-compute startup
    because ComputeManager._update_available_resource_for_node()
    catches and just logs the error, but it doesn't kill the service.
    
    Change-Id: Id02f501feefca358d36f39b24d426537685e425c
    Closes-Bug: #1798172


** 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/1798172

Title:
  Ironic driver tries to update the compute_node's UUID which of course
  fails in case of existing compute_nodes

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) rocky series:
  In Progress

Bug description:
  The patch - https://review.openstack.org/#/c/571535 was introduced
  with the aim of keeping the same uuid value for ironic nodes and their
  corresponding compute_node records. This works fine for when new nodes
  are created. However upon restart/periodic updates from the ironic
  driver, it tries to update the uuid of an existing compute_node record
  based on the resource update from the ironic driver and this fails
  since once a uuid is set it cannot be changed/updated.

  Error traceback:

  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager [req-62cf93be-023b-41ca-8971-d3dbab4324f8 - - - - -] Error updating resources for node e3ef5531-3c39-458a-99f0-fd44592ae1ae.: ReadOnlyFieldError: Cannot modify readonly field uuid
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager Traceback (most recent call last):
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 7337, in update_available_resource_for_node
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager     rt.update_available_resource(context, nodename)
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager   File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 680, in update_available_resource
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager     self._update_available_resource(context, resources)
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager   File "/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 274, in inner
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager     return f(*args, **kwargs)
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager   File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 704, in _update_available_resource
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager     self._init_compute_node(context, resources)
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager   File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 559, in _init_compute_node
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager     self._copy_resources(cn, resources)
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager   File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 617, in _copy_resources
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager     compute_node.update_from_virt_driver(resources)
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager   File "/usr/lib/python2.7/site-packages/nova/objects/compute_node.py", line 353, in update_from_virt_driver
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager     setattr(self, key, resources[key])
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager   File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 77, in setter
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager     raise exception.ReadOnlyFieldError(field=name)
  2018-10-11 02:30:34.142 21850 ERROR nova.compute.manager ReadOnlyFieldError: Cannot modify readonly field uuid

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1798172/+subscriptions


References