CONF.allow_migrate_to_same_host doesn't work

Bug #1364851 reported by zhangtralon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
zhangtralon

Bug Description

there are such codes in the “resize” function from nova/compute/api.py

 if not CONF.allow_resize_to_same_host:
            filter_properties['ignore_hosts'].append(instance['host'])
 # Here when flavor_id is None, the process is considered as migrate.

if (not flavor_id and not CONF.allow_migrate_to_same_host):
          filter_properties['ignore_hosts'].append(instance['host'])

When running the "migrate" operation and the CONF.allow_resize_to_same_host is set as "false",the CONF.allow_migrate_to_same_host will not work
At the same time, I find the CONF.allow_migrate_to_same_host isn't checked in the _prep_resize function from nova/compute/manager.py.
the code part is as follows:

same_host = instance['host'] == self.host
    if same_host and not CONF.allow_resize_to_same_host:
         self._set_instance_error_state(context, instance)
         msg = _('destination same as source!')
         raise exception.MigrationError(msg)

So, I think that using two configuration items here can occur conflict, maybe we can
take out a configuration item!

Changed in nova:
assignee: nobody → zhangtralon (zhangchunlong1)
summary: - CONF.allow_migrate_to_same_host is no work
+ CONF.allow_migrate_to_same_host doesn't work
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/118604

Changed in nova:
status: New → In Progress
description: updated
description: updated
description: updated
Sean Dague (sdague)
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/118604
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9b224641295af3763d011816d6399565ac7b98de
Submitter: Jenkins
Branch: master

commit 9b224641295af3763d011816d6399565ac7b98de
Author: <email address hidden> <email address hidden>
Date: Wed Sep 3 19:12:16 2014 +0800

    remove the CONF.allow_migrate_to_same_host

    When running the "migrate" operation and the
    CONF.allow_resize_to_same_host is set as "false",
    the CONF.allow_migrate_to_same_host doesn't work
    in the function 'resize' from nova/compute/api.py.
    At the same time, there is no checking the
    CONF.allow_migrate_to_same_host in the function
    _prep_resize from nova/compute/manager.py

    DocImpact: remove the CONF.allow_migrate_to_same_host
    Change-Id: I4c54c7c6e0e5e37cc46c52350ba4ce2047325ef9
    Closes-Bug: #1364851

Changed in nova:
status: In Progress → Fix Committed
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/189798

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/189798
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8895dca4588f8a196b7a7ee8d33dc117f73249ed
Submitter: Jenkins
Branch: master

commit 8895dca4588f8a196b7a7ee8d33dc117f73249ed
Author: Alessandro Pilotti <email address hidden>
Date: Tue Jun 9 19:04:39 2015 +0300

    Hyper-V: sets supports_migrate_to_same_host capability

    Commit 9b224641295af3763d011816d6399565ac7b98de removed
    CONF.allow_migrate_to_same_host and introduced the
    supports_migrate_to_same_host capability in compute drivers.

    This commit adds the capability to the Hyper-V driver.

    Change-Id: Iadfe3a3870235705af458bb2d35d0569ba212291
    Partial-Bug: #1364851

Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-1 → 12.0.0
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.