Bug 1809447

Summary: Remove resource_registry section from 'ips-from-pool-all.yaml' file
Product: Red Hat OpenStack Reporter: Ravi Singh <ravsingh>
Component: openstack-tripleo-heat-templatesAssignee: Harald Jensås <hjensas>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 16.0 (Train)CC: augol, bfournie, dsneddon, hjensas, jparoly, mburns, ramishra
Target Milestone: Upstream M1Keywords: Triaged
Target Release: 17.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-14.2.1-0.20210809091810.185a41c.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-21 12:09:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
OSP16_templates none

Description Ravi Singh 2020-03-03 07:10:56 UTC
Created attachment 1667125 [details]
OSP16_templates

Description of problem:
During OSP16 deployment with predictable VIPs, I am receiving below error [1] not sure from where it's coming & only for storagemgmt network , although I used standard deployment templates.

deployment command
~~~
#!/bin/bash
time openstack overcloud deploy --debug \
        --templates \
        --ntp-server clock.redhat.com \
	--libvirt-type kvm \
        --timeout 120    \
	-r /home/stack/templates/roles_data.yaml \
	-e /home/stack/templates/node-info.yaml \
        -e /home/stack/containers-prepare-parameter.yaml \
        -e /home/stack/templates/network-isolation.yaml \
        -e /home/stack/templates/network-environment.yaml \
	-e /home/stack/templates/ips-from-pool-all.yaml \
        -e /usr/share/openstack-tripleo-heat-templates/environments/disable-telemetry.yaml

~~~

[1]
~~~
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource [req-e7139d13-243f-4f44-a86e-70ecff06c544 - admin - default default] Unexpected exception in resource check.: heat.common.exception.TemplateOutputError: Error in StorageMgmtVirtualIP output ip_address_uri: The "host" argument to "make_url" must be a string
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource Traceback (most recent call last):
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource   File "/usr/lib/python3.6/site-packages/heat/engine/check_resource.py", line 319, in check
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource     rsrc, stack)
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource   File "/usr/lib/python3.6/site-packages/heat/engine/check_resource.py", line 256, in _initiate_propagate_resource
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource     input_data = _get_input_data(req_node, input_forward_data)
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource   File "/usr/lib/python3.6/site-packages/heat/engine/check_resource.py", line 238, in _get_input_data
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource     return rsrc.node_data().as_dict()
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource   File "/usr/lib/python3.6/site-packages/heat/engine/node_data.py", line 85, in as_dict
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource     raise v
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource   File "/usr/lib/python3.6/site-packages/heat/engine/resource.py", line 1120, in get_attrs
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource     yield attr, self.FnGetAtt(*path)
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource   File "/usr/lib/python3.6/site-packages/heat/engine/resource.py", line 2401, in FnGetAtt
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource     attr_val = self.get_attribute(key, *path)
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource   File "/usr/lib/python3.6/site-packages/heat/engine/resources/template_resource.py", line 359, in get_attribute
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource     return attributes.select_from_attribute(self.get_output(key),
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource   File "/usr/lib/python3.6/site-packages/heat/engine/resources/stack_resource.py", line 665, in get_output
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource     message=output_data[rpc_api.OUTPUT_ERROR])
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource heat.common.exception.TemplateOutputError: Error in StorageMgmtVirtualIP output ip_address_uri: The "host" argument to "make_url" must be a string
2020-03-03 01:43:09.170 25 ERROR heat.engine.check_resource 
2020-03-03 01:43:09.172 25 INFO heat.engine.stack [req-e7139d13-243f-4f44-a86e-70ecff06c544 - admin - default default] Stack UPDATE FAILED (overcloud): Error in StorageMgmtVirtualIP output ip_address_uri: The "host" argument to "make_url" must be a string
~~~


Version-Release number of selected component (if applicable):
OSP16

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Ravi Singh 2020-03-03 07:24:06 UTC
I do see error now for internalapi too ,I do believe this is coming via predictable IP templates.

~~~
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker [req-f24b7ca7-1bea-4af1-b0b4-a4b2db42efe1 - admin - default default] Unhandled exception in check_resource: heat.common.exception.Template
OutputError: Error in InternalApiVirtualIP output ip_address_uri: The "host" argument to "make_url" must be a string
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker Traceback (most recent call last):
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/heat/engine/worker.py", line 45, in exception_wrapper
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     return func(*args, **kwargs)
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/heat/engine/worker.py", line 196, in check_resource
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     is_update, adopt_stack_data, rsrc, stack)
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/heat/engine/check_resource.py", line 325, in check
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     stack, msg)
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/oslo_utils/excutils.py", line 220, in __exit__
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     self.force_reraise()
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     six.reraise(self.type_, self.value, self.tb)
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/six.py", line 693, in reraise
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     raise value
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/heat/engine/check_resource.py", line 319, in check
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     rsrc, stack)
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/heat/engine/check_resource.py", line 256, in _initiate_propagate_resource
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     input_data = _get_input_data(req_node, input_forward_data)
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/heat/engine/check_resource.py", line 238, in _get_input_data
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     return rsrc.node_data().as_dict()
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/heat/engine/node_data.py", line 85, in as_dict
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     raise v
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/heat/engine/resource.py", line 1120, in get_attrs
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     yield attr, self.FnGetAtt(*path)
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/heat/engine/resource.py", line 2401, in FnGetAtt
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     attr_val = self.get_attribute(key, *path)
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/heat/engine/resources/template_resource.py", line 359, in get_attribute
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     return attributes.select_from_attribute(self.get_output(key),
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker   File "/usr/lib/python3.6/site-packages/heat/engine/resources/stack_resource.py", line 665, in get_output
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker     message=output_data[rpc_api.OUTPUT_ERROR])
2020-03-03 02:19:36.183 26 ERROR heat.engine.worker heat.common.exception.TemplateOutputError: Error in InternalApiVirtualIP output ip_address_uri: The "host" argument to "make_url" must be 
a string

~~~~

Comment 2 Ravi Singh 2020-03-03 10:31:45 UTC
So if I remove 'ips-from-pool-all.yaml' from deployment command, deployment succeeds.

Comment 3 Ravi Singh 2020-03-03 11:09:06 UTC
(In reply to Ravi Singh from comment #2)
> So if I remove 'ips-from-pool-all.yaml' from deployment command, deployment
> succeeds.

Not sure what's the problem with ips-from-pool-all.yaml or it's a bug here.

Comment 5 Harald Jensås 2020-03-03 16:03:34 UTC
This is the code to make the ip_address_uri, it basically uses make_url to add brackets.

  ip_address_uri:
    description: {{network.name}} network IP (with brackets for IPv6 URLs)
    value:
      str_replace:
        template:
          make_url:
            host: {get_attr: [{{network.name}}Port, fixed_ips, 0, ip_address]}
        params:
          //: ''


The {get_attr: [{{network.name}}Port, fixed_ips, 0, ip_address]} should return an IP address.

Can you list and show the ports on the undercloud?

 openstack port list
 openstack port show <uuid-of-vip-port>

Comment 12 Harald Jensås 2020-03-04 11:40:14 UTC
(In reply to Ravi Singh from comment #11)
> 
> But I still have one weird observation I haven't corrected predictable IPs
> for different networks in 'ips-from-pool-all.yaml'[still in 172.17.xx.xx]
> but I can see os-net-config is already populated with wrong CIDR IPs. Don't
> you think there should a validation for this also similar to VIPs?
> 
> 

Right, when using ips-from-pool-all.yaml you use the 'port_from_pool' heat template instead of a OS::Neutron::Port. The 'port_from_pool' template in tripleo-heat-templates is simply input->output. No validations. You can put 'foo-bar' as the IP address.

My advise, don't use 'ips-from-pool-all.yaml'! It's legacy and replaced by https://review.opendev.org/580747. IMO the only place 'port_from_pool' makes sense is in the undercloud installer. :)

This is from Rocky release-notes:

Support for predictable IP addressing added to the default port templates. In previous releases the use of _from_pool templates was required to have predictable ip addresses assigned to the nodes. Use of the port_from_pool templates is no longer required. The interface to configure predictable IP addressing without port_from_pool templates is the same. For example:

    parameter_defaults:
      ControllerIPs:
        intapi:
          - 10.0.0.10
          - 10.0.0.11
        external:
          - 172.16.1.10
          - 172.16.1.11

 Ref: https://docs.openstack.org/releasenotes/tripleo-heat-templates/rocky.html#relnotes-9-0-0-stable-rocky-new-features

Comment 15 Harald Jensås 2020-03-05 19:39:43 UTC
I've proposed patches upstream to remove the resource_registry section from ips-from-pool.yaml and ips-from-pool-all.yaml, as well as a upstream documentation update removing the text related to the resource_registry section.

Comment 16 Bob Fournier 2020-04-13 17:51:54 UTC
Fix has merged to master, will need to backport to Train to get into OSP-16.

Comment 17 Bob Fournier 2020-04-15 18:45:24 UTC
Retargeting to OSP-17.

Comment 25 errata-xmlrpc 2022-09-21 12:09:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:6543