_nova_check_type scheduler hint could be accidentally persisted during a rebuild with image change

Bug #1823369 reported by Matt Riedemann on 2019-04-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Undecided
Matt Riedemann
Rocky
Undecided
Unassigned
Stein
Undecided
Unassigned

Bug Description

This is based on code inspection and related to bug 1815153 (see comments 1-4) but when we rebuild a server with a new image we go through the scheduler with a special scheduler hint:

https://github.com/openstack/nova/blob/a6963fa6858289d048e4d27ce8e61637cd023f4c/nova/compute/api.py#L3336

This line is meant to avoid accidentally persisting that change:

https://github.com/openstack/nova/blob/a6963fa6858289d048e4d27ce8e61637cd023f4c/nova/compute/api.py#L3329

But RequestSpec.save() doesn't use the id field, it looks up the RequestSpec from the DB using the instance_uuid field to save the changes:

https://github.com/openstack/nova/blob/a6963fa6858289d048e4d27ce8e61637cd023f4c/nova/objects/request_spec.py#L619

Which means we could accidentally persist that scheduler hint here if we are 'healing' a volume-backed server (since Rocky):

https://github.com/openstack/nova/blob/a6963fa6858289d048e4d27ce8e61637cd023f4c/nova/conductor/manager.py#L1009

The potential fallout from this is that future move operations of that server could only run a subset of the scheduler filters:

https://github.com/openstack/nova/blob/a6963fa6858289d048e4d27ce8e61637cd023f4c/nova/scheduler/manager.py#L125

And not even call placement...

Matt Riedemann (mriedem) wrote :

Also, force_hosts/force_nodes could be accidentally persisted in this case as well:

https://github.com/openstack/nova/blob/a6963fa6858289d048e4d27ce8e61637cd023f4c/nova/compute/api.py#L3337-L3338

Changed in nova:
importance: Medium → Undecided

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

Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
status: New → In Progress

Fix proposed to branch: master
Review: https://review.opendev.org/655278

Changed in nova:
assignee: Matt Riedemann (mriedem) → Tetsuro Nakamura (tetsuro0907)
Changed in nova:
assignee: Tetsuro Nakamura (tetsuro0907) → Matt Riedemann (mriedem)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers