Reviewed: https://review.opendev.org/662683 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8f78dc68d99182079ba44f2725ad27ff0078afb1 Submitter: Zuul Branch: master
commit 8f78dc68d99182079ba44f2725ad27ff0078afb1 Author: Takashi NATSUME <[email protected]> Date: Mon Jun 3 14:52:22 2019 +0900 Avoid lazy-loading instance.flavor in cold migration The instance.flavor is lazy-loaded currently in the resize method in nova/compute/api.py. Set expected_attrs=['flavor'] at the common.get_instance in the _migrate method in nova/api/openstack/compute/migrate_server.py to avid lazy-loading instance.flavor. Change-Id: Iba3b7c3e027ec78395a102c1fed46fa7a2ffa7be Closes-Bug: #1829877 ** 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/1829877 Title: avoid lazy-loading instance.flavor during cold migration Status in OpenStack Compute (nova): Fix Released Bug description: During a cold migration the compute API resize() method checks the instance.flavor: https://github.com/openstack/nova/blob/53d42de9d970abc290064ab86df272b4d933abc9/nova/compute/api.py#L3587 But this results in a query to the DB: May 16 19:46:21.368204 ubuntu-bionic-rax-dfw-0006201125 [email protected][19505]: DEBUG nova.objects.instance [None req-bde576dc-5de2-4113-982d-025c65b97e8d tempest-MigrationsAdminTest-391674513 tempest-MigrationsAdminTest-391674513] Lazy-loading 'flavor' on Instance uuid 21c45b79-b0f4-48a8-8949-9f480beb5864 {{(pid=19507) obj_load_attr /opt/stack/nova/nova/objects/instance.py:1106}} May 16 19:46:21.410776 ubuntu-bionic-rax-dfw-0006201125 [email protected][19505]: DEBUG nova.compute.api [None req-bde576dc-5de2-4113-982d-025c65b97e8d tempest-MigrationsAdminTest-391674513 tempest-MigrationsAdminTest-391674513] [instance: 21c45b79-b0f4-48a8-8949-9f480beb5864] flavor_id is None. Assuming migration. {{(pid=19507) resize /opt/stack/nova/nova/compute/api.py:3700}} This could be avoided if we join the flavor when we fetch the instance from the DB initially: https://github.com/openstack/nova/blob/53d42de9d970abc290064ab86df272b4d933abc9/nova/api/openstack/compute/migrate_server.py#L55 By passing expected_attrs=['flavor'] to common.get_instance. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1829877/+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

