An ipv6 only network in network-data will make the deploy fail

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

Bug Description

2021-10-26 14:45:41.797 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] Error rendering template /home/stack/overcloud-deploy/overcloud/tripleo-heat-templates/network/internal_api.yaml : 'dict object' has no attribute 'ip_subnet'^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] Traceback (most recent call last):^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] File "/usr/share/openstack-tripleo-heat-templates/tools/process-templates.py", line 97, in _j2_render_to_file^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] r_template = template.render(**j2_data)^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1304, in render^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] self.environment.handle_exception()^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] raise rewrite_traceback_stack(source=source)^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] File "<template>", line 1, in top-level template code^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] File "/home/stack/overcloud-deploy/overcloud/tripleo-heat-templates/network/network.j2", line 98, in top-level template code^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] {%- if ":" in network.subnets[subnet]['ip_subnet'] or network.ipv6|default(false) or ipv6_override %}^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'ip_subnet'^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] ^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] During handling of the above exception, another exception occurred:^[[00m
2021-10-26 14:45:41.798 88205 WARNING tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] ^[[00m

The triggering network definition is:
- name: InternalApi
  name_lower: internal_api
  mtu: 1500
  vip: true
  ipv6: true
  subnets:
    internal_api_subnet:
      ipv6_subnet: fd00:fd00:fd00:1000::/64
      ipv6_allocation_pools:
        - start: fd00:fd00:fd00:1000::50
            end: fd00:fd00:fd00:1000::90

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)
Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/815523
Committed: https://opendev.org/openstack/tripleo-heat-templates/commit/48ed6294c8b487d9503a2a865aae5cb00a4483d7
Submitter: "Zuul (22348)"
Branch: master

commit 48ed6294c8b487d9503a2a865aae5cb00a4483d7
Author: Michele Baldessari <email address hidden>
Date: Tue Oct 26 18:11:58 2021 +0200

    Do not error out when a network is ipv6 only

    Currently with the following network definition in network-data:

    - name: InternalApi
      name_lower: internal_api
      mtu: 1500
      vip: true
      ipv6: true
      subnets:
        internal_api_subnet:
          ipv6_subnet: fd00:fd00:fd00:1000::/64
          ipv6_allocation_pools:
            - start: fd00:fd00:fd00:1000::50
                end: fd00:fd00:fd00:1000::90

    We fail as follows:
     Error rendering template /home/stack/overcloud-deploy/overcloud/tripleo-heat-templates/network/internal_api.yaml : 'dict object' has no attribute 'ip_subnet'
     Traceback (most recent call last):
       File "/usr/share/openstack-tripleo-heat-templates/tools/process-templates.py", line 97, in _j2_render_to_file
         r_template = template.render(**j2_data)
       File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1304, in render
         self.environment.handle_exception()
       File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
         raise rewrite_traceback_stack(source=source)
       File "<template>", line 1, in top-level template code
       File "/home/stack/overcloud-deploy/overcloud/tripleo-heat-templates/network/network.j2", line 98, in top-level template code
         {%- if ":" in network.subnets[subnet]['ip_subnet'] or network.ipv6|default(false) or ipv6_override %}

    We need to put the """if ":" in network.subnets[subnet]['ip_subnet']"""
    check after the ipv6 test. After applying this patch I was able to
    correctly deploy the overcloud.

    Closes-Bug: #1948834
    Change-Id: I7872f3ef926cdfd59ff19c9744052f3cc0157a1e

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/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/826620

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

Reviewed: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/826620
Committed: https://opendev.org/openstack/tripleo-heat-templates/commit/5e32a5625749319a63a3e2c00fcd6f75b38e9682
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 5e32a5625749319a63a3e2c00fcd6f75b38e9682
Author: Michele Baldessari <email address hidden>
Date: Tue Oct 26 18:11:58 2021 +0200

    Do not error out when a network is ipv6 only

    Currently with the following network definition in network-data:

    - name: InternalApi
      name_lower: internal_api
      mtu: 1500
      vip: true
      ipv6: true
      subnets:
        internal_api_subnet:
          ipv6_subnet: fd00:fd00:fd00:1000::/64
          ipv6_allocation_pools:
            - start: fd00:fd00:fd00:1000::50
                end: fd00:fd00:fd00:1000::90

    We fail as follows:
     Error rendering template /home/stack/overcloud-deploy/overcloud/tripleo-heat-templates/network/internal_api.yaml : 'dict object' has no attribute 'ip_subnet'
     Traceback (most recent call last):
       File "/usr/share/openstack-tripleo-heat-templates/tools/process-templates.py", line 97, in _j2_render_to_file
         r_template = template.render(**j2_data)
       File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1304, in render
         self.environment.handle_exception()
       File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
         raise rewrite_traceback_stack(source=source)
       File "<template>", line 1, in top-level template code
       File "/home/stack/overcloud-deploy/overcloud/tripleo-heat-templates/network/network.j2", line 98, in top-level template code
         {%- if ":" in network.subnets[subnet]['ip_subnet'] or network.ipv6|default(false) or ipv6_override %}

    We need to put the """if ":" in network.subnets[subnet]['ip_subnet']"""
    check after the ipv6 test. After applying this patch I was able to
    correctly deploy the overcloud.

    Closes-Bug: #1948834
    Change-Id: I7872f3ef926cdfd59ff19c9744052f3cc0157a1e
    (cherry picked from commit 48ed6294c8b487d9503a2a865aae5cb00a4483d7)

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

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