we shouldn't persist the retried failed host in db when migrating an instance

Bug #1794252 reported by Tao Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Incomplete
Undecided
Tao Li

Bug Description

Description
===========
We set CONF.allow_resize_to_same_host to True in nova.conf. Then I migrated an instance, unfortunately nova scheduler selects the host which the instance locates in. The pre_resize will raised the UnableToMigrateToSelf exception because of the restriction of libvirt driver. Then nova scheduler will select another host to migrate, after migrating successfully, the retried host will be saved in database. From then on, the instance cann't migrate to the host any more, because the nova scheduler will check the retried hosts and bypassed them. I check the latest code, there is still this problem.

Steps to reproduce
==================
Two compute nodes and set CONF.allow_resize_to_same_host to True in nova.conf on controller node
* Create an instance
* Migrate the instance and ensure the first selected host is the host which the instance in.
* After migrate successfully, then migrate again.

Expected result
===============
The instance will migrate to the first host.

Actual result
=============
The instance migrated failed.

Environment
===========
1. Openstack Pike version.

[root@cdpm01 ~]# nova --version
9.1.1

2. libvirt driver.

Logs & Configs
==============

Tao Li (eric-litao)
Changed in nova:
assignee: nobody → Tao Li (eric-litao)
description: updated
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
Revision history for this message
melanie witt (melwitt) wrote :

We had a commit in the past "Don't persist RequestSpec.retry" [1] which was supposed to take care of avoiding the persist of retry information to the database. The patch was backported to Queens, Pike, and Ocata.

What version of the nova server code are you running where you see this issue? The fix is available beginning in Pike version 16.1.2.

[1] https://github.com/openstack/nova/commit/6647f11dc1aba89f9b0e2703f236a43f31d88079

Changed in nova:
status: In Progress → Incomplete
Revision history for this message
Tao Li (eric-litao) wrote :

Hi melanie, we use version 9.1.1 of nova.

[root@cdpm05 ~]# nova --version
9.1.1

Maybe this version is old and I should banckport your commit.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: master
Review: https://review.opendev.org/605011
Reason: Already fixed with Iadbf8ec935565a6d4ccf6f36ef630ab6bf1bea5d.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.