Reviewed: https://review.openstack.org/636271 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=67d5970445818f2f245cf1b6d9d46c36fb220f04 Submitter: Zuul Branch: master
commit 67d5970445818f2f245cf1b6d9d46c36fb220f04 Author: Takashi Natsume <[email protected]> Date: Tue Feb 12 11:46:57 2019 +0900 Fix resetting non-persistent fields when saving obj The 'requested_destination', 'network_metadata', 'retry' fields in the RequestSpec object are reset when saving the object currently. When cold migrating a server, the API sets the requested_destination so conductor will pass that information to the scheduler to restrict the cold migration to that host. But the 'heal_reqspec_is_bfv' method called from the conductor makes an update to the RequestSpec which resets the requested_destination so the server could end up being cold migrated to some other host than the one that was requested by the API user. So make them not be reset when saving the object. Change-Id: I2131558f0edfe603ee1e8d8bae66a3caf5182a58 Closes-Bug: #1815153 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1815153 Title: Requested host during cold migrate is ignored if server created before Rocky Status in OpenStack Compute (nova): Fix Released Status in OpenStack Compute (nova) rocky series: Triaged Bug description: I stumbled across this during a failing functional test: https://review.openstack.org/#/c/635668/2/nova/conductor/tasks/migrate.py@263 In Rocky, new RequestSpec objects have the is_bfv field set, but change https://review.openstack.org/#/c/583715/ was added to 'heal' old RequestSpecs when servers created before Rocky are migrated (cold migrate, live migrate, unshelve and evacuate). The problem is change https://review.openstack.org/#/c/610098/ made the RequestSpec.save() operation stop persisting the requested_destination field, which means when heal_reqspec_is_bfv saves the is_bfv change to the RequestSpec, the requested_destination is lost and the user-specified target host is not honored (this would impact all move APIs that target a target host, so cold migrate, live migrate and evacuate). The simple way to fix it is by not overwriting the set requested_destination field during save (don't persist it in the database, but don't reset it to None in the object in memory): https://review.openstack.org/#/c/635668/2/nova/objects/request_spec.py@517 This could also be a problem for the 'network_metadata' field added in Rocky: https://review.openstack.org/#/c/564442/ To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1815153/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

