Host is not unmapped when the host_mapping is deleted during delete_cell operation

Bug #1747936 reported by Surya Seetharaman
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Surya Seetharaman
Pike
Fix Committed
Medium
Surya Seetharaman
Queens
Fix Committed
Medium
Surya Seetharaman

Bug Description

Presently when a host_mapping is deleted during the nova-manage cell_v2 deleted_cell operation, the compute node record still remains with its mapped field set to 1. Due to this, if we delete a cell, and later create a new cell, the discover_hosts command will not work and the compute node will not get mapped to the new cell.

Solution:

Before the host is deleted during the delete_cell operation, the mapped field in compute_nodes table should be set to 0.

This bug is similar to this one : https://bugs.launchpad.net/nova/+bug/1735719, hence what was done for the delete_host command should be done for the delete_cell command as well.

Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
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/542964

Changed in nova:
status: Confirmed → In Progress
Changed in nova:
assignee: Surya Seetharaman (tssurya) → Matt Riedemann (mriedem)
Matt Riedemann (mriedem)
Changed in nova:
assignee: Matt Riedemann (mriedem) → Surya Seetharaman (tssurya)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/553496

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/553829

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

Reviewed: https://review.openstack.org/542964
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=dc2d15129d1a86a841e3dc1ccab250c30d34c540
Submitter: Zuul
Branch: master

commit dc2d15129d1a86a841e3dc1ccab250c30d34c540
Author: Surya Seetharaman <email address hidden>
Date: Fri Feb 9 18:54:05 2018 +0100

    Unmap compute nodes when deleting host mappings in delete cell operation

    Presently when a host_mapping is deleted during the nova-manage cell_v2
    delete_cell operation, the compute node record still remains with its
    mapped field set to 1. Due to this, if we delete a cell, and later
    create a new cell, the discover_hosts command will not work and the
    compute node will not get mapped to the new cell. This patch fixes this
    issue by setting it back to 0.

    Change-Id: Iaf13f11bcd0bb25f673fc28f252cb9391409b9b5
    Closes-Bug: #1747936

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/queens)

Reviewed: https://review.openstack.org/553496
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6401d1e3c8966f5c9b9106d2e3918c766ce8b48a
Submitter: Zuul
Branch: stable/queens

commit 6401d1e3c8966f5c9b9106d2e3918c766ce8b48a
Author: Surya Seetharaman <email address hidden>
Date: Fri Feb 9 18:54:05 2018 +0100

    Unmap compute nodes when deleting host mappings in delete cell operation

    Presently when a host_mapping is deleted during the nova-manage cell_v2
    delete_cell operation, the compute node record still remains with its
    mapped field set to 1. Due to this, if we delete a cell, and later
    create a new cell, the discover_hosts command will not work and the
    compute node will not get mapped to the new cell. This patch fixes this
    issue by setting it back to 0.

    Conflicts:
        nova/tests/unit/test_nova_manage.py

    NOTE(tssurya): The conflict is due to not having the change
    Ibefa0465224bec9a22431c7d3b5c8f5d91fc7732 in Queens.

    Change-Id: Iaf13f11bcd0bb25f673fc28f252cb9391409b9b5
    Closes-Bug: #1747936
    (cherry picked from commit dc2d15129d1a86a841e3dc1ccab250c30d34c540)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.2

This issue was fixed in the openstack/nova 17.0.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 18.0.0.0b1

This issue was fixed in the openstack/nova 18.0.0.0b1 development milestone.

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

Reviewed: https://review.openstack.org/553829
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=68a21ec1d88b523e2583dcda8e948e753b9f9cbb
Submitter: Zuul
Branch: stable/pike

commit 68a21ec1d88b523e2583dcda8e948e753b9f9cbb
Author: Surya Seetharaman <email address hidden>
Date: Fri Feb 9 18:54:05 2018 +0100

    Unmap compute nodes when deleting host mappings in delete cell operation

    Presently when a host_mapping is deleted during the nova-manage cell_v2
    delete_cell operation, the compute node record still remains with its
    mapped field set to 1. Due to this, if we delete a cell, and later
    create a new cell, the discover_hosts command will not work and the
    compute node will not get mapped to the new cell. This patch fixes this
    issue by setting it back to 0.

    Conflicts:
        nova/tests/unit/test_nova_manage.py

    NOTE(tssurya): The conflict is due to not having the change
    Ibefa0465224bec9a22431c7d3b5c8f5d91fc7732 in Queens and Pike.

    Also note that since HostMappingList.get_all() function is not
    there in Pike, the functional test uses HostMapping.get_by_host()
    instead.

    Change-Id: Iaf13f11bcd0bb25f673fc28f252cb9391409b9b5
    Closes-Bug: #1747936
    (cherry picked from commit dc2d15129d1a86a841e3dc1ccab250c30d34c540)
    (cherry picked from commit 6401d1e3c8966f5c9b9106d2e3918c766ce8b48a)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.1.3

This issue was fixed in the openstack/nova 16.1.3 release.

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.