conductor rebuild_instance does not properly handle image_ref if request_spec is not provided
Bug #1727855 reported by
Matt Riedemann
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Matt Riedemann | ||
Ocata |
Fix Committed
|
Medium
|
Matt Riedemann | ||
Pike |
Fix Committed
|
Medium
|
Matt Riedemann |
Bug Description
Maybe this doesn't actually matter for rebuild, but the image_ref used in this code:
Is a string image id, it's not a dict or ImageMeta object, it comes through the rebuild action API from the user.
It's important, however, for how scheduler_
Because I was trying to figure out if the image parameter to build_request_spec is an ImageMeta object, dict or string - since the code appears to assume it's a dict if not provided.
Conductor will then call RequestSpec.
And eventually ignored here since it's an unexpected type:
tags: |
added: scheduler removed: sch |
Changed in nova: | |
importance: | Undecided → Low |
status: | New → Triaged |
To post a comment you must log in.
The other thing is, this code in the conductor is wrong anyway since it's using the "new" image_ref requested for the rebuild:
https:/ /github. com/openstack/ nova/blob/ d36dcd52c24c324 18fd358d245688c 86664025d5/ nova/conductor/ manager. py#L830
But if we're trying to reconstruct a request_spec for the instance, we should be using the orig_image_ref parameter since that's coming off the instance:
https:/ /github. com/openstack/ nova/blob/ d36dcd52c24c324 18fd358d245688c 86664025d5/ nova/compute/ api.py# L2866
Before the instance.image_ref is updated from the API request:
https:/ /github. com/openstack/ nova/blob/ d36dcd52c24c324 18fd358d245688c 86664025d5/ nova/compute/ api.py# L2918
Note that if we're getting here because of evacuate, the image_ref parameter isn't even passed:
https:/ /github. com/openstack/ nova/blob/ d36dcd52c24c324 18fd358d245688c 86664025d5/ nova/compute/ api.py# L3978
So maybe conductor's rebuild_instance method should be passing None to scheduler_ utils.build_ request_ spec and if image is not provided, build_request_spec can get the image from the instance using instance. image_meta.
Anyway, as noted, rebuild doesn't even care about the RequestSpec.image field so I might be overthinking this.