kolla-ansible stop ignores service placement, which may cause it to fail

Bug #1868596 reported by Mark Goddard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Medium
Mark Goddard
Stein
Triaged
Medium
Unassigned
Train
Fix Released
Medium
Mark Goddard
Ussuri
Fix Released
Medium
Mark Goddard

Bug Description

The 'kolla-ansible stop' command can be used to stop the services running on hosts. However, if you run this command in an environment with heterogeneous nodes (most real world scenarios have at least control/compute), then it fails. This is because it only checks whether a container is enabled, and not whether the host is in the correct group. For example, it fails with nova-libvirt:

No such container: nova_libvirt to stop.

Mark Goddard (mgoddard)
Changed in kolla-ansible:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)

Fix proposed to branch: master
Review: https://review.opendev.org/714496

Changed in kolla-ansible:
assignee: nobody → Mark Goddard (mgoddard)
status: Triaged → In Progress
Mark Goddard (mgoddard)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/714496
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=89df07e8efda2a284ce357ddd91011e9fc4c5060
Submitter: Zuul
Branch: master

commit 89df07e8efda2a284ce357ddd91011e9fc4c5060
Author: Mark Goddard <email address hidden>
Date: Mon Mar 23 17:18:56 2020 +0000

    Fix kolla-ansible stop with heterogeneous hosts

    The 'kolla-ansible stop' command can be used to stop the services
    running on hosts. However, if you run this command in an environment
    with heterogeneous nodes (most real world scenarios have at least
    control/compute), then it fails. This is because it only checks
    whether a container is enabled, and not whether the host is in the
    correct group. For example, it fails with nova-libvirt:

        No such container: nova_libvirt to stop.

    This change fixes the issue by only attempting to stop containers on
    hosts to which they are mapped.

    Change-Id: Ibecac60d1417269bbe25a280996ca9de6e6d018f
    Closes-Bug: #1868596

Changed in kolla-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/714976

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to kolla-ansible (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/719954

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/719954
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=8cc58e3669eec69f55269c54fc1de2a0b0c57c02
Submitter: Zuul
Branch: master

commit 8cc58e3669eec69f55269c54fc1de2a0b0c57c02
Author: Mark Goddard <email address hidden>
Date: Tue Apr 14 14:11:14 2020 +0100

    Fix service_mapped_to_host filter for common services

    In Ibecac60d1417269bbe25a280996ca9de6e6d018f, the services in the common
    role were marked as being mapped to the 'all' group, since the
    'service_mapped_to_host' filter expects every service definition to have
    either a 'group' or 'host_in_groups' field. While this allows the filter
    to pass the common services without error, it will not actually show
    them as being mapped to any hosts. This is because the filter uses the
    'group_names' variable, which contains all of the groups that a host
    belongs to, except the default 'all' group.

    This change fixes the issue by returning True from
    service_mapped_to_host when the service's group is 'all'.

    Change-Id: I39c8416f5d30a535c1743f9c43434b7d2a382196
    Related-Bug: #1868596

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to kolla-ansible (stable/train)

Related fix proposed to branch: stable/train
Review: https://review.opendev.org/720669

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to kolla-ansible (stable/train)

Reviewed: https://review.opendev.org/720669
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=3057c7d33c91b91b1dca95e6fe896b328ea44c41
Submitter: Zuul
Branch: stable/train

commit 3057c7d33c91b91b1dca95e6fe896b328ea44c41
Author: Mark Goddard <email address hidden>
Date: Tue Apr 14 14:11:14 2020 +0100

    Fix service_mapped_to_host filter for common services

    In Ibecac60d1417269bbe25a280996ca9de6e6d018f, the services in the common
    role were marked as being mapped to the 'all' group, since the
    'service_mapped_to_host' filter expects every service definition to have
    either a 'group' or 'host_in_groups' field. While this allows the filter
    to pass the common services without error, it will not actually show
    them as being mapped to any hosts. This is because the filter uses the
    'group_names' variable, which contains all of the groups that a host
    belongs to, except the default 'all' group.

    This change fixes the issue by returning True from
    service_mapped_to_host when the service's group is 'all'.

    Change-Id: I39c8416f5d30a535c1743f9c43434b7d2a382196
    Related-Bug: #1868596
    (cherry picked from commit 8cc58e3669eec69f55269c54fc1de2a0b0c57c02)

tags: added: in-stable-train
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.