External LB deployments are broken

Bug #1641904 reported by Michele Baldessari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Critical
Michele Baldessari

Bug Description

Marius Cornea via https://bugzilla.redhat.com/show_bug.cgi?id=1395124 reports failure in the deployment when using external LB:

2016-11-15 02:35:28Z [overcloud.AllNodesDeploySteps]: CREATE_FAILED Error: resources.AllNodesDeploySteps.resources.ControllerPostPuppet.resources.ControllerPostPuppetRestart.resources.ControllerPostPuppetRestartDeployment.resources[0]: Deployment to server failed: deploy_status_code: Deployment exited with non-zero status
2016-11-15 02:35:28Z [overcloud]: CREATE_FAILED Resource CREATE failed: Error: resources.AllNodesDeploySteps.resources.ControllerPostPuppet.resources.ControllerPostPuppetRestart.resources.ControllerPostPuppetRestartDeployment.resources[0]: Deployment to server failed: deploy_status_code: Deployment exi

 Stack overcloud CREATE_FAILED

openstack software deployment output show 4f339ca4-7600-4ca0-b0ef-f798bc47b6cf --all
output_values:

  deploy_stdout: |

  deploy_stderr: |
    + RESTART_FOLDER=/var/lib/tripleo/pacemaker-restarts
    + [[ -d /var/lib/tripleo/pacemaker-restarts ]]
    ++ systemctl is-active haproxy
    + haproxy_status=unknown
  deploy_status_code: 3
openstack software deployment show 4f339ca4-7600-4ca0-b0ef-f798bc47b6cf

openstack-tripleo-heat-templates.noarch 0:5.0.0-1.7.el7ost

The regression is due to:
https://review.openstack.org/#/c/393644/

This change has:

haproxy_status=$(systemctl is-active haproxy)
if [ "$haproxy_status" = "active" ]; then
    systemctl reload haproxy
fi

But with external LB haproxy is not installed/running and systemctl is-active haproxy return error 3

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

Fix proposed to branch: master
Review: https://review.openstack.org/397658

Changed in tripleo:
assignee: nobody → Michele Baldessari (michele)
status: Triaged → In Progress
Changed in tripleo:
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/397658
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=bb3c742e36ac86ed41a7705aec05adbaf62098f6
Submitter: Jenkins
Branch: master

commit bb3c742e36ac86ed41a7705aec05adbaf62098f6
Author: Michele Baldessari <email address hidden>
Date: Tue Nov 15 11:25:38 2016 +0100

    Fix external Load Balancer deployment

    Deployments using external LB will file like this:
      deploy_stderr: |
        + RESTART_FOLDER=/var/lib/tripleo/pacemaker-restarts
        + [[ -d /var/lib/tripleo/pacemaker-restarts ]]
        ++ systemctl is-active haproxy
        + haproxy_status=unknown
      deploy_status_code: 3
    openstack software deployment show 4f339ca4-7600-4ca0-b0ef-f798bc47b6cf

    The reason is that via https://review.openstack.org/#/c/393644/ we
    introducted the haproxy restart like this:
    haproxy_status=$(systemctl is-active haproxy)
    if [ "$haproxy_status" = "active" ]; then
        systemctl reload haproxy
    fi

    The problem is that if haproxy is not running/installed systemctl
    is-active can fail and the script will terminate with an error return
    code. Let's just move the call inside the if so the script does not fail
    in case haproxy is not there.

    The snippet before the change (on a system without haproxy installed):
    [root@mrg-09 tmp]# ./test.sh
    ++ systemctl is-active haproxy
    + haproxy_status=unknown
    [root@mrg-09 tmp]# echo $?
    3

    After this change:
    [root@mrg-09 tmp]# ./test.sh
    ++ systemctl is-active haproxy
    + '[' unknown = active ']'
    [root@mrg-09 tmp]# echo $?
    0

    Change-Id: I837c63a9dbcde8c922f843c442974fa79cf1eede
    Closes-Bug: #1641904

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/398040

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/newton)

Reviewed: https://review.openstack.org/398040
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=1db6d09074db64b2cdf511bd06eb9274d5344418
Submitter: Jenkins
Branch: stable/newton

commit 1db6d09074db64b2cdf511bd06eb9274d5344418
Author: Michele Baldessari <email address hidden>
Date: Tue Nov 15 11:25:38 2016 +0100

    Fix external Load Balancer deployment

    Deployments using external LB will file like this:
      deploy_stderr: |
        + RESTART_FOLDER=/var/lib/tripleo/pacemaker-restarts
        + [[ -d /var/lib/tripleo/pacemaker-restarts ]]
        ++ systemctl is-active haproxy
        + haproxy_status=unknown
      deploy_status_code: 3
    openstack software deployment show 4f339ca4-7600-4ca0-b0ef-f798bc47b6cf

    The reason is that via https://review.openstack.org/#/c/393644/ we
    introducted the haproxy restart like this:
    haproxy_status=$(systemctl is-active haproxy)
    if [ "$haproxy_status" = "active" ]; then
        systemctl reload haproxy
    fi

    The problem is that if haproxy is not running/installed systemctl
    is-active can fail and the script will terminate with an error return
    code. Let's just move the call inside the if so the script does not fail
    in case haproxy is not there.

    The snippet before the change (on a system without haproxy installed):
    [root@mrg-09 tmp]# ./test.sh
    ++ systemctl is-active haproxy
    + haproxy_status=unknown
    [root@mrg-09 tmp]# echo $?
    3

    After this change:
    [root@mrg-09 tmp]# ./test.sh
    ++ systemctl is-active haproxy
    + '[' unknown = active ']'
    [root@mrg-09 tmp]# echo $?
    0

    Change-Id: I837c63a9dbcde8c922f843c442974fa79cf1eede
    Closes-Bug: #1641904
    (cherry picked from commit bb3c742e36ac86ed41a7705aec05adbaf62098f6)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 6.0.0.0b1

This issue was fixed in the openstack/tripleo-heat-templates 6.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 5.2.0

This issue was fixed in the openstack/tripleo-heat-templates 5.2.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.