A cell cannot be deleted once a host is added to the cell

Bug #1721179 reported by Takashi Natsume
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Takashi Natsume
Ocata
Fix Committed
Medium
Takashi Natsume
Pike
Fix Committed
Medium
Takashi Natsume

Bug Description

Description
===========

In cell v2 environment, once a host is added to a cell,
the cell cannot be deleted even though the cell does not have any hosts.

Steps to reproduce
==================

In cell v2 environment, a cell to delete has only one compute host.

1. Delete the nova-compute service

> nova service-delete db8e01f5-021d-4c87-a4eb-f3e5089e6105

The records are soft deleted in the 'services' table and the 'compute_nodes' table of the cell database.
But the record in 'host_mappings' table of api database is not deleted.

2. Delete the cell

> nova-manage cell_v2 delete_cell --cell_uuid 0fcd92ba-b257-4fbc-94d5-9ac6a77ccf81
There are existing hosts mapped to cell with uuid 0fcd92ba-b257-4fbc-94d5-9ac6a77ccf81.

The command fails with the message above.
It is caused because the host record remains in the 'host_mappings' table of api database.

But there is no ways to delete the host record in the 'host_mappings' table.

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

The cell can be deleted if the cell does not have any hosts.
Or we should have the way to delete the host from the cell.

Actual result
=============

The cell cannot be deleted even though the cell does not have any hosts.
(We don't have the way to delete the host from the cell.)

Environment
===========

OS: Ubuntu 16.04.2 LTS
nova master(commit 8ca24bf1ff80f39b14726aca22b5cf52603ea5a0)

Changed in nova:
status: New → In Progress
Matt Riedemann (mriedem)
Changed in nova:
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/510324

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

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

commit f4f17b364e28389f22bf9c6017dd7aef918c7104
Author: Takashi NATSUME <email address hidden>
Date: Sun Oct 8 00:55:50 2017 +0900

    Add 'delete_host' command in 'nova-manage cell_v2'

    Add 'delete_host' command in 'nova-manage cell_v2'.
    Add an optional 'force' option in 'nova-manage cell_v2 delete_cell'.
    If specifying the 'force' option, a cell can be deleted
    even if the cell has hosts.

    Change-Id: I8cd7826c2c03687c6b85731519778f09d542b236
    Closes-Bug: #1721179

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/513717

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

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/513721

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

This issue was fixed in the openstack/nova 17.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/513717
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=868ef987625d6867dc0e315af6245776fa2da18a
Submitter: Zuul
Branch: stable/pike

commit 868ef987625d6867dc0e315af6245776fa2da18a
Author: Takashi NATSUME <email address hidden>
Date: Sun Oct 8 00:55:50 2017 +0900

    Add 'delete_host' command in 'nova-manage cell_v2'

    Add 'delete_host' command in 'nova-manage cell_v2'.
    Add an optional 'force' option in 'nova-manage cell_v2 delete_cell'.
    If specifying the 'force' option, a cell can be deleted
    even if the cell has hosts.

    The 'features' description is changed to the 'fixes'
    in the release note.

    Conflicts:
            doc/source/cli/nova-manage.rst

    Change-Id: I8cd7826c2c03687c6b85731519778f09d542b236
    Closes-Bug: #1721179
    (cherry-picked from commit f4f17b364e28389f22bf9c6017dd7aef918c7104)

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.

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

Reviewed: https://review.openstack.org/513721
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d34222286b2a215744d225b24d1548f93bc8515a
Submitter: Zuul
Branch: stable/ocata

commit d34222286b2a215744d225b24d1548f93bc8515a
Author: Takashi NATSUME <email address hidden>
Date: Sun Oct 8 00:55:50 2017 +0900

    Add 'delete_host' command in 'nova-manage cell_v2'

    Add 'delete_host' command in 'nova-manage cell_v2'.
    Add an optional 'force' option in 'nova-manage cell_v2 delete_cell'.
    If specifying the 'force' option, a cell can be deleted
    even if the cell has hosts.

    The 'features' description is changed to the 'fixes'
    in the release note.

    Conflicts:
            doc/source/cli/nova-manage.rst

    Change-Id: I8cd7826c2c03687c6b85731519778f09d542b236
    Closes-Bug: #1721179
    (cherry-picked from commit f4f17b364e28389f22bf9c6017dd7aef918c7104)
    (cherry-picked from commit 868ef987625d6867dc0e315af6245776fa2da18a)

Revision history for this message
John Smith (wang-zengzhi) wrote :

The commit provide a command to delete host in "host_mapping" table. And does not seem to solve the problem completely.
For first case:

1. Delete the nova-compute service

> nova service-delete db8e01f5-021d-4c87-a4eb-f3e5089e6105

The record in 'host_mappings' table still exists. Why not delete this record after service-delete a nova-compute service?

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

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