Boot from volume fails when cross_az_attach=False with: ObjectActionError: Object action obj_load_attr failed because: attribute id not lazy-loadable

Bug #1693654 reported by Matt Riedemann on 2017-05-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
High
Matt Riedemann
Ocata
High
Matt Riedemann

Bug Description

Seen here:

http://logs.openstack.org/74/467674/3/check/gate-tempest-dsvm-neutron-full-ubuntu-xenial/0e1987b/logs/screen-n-api.txt.gz?level=TRACE#_May_25_21_03_25_417326

May 25 21:03:25.417326 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api [req-ef4c65a8-2285-4972-acfd-f2039f62c343 tempest-TestVolumeBootPattern-1076491733 tempest-TestVolumeBootPattern-1076491733] Failed BDM validation for volume: ccb49a7c-41e2-4b63-aa55-5d9964de2fec
May 25 21:03:25.417504 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api Traceback (most recent call last):
May 25 21:03:25.417676 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api File "/opt/stack/new/nova/nova/compute/api.py", line 1412, in _validate_bdm
May 25 21:03:25.417852 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api context, volume_id, instance)
May 25 21:03:25.417997 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api File "/opt/stack/new/nova/nova/compute/api.py", line 3711, in _check_attach_and_reserve_volume
May 25 21:03:25.418154 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api instance=instance)
May 25 21:03:25.418308 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api File "/opt/stack/new/nova/nova/volume/cinder.py", line 290, in check_availability_zone
May 25 21:03:25.418507 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api "instance": instance['id'],
May 25 21:03:25.418666 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 759, in __getitem__
May 25 21:03:25.418817 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api return getattr(self, name)
May 25 21:03:25.418982 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 67, in getter
May 25 21:03:25.419146 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api self.obj_load_attr(name)
May 25 21:03:25.419290 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api File "/opt/stack/new/nova/nova/objects/instance.py", line 1029, in obj_load_attr
May 25 21:03:25.419446 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api reason='attribute %s not lazy-loadable' % attrname)
May 25 21:03:25.419598 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api ObjectActionError: Object action obj_load_attr failed because: attribute id not lazy-loadable
May 25 21:03:25.419755 ubuntu-xenial-ovh-bhs1-8994148 nova-api[18329]: ERROR nova.compute.api

The instance isn't created in the API since Ocata so there is no instance.id field.

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

Changed in nova:
status: Triaged → In Progress
Changed in nova:
assignee: Matt Riedemann (mriedem) → Sean Dague (sdague)

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

commit 40cf447d28a5c9842f3546c4e7fe4efa682293cf
Author: Matt Riedemann <email address hidden>
Date: Thu May 25 21:35:09 2017 -0400

    Avoid lazy-loading instance.id when cross_az_attach=False

    The instance is no longer created in the API so the id attribute
    won't be set, which means when checking the instance AZ against
    the volume AZ, if they don't match we can't put the instance.id
    in the error message. We shouldn't have been putting the instance
    primary key in the error message anyway.

    This fixes the bug by using the instance.uuid which is set in
    this object in _provision_instances.

    Change-Id: I396b767815b666706fec980ded482fa4746d2efc
    Closes-Bug: #1693654

Changed in nova:
status: In Progress → Fix Released
Matt Riedemann (mriedem) on 2017-05-27
Changed in nova:
assignee: Sean Dague (sdague) → Matt Riedemann (mriedem)

Reviewed: https://review.openstack.org/468646
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=893d11be86588c8da744f6bbdf24b184c2d78dc0
Submitter: Jenkins
Branch: stable/ocata

commit 893d11be86588c8da744f6bbdf24b184c2d78dc0
Author: Matt Riedemann <email address hidden>
Date: Thu May 25 21:35:09 2017 -0400

    Avoid lazy-loading instance.id when cross_az_attach=False

    The instance is no longer created in the API so the id attribute
    won't be set, which means when checking the instance AZ against
    the volume AZ, if they don't match we can't put the instance.id
    in the error message. We shouldn't have been putting the instance
    primary key in the error message anyway.

    This fixes the bug by using the instance.uuid which is set in
    this object in _provision_instances.

    Change-Id: I396b767815b666706fec980ded482fa4746d2efc
    Closes-Bug: #1693654
    (cherry picked from commit 40cf447d28a5c9842f3546c4e7fe4efa682293cf)

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

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

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

Other bug subscribers