Cell_v2 discover_hosts Not Working, after deleted a host from a cell

Bug #1735719 reported by keerthivasan selvaraj
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Dan Smith
Pike
Fix Committed
Undecided
Matt Riedemann

Bug Description

!!!!!!!!!!!!!!!!!!!!!!!!! READ THIS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Description
===========
Mulit-cell Cell_v2 'discover_hosts' is not working after executing 'delete_host' operation to remove a specific host from the cell.

Steps to reproduce
==================
*Consider I am having nova-compute service running on host 'compute3'
*nova-manage cell_v2 delete_host --cell_uuid d9a559a8-7d16-4e7c-8db2-82f28199509e --host compute3 (as per this https://review.openstack.org/513717 )
*Host entry was removed from host_mappings table
*Still service is up and Running on the local cell DB.
*I am trying to execute 'nova-manage cell_v2 discover_hosts --verbose'
*No host entry was created and got `Found 0 unmapped computes in cell: d9a559a8-7d16-4e7c-8db2-82f28199509e` message.

Expected result
===============

It should add the host that is not mapped to the cell.

Actual result
=============
nova-manage cell_v2 discover_hosts --verbose
Getting compute nodes from cell 'cell2': d9a559a8-7d16-4e7c-8db2-82f28199509e
Found 0 unmapped computes in cell: d9a559a8-7d16-4e7c-8db2-82f28199509e
Host is not added to the cell.

Environment
===========
Devstack(stable/pike) using nova-manage 16.0.3

Revision history for this message
Matt Riedemann (mriedem) wrote :

This is because the compute node for that host in that cell is not deleted and since it was mapped once, it is marked as 'mapped' again, so the discover_hosts routine ignores it, for performance / efficiency reasons.

This likely means that the delete_host CLI is not checking to see that the actual compute node is gone from the cell before deleting the host mapping, or if it will delete the host mapping, it should mark the compute node as mapped=0 so it can be discovered again.

Changed in nova:
status: New → Triaged
importance: Undecided → Medium
Matt Riedemann (mriedem)
tags: added: cells nova-manage
Changed in nova:
assignee: nobody → Surya Seetharaman (tssurya)
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/524641

Changed in nova:
assignee: Surya Seetharaman (tssurya) → Dan Smith (danms)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 8ad36d15e404bf0dce90bed57f8aa91a350ed341
Author: Dan Smith <email address hidden>
Date: Fri Dec 1 07:20:34 2017 -0800

    Unmap compute nodes when deleting host mapping

    When we delete a host mapping in the api database, we need to mark
    the compute node record as unmapped. Otherwise we can never re-discover
    it if added back.

    Change-Id: I9348827c5fd0364727e49cb8fae786cb2a29472a
    Closes-Bug: #1735719

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

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

This issue was fixed in the openstack/nova 17.0.0.0b3 development milestone.

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

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

commit f0525e8f15fc29f99ccb1a3fcf8de09d5e827015
Author: Dan Smith <email address hidden>
Date: Fri Dec 1 07:20:34 2017 -0800

    Unmap compute nodes when deleting host mapping

    When we delete a host mapping in the api database, we need to mark
    the compute node record as unmapped. Otherwise we can never re-discover
    it if added back.

    Change-Id: I9348827c5fd0364727e49cb8fae786cb2a29472a
    Closes-Bug: #1735719
    (cherry picked from commit 8ad36d15e404bf0dce90bed57f8aa91a350ed341)

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

This issue was fixed in the openstack/nova 16.1.0 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.