compute: RequestSpec sanitization for cross-HV resize#623
Conversation
8b7bd58 to
e31a071
Compare
Sanitize VMware-specific image properties directly on the canonical RequestSpec before scheduling, matching how request_spec.flavor is already handled in the cold migrate flow. The sanitizer mutates request_spec.image.properties in place and returns a dict of original values. After task.execute() succeeds, the conductor persists this into MigrationContext.old_image_properties (via instance.save()) before calling request_spec.save(). This ordering ensures the rollback copy is always available if request_spec has been rewritten. Changes: - nova/compute/utils.py: add sanitize_image_props_for_kvm() - nova/conductor/tasks/migrate.py: call sanitizer in _execute() - nova/conductor/manager.py: persist old_image_properties to MigrationContext before request_spec.save() Change-Id: I4f7035358a9a7f46d942bfad07d748d1d333f8c5
e31a071 to
a9d7726
Compare
joker-at-work
left a comment
There was a problem hiding this comment.
Do we need to save the request spec info somewhere? Are these same values not replicated to instance.image_meta or are these just a subset?
|
From my current understanding, we do need to persist them in Relevant comment from upstream:
|
|
Oh, yes, I was just wondering if they'd contain the same, if we really need to extend the migration object or could just use them from there. What happens if the migration succeed and is not rolled back? Then |
|
This PR is primarily about the scheduling side: It ensures the Sidenote: There is this previously attempted approach with a flow closer to what you might have in mind. It does not persist the data changes until much later (around resize confirmation) and only overrides the scheduling request temporarily. |
|
I have nothing in mind, just given the limited implementation in this PR am missing the rest of the picture. Hence asking questions for my understanding. |
Sanitize VMware-specific image properties directly on the canonical RequestSpec before scheduling, matching how request_spec.flavor is already handled in the cold migrate flow.
The sanitizer mutates request_spec.image.properties in place and returns a dict of original values. After task.execute() succeeds, the conductor persists this into
MigrationContext.old_image_properties (via instance.save()) before calling request_spec.save(). This ordering ensures the rollback copy is always available if request_spec has been rewritten.
Changes:
Change-Id: I4f7035358a9a7f46d942bfad07d748d1d333f8c5