Boot from volume fails when cross_az_attach=False due to: ObjectActionError: Object action obj_load_attr failed because: attribute host not lazy-loadable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| OpenStack Compute (nova) |
High
|
Matt Riedemann | ||
| Ocata |
High
|
Matt Riedemann |
Bug Description
Reproduced here:
May 25 02:46:02.139728 ubuntu-
May 25 02:46:02.140058 ubuntu-
May 25 02:46:02.140638 ubuntu-
May 25 02:46:02.140851 ubuntu-
May 25 02:46:02.141057 ubuntu-
May 25 02:46:02.141281 ubuntu-
May 25 02:46:02.141487 ubuntu-
May 25 02:46:02.141700 ubuntu-
May 25 02:46:02.141997 ubuntu-
May 25 02:46:02.142308 ubuntu-
May 25 02:46:02.142540 ubuntu-
May 25 02:46:02.142762 ubuntu-
May 25 02:46:02.142978 ubuntu-
May 25 02:46:02.143196 ubuntu-
May 25 02:46:02.143414 ubuntu-
May 25 02:46:02.143636 ubuntu-
May 25 02:46:02.144016 ubuntu-
May 25 02:46:02.144244 ubuntu-
This is because the instance object here is not created from the database, it's created in the API code to be set in the BuildRequest object, and it doesn't have the host field set:
So we need to handle the fact that 'host' might not be set in the instance object in this code.
Matt Riedemann (mriedem) wrote : | #1 |
Fix proposed to branch: master
Review: https:/
Changed in nova: | |
status: | Triaged → In Progress |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: master
commit 91bd79058abf799
Author: Matt Riedemann <email address hidden>
Date: Thu May 25 15:46:22 2017 -0400
Avoid lazy-load error when getting instance AZ
When [cinder]
boot from volume, the API code validates the BDM by seeing if
the instance and the volume are in the same availability zone.
To get the AZ for the instance, the code is first trying to get
the instance.host value.
In Ocata we stopped creating the instance in the API and moved that
to conductor for cells v2. So the Instance object in this case now
is created in the _provision_
BuildRequest object. Since there is no host to set on the instance
yet and the Instance object wasn't populated from DB values, which
before would set the host field on the instance object to None by
default, trying to get instance.host will lazy-load the field and
it blows up with ObjectActionError.
The correct thing to do here is check if the host attribute is set
on the Instance object. There is clear intent to assume host is
not set in the instance since it was using instance.
probably from way back in the days when the instance in this case
was a dict. So it's expecting to handle None, but we need to
modernize how that is checked.
Change-Id: I0dccb6a416dfe0
Closes-Bug: #1693600
Changed in nova: | |
status: | In Progress → Fix Released |
Fix proposed to branch: stable/ocata
Review: https:/
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit 2868d52e42cccf5
Author: Matt Riedemann <email address hidden>
Date: Thu May 25 15:46:22 2017 -0400
Avoid lazy-load error when getting instance AZ
When [cinder]
boot from volume, the API code validates the BDM by seeing if
the instance and the volume are in the same availability zone.
To get the AZ for the instance, the code is first trying to get
the instance.host value.
In Ocata we stopped creating the instance in the API and moved that
to conductor for cells v2. So the Instance object in this case now
is created in the _provision_
BuildRequest object. Since there is no host to set on the instance
yet and the Instance object wasn't populated from DB values, which
before would set the host field on the instance object to None by
default, trying to get instance.host will lazy-load the field and
it blows up with ObjectActionError.
The correct thing to do here is check if the host attribute is set
on the Instance object. There is clear intent to assume host is
not set in the instance since it was using instance.
probably from way back in the days when the instance in this case
was a dict. So it's expecting to handle None, but we need to
modernize how that is checked.
Change-Id: I0dccb6a416dfe0
Closes-Bug: #1693600
(cherry picked from commit 91bd79058abf799
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.
Fix proposed to branch: stable/newton
Review: https:/
Change abandoned by David Moreau Simard (<email address hidden>) on branch: stable/newton
Review: https:/
Reason: Correct, this doesn't seem required for newton.
Change abandoned by Matt Riedemann (<email address hidden>) on branch: stable/newton
Review: https:/
Reason: It's unclear what is causing this in newton and tomorrow is newton-eol, so I'm going to abandon this. I asked for recreate steps a couple of months ago with no response.
We stopped creating the instance in the API in Ocata so this has to go back to Ocata too.