Cannot remove host from aggregate if host has been deleted

Bug #1470341 reported by Qin Zhao
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Danil Akhmetov

Bug Description

Kilo code

Reproduce steps:

1. Assuming that we have one nova-compute node named 'icm' which is added into one aggregate named 'zhaoqin'

[root@icm ~]# nova aggregate-details zhaoqin
+----+---------+-------------------+-------+--------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+---------+-------------------+-------+--------------------------------+
| 1 | zhaoqin | zhaoqin-az | 'icm' | 'availability_zone=zhaoqin-az' |
+----+---------+-------------------+-------+--------------------------------+
[root@icm ~]# nova service-list
+----+------------------+------+------------+---------+-------+----------------------------+-----------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+----+------------------+------+------------+---------+-------+----------------------------+-----------------+
| 1 | nova-conductor | icm | internal | enabled | up | 2015-06-30T14:04:25.828383 | - |
| 3 | nova-scheduler | icm | internal | enabled | up | 2015-06-30T14:04:24.525474 | - |
| 4 | nova-consoleauth | icm | internal | enabled | up | 2015-06-30T14:04:24.640657 | - |
| 5 | nova-compute | icm | zhaoqin-az | enabled | up | 2015-06-30T14:04:19.865857 | - |
| 6 | nova-cert | icm | internal | enabled | up | 2015-06-30T14:04:25.080046 | - |
+----+------------------+------+------------+---------+-------+----------------------------+-----------------+

2. Remove the nova-compute using service-delete command. However, the host is still in aggregate.

[root@icm ~]# nova service-delete 5
[root@icm ~]# nova service-list
+----+------------------+------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+----+------------------+------+----------+---------+-------+----------------------------+-----------------+
| 1 | nova-conductor | icm | internal | enabled | up | 2015-06-30T14:05:35.826699 | - |
| 3 | nova-scheduler | icm | internal | enabled | up | 2015-06-30T14:05:34.524507 | - |
| 4 | nova-consoleauth | icm | internal | enabled | up | 2015-06-30T14:05:34.638234 | - |
| 6 | nova-cert | icm | internal | enabled | up | 2015-06-30T14:05:35.092009 | - |
+----+------------------+------+----------+---------+-------+----------------------------+-----------------+
[root@icm ~]# nova aggregate-details zhaoqin
+----+---------+-------------------+-------+--------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+---------+-------------------+-------+--------------------------------+
| 1 | zhaoqin | zhaoqin-az | 'icm' | 'availability_zone=zhaoqin-az' |
+----+---------+-------------------+-------+--------------------------------+

3. Then, attempt to remove the host from aggregate, but fails. And we can not remove this aggregate either, because it is not empty.

[root@icm ~]# nova aggregate-remove-host zhaoqin icm
ERROR (NotFound): Cannot remove host icm in aggregate 1: not found (HTTP 404) (Request-ID: req-b5024dbf-156a-44ee-b48e-fc53a331e05d)
[root@icm ~]# nova aggregate-delete zhaoqin
ERROR (BadRequest): Cannot remove host from aggregate 1. Reason: Host aggregate is not empty. (HTTP 400) (Request-ID: req-a3c5346c-9a96-49f4-a76d-a7baa768a0ef)

Changed in nova:
assignee: nobody → Qin Zhao (zhaoqin)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova-specs (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/262165

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

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/262165
Reason: As mentioned, I am abandoning this spec to clear out the review queue ready for Newton. That said, feel free to restore this change with an updated version when you're ready to proceed.

Changed in nova:
assignee: Qin Zhao (zhaoqin) → nobody
status: In Progress → Confirmed
Ryan Evans (rmevans88)
Changed in nova:
assignee: nobody → Ryan Evans (rmevans88)
Ryan Evans (rmevans88)
Changed in nova:
assignee: Ryan Evans (rmevans88) → nobody
Danil Akhmetov (dinobot)
Changed in nova:
assignee: nobody → Danil Akhmetov (dinobot)
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/306192

Changed in nova:
status: Confirmed → In Progress
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/306192
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1abac25fd2967be00c4d584c06ba15ca4e8d04cc
Submitter: Jenkins
Branch: master

commit 1abac25fd2967be00c4d584c06ba15ca4e8d04cc
Author: Danil Akhmetov <email address hidden>
Date: Fri Apr 29 11:45:28 2016 +0300

    Remove compute host from all host aggregates when compute service is deleted

    Nova currently does not check if compute host included in host-aggregates
    when user deletes compute service. It leads to inconsistency in nova host
    aggregates, impossibility to remove compute host from host-aggregate or
    remove host aggregate with invalid compute host.

    Change-Id: I8034da3827e47f3cd575e1f6ddf0e4be2f7dfecd
    Closes-Bug: #1470341

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/197648
Reason: This code hasn't been updated in a long time, and is in merge conflict. I am going to abandon this review, but feel free to restore it if you're still working on this.

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

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

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.