In Newton, while replacing controller node with ID 0 : StackValidationFailed: resources.AllNodesValidationConfig: Property error: AllNodesValidationConfig.Properties.PingTestIps: The Referenced Attribute (Controller resource.0.external_ip_address) is incorrect.

Bug #1673439 reported by Luca Lorenzetto
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Luca Lorenzetto

Bug Description

While replacing the controller node with id 0 stack validation fails with error:

StackValidationFailed: resources.AllNodesValidationConfig: Property error: AllNodesValidationConfig.Properties.PingTestIps: The Referenced Attribute (Controller resource.0.external_ip_address) is incorrect.

This because in overcloud.j2.yaml there is this explicit reference to node 0:

https://github.com/openstack/tripleo-heat-templates/blob/stable/newton/overcloud.j2.yaml#L500

Same reference is done also in Ocata, so i suppose also this release is affected (not tested). Maybe the node uses for validation should be selected looking at existing nodes.

In my case node 0 is no more existing since is object of replacement, so using 1 could be a good option. I suppose then that since node 0 will no more exist, all future validations will fail.

In RH documentation, up to Mitaka there were an indication saying that replace resource.0 with a valid ID was required.

https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/9/html/director_installation_and_usage/sect-scaling_the_overcloud#sect-Replacing_Controller_Nodes-Node_Replacement

Revision history for this message
Luca Lorenzetto (lorenzetto-luca) wrote :

At the moment replaced resource.0 with resource.3, since is a valid node that will persist.

Revision history for this message
Steven Hardy (shardy) wrote :

I think this is because of this hard-coded reference here:

https://github.com/openstack/tripleo-heat-templates/blob/stable/newton/overcloud.j2.yaml#L506

Probably we should do this similar to:

https://github.com/openstack/tripleo-heat-templates/blob/master/overcloud.j2.yaml#L299

Which does a yaql lookup to get the first item in the list not the node named "0"

Changed in tripleo:
milestone: none → pike-1
status: New → Confirmed
importance: Undecided → High
tags: added: newton-backport-potential ocata-backport-potential
Revision history for this message
Steven Hardy (shardy) wrote :

To clarify we need a change like:

  # All Nodes Validations
  AllNodesValidationConfig:
    type: OS::TripleO::AllNodes::Validation
    properties:
      PingTestIps:
        list_join:
        - ' '
        - - {get_attr: [{{primary_role_name}}, resource.0.external_ip_address]}
          - {get_attr: [{{primary_role_name}}, resource.0.internal_api_ip_address]}
          - {get_attr: [{{primary_role_name}}, resource.0.storage_ip_address]}
          - {get_attr: [{{primary_role_name}}, resource.0.storage_mgmt_ip_address]}
          - {get_attr: [{{primary_role_name}}, resource.0.tenant_ip_address]}
          - {get_attr: [{{primary_role_name}}, resource.0.management_ip_address]}

Should be:
  # All Nodes Validations
  AllNodesValidationConfig:
    type: OS::TripleO::AllNodes::Validation
    properties:
      PingTestIps:
        list_join:
        - ' '
        - - yaql:
              expression: coalesce($.data, []).first(null)
              data: {get_attr: [{{primary_role_name}}, external_ip_address]}
          - yaql:
              expression: coalesce($.data, []).first(null)
              data: {get_attr: [{{primary_role_name}}, internal_api_ip_address]}
          - yaql:
              expression: coalesce($.data, []).first(null)
              data: {get_attr: [{{primary_role_name}}, storage_ip_address]}
          - yaql:
              expression: coalesce($.data, []).first(null)
              data: {get_attr: [{{primary_role_name}}, storage_mgmt_ip_address]}
          - yaql:
              expression: coalesce($.data, []).first(null)
              data: {get_attr: [{{primary_role_name}}, tenant_ip_address]}
          - yaql:
              expression: coalesce($.data, []).first(null)
              data: {get_attr: [{{primary_role_name}}, management_ip_address]}

Untested - let me know if you'd prefer me to submit the patch, or feel free to copy the above, test and push it to gerrit yourself :)

Revision history for this message
Luca Lorenzetto (lorenzetto-luca) wrote :

Thanks shardy, i'll test by myself and then report.

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

Changed in tripleo:
assignee: nobody → Luca Lorenzetto (lorenzetto-luca)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/ocata)

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-heat-templates (stable/newton)

Change abandoned by Emilien Macchi (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/447419

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-heat-templates (stable/ocata)

Change abandoned by Emilien Macchi (<email address hidden>) on branch: stable/ocata
Review: https://review.openstack.org/447416

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-heat-templates (stable/newton)

Change abandoned by Emilien Macchi (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/447419

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

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

commit 9106ddee3276f0fa0c5d196ded2fa20fb9cd950d
Author: Luca Lorenzetto <email address hidden>
Date: Fri Mar 17 09:29:41 2017 +0100

    Pick dynamically the first node for stack validation

    When replacing the controller node with resource id 0,
    AllNodesValidation will fail because there is an hardcoded reference
    to resource.0. With this commit the id for validation is extracted
    dynamically with yaql query, picking the first available.
    Thanks to Steven Hardy for pointing to the right direction.

    Change-Id: I8f2bfacbc005d948bd31ebd51c3d3df3182d5a3c
    Closes-Bug: #1673439
    (cherry picked from commit d385fc38b22b204414e04ba1962d7c6add262f1d)

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

Reviewed: https://review.openstack.org/447416
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=d385fc38b22b204414e04ba1962d7c6add262f1d
Submitter: Jenkins
Branch: stable/ocata

commit d385fc38b22b204414e04ba1962d7c6add262f1d
Author: Luca Lorenzetto <email address hidden>
Date: Fri Mar 17 09:29:41 2017 +0100

    Pick dynamically the first node for stack validation

    When replacing the controller node with resource id 0,
    AllNodesValidation will fail because there is an hardcoded reference
    to resource.0. With this commit the id for validation is extracted
    dynamically with yaql query, picking the first available.
    Thanks to Steven Hardy for pointing to the right direction.

    Change-Id: I8f2bfacbc005d948bd31ebd51c3d3df3182d5a3c
    Closes-Bug: #1673439

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

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

commit fd15a091f7ab6927833275df17b96ecacc2b1827
Author: Luca Lorenzetto <email address hidden>
Date: Fri Mar 17 09:29:41 2017 +0100

    Pick dynamically the first node for stack validation

    When replacing the controller node with resource id 0,
    AllNodesValidation will fail because there is an hardcoded reference
    to resource.0. With this commit the id for validation is extracted
    dynamically with yaql query, picking the first available.
    Thanks to Steven Hardy for pointing to the right direction.

    Change-Id: I8f2bfacbc005d948bd31ebd51c3d3df3182d5a3c
    Closes-Bug: #1673439

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 7.0.0.0b1

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

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

This issue was fixed in the openstack/tripleo-heat-templates 5.3.0 release.

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

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