fixed_ips list order in OS::Neutron::Port
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Heat Translator |
New
|
Undecided
|
Unassigned |
Bug Description
In heat template, fixed_ips property of OS::Neutron::Port resource is defined as a List value.
But we found the items in the List does NOT keep the order as Port created, but sort as dictionary order.
As the following heat template example, we created 2 ports, and each port has 2 ip_addresses. Note, for both ports, we put IPV4 as the first item in fixed_ips, and IPV6 as the second item. And the template will output both ports ip addresses.
=======
# cat dual_stack.yaml
heat_template_
resources:
port1:
type: OS::Neutron::Port
properties:
network: INTNET
security_
- default
fixed_ips:
-
subnet: e2cb995a-
-
subnet: d2a2979f-
port2:
type: OS::Neutron::Port
properties:
network: INTNET6
security_
- default
fixed_ips:
-
subnet: 9d645e62-
-
subnet: 0a9d5467-
outputs:
data:
value:
port1_
firstIP: { get_attr: [ port1, fixed_ips, 0, ip_address ]}
secondIP: { get_attr: [ port1, fixed_ips, 1, ip_address ]}
port2_
firstIP: { get_attr: [ port2, fixed_ips, 0, ip_address ]}
secondIP: { get_attr: [ port2, fixed_ips, 1, ip_address ]}
===================
Then, create the stack, and check stack output.
===================
# openstack stack create --template dual_stack.yaml dual_stack
# openstack stack show dual_stack
| outputs | - description: No description given |
| | output_key: data |
| | output_value: |
| | port1_addresses: |
| | firstIP: 192.168.1.66 |
| | secondIP: 2001:db9::66 |
| | port2_addresses: |
| | firstIP: 1001:db8::66 |
| | secondIP: 192.168.6.66
================
As you see, port1 shows the same IP order as template, but port2 does NOT.
And it looks the IPs are sorted by dictionary order.
Sorry, just recognized this bug should be reported to heat, just created new one as below. /storyboard. openstack. org/#!/ story/2010568
Please close this one.
https:/