haproxy context doesn't consider bindings

Bug #1735421 reported by Gábor Mészáros
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Charm Helpers
Fix Released
High
David Ames
OpenStack Cinder Charm
Fix Released
High
David Ames
OpenStack Glance Charm
Fix Released
High
David Ames
OpenStack Keystone Charm
Fix Released
High
David Ames
OpenStack Neutron API Charm
Fix Released
High
David Ames
OpenStack Nova Cloud Controller Charm
Fix Released
High
David Ames
charms.openstack
Invalid
High
Unassigned

Bug Description

Setup:
Using separate subnets for admin, public and private networks.
E.g. glance application with 3 unit HA deployment.

Current behavior:
Deploying charms in HA using haproxy use private-address as their only frontend and backend endpoints when os-{}-network is not provided via config options.

Expected behavior:
When using charm bindings, haproxy should also get endpoints from the networks specified there.

Where it fails:
[0]: https://github.com/juju/charm-helpers/blob/master/charmhelpers/contrib/openstack/context.py#L578

Workaround applied:
configuring os-{}-network on the desired subnet will render frontends and backends on the correct subnet, but also leaves the private-network configuration, which isn't always required.

tags: added: 4010
Revision history for this message
Tytus Kurek (tkurek) wrote :

I have taken an initial look on that and the bug looks a bit complex. Either we would need to fully re-write the existing code or we would need a function which checks whether certain binding is used or not. Unfortunately, I cannot find such function in the charm helpers documentation:

https://pythonhosted.org/charmhelpers/

Revision history for this message
James Page (james-page) wrote :

charms.openstack is actually OK:

    def add_network_split_addresses(self):
        """Populate cluster_hosts with addresses of this unit and its
           peers on each address type

           @return None
        """
        for addr_type in ADDRESS_TYPES:
            cfg_opt = os_ip.ADDRESS_MAP[addr_type]['config']
            laddr = ch_ip.get_relation_ip(
                os_ip.ADDRESS_MAP[addr_type]['binding'],
                self.config.get(cfg_opt))
            if laddr:
                self.cluster_hosts[laddr] = \
                    self.local_network_split_addresses()[laddr]
                key = '{}-address'.format(
                    os_ip.ADDRESS_MAP[addr_type]['binding'])
                for _unit, _laddr in self.relation.ip_map(address_key=key):
                    if _laddr:
                        self.cluster_hosts[laddr]['backends'][_unit] = _laddr

Already using get_relation_ip

Changed in charm-cinder:
status: New → Triaged
Changed in charm-glance:
status: New → Triaged
Changed in charm-helpers:
status: New → Triaged
Changed in charm-keystone:
status: New → Triaged
Changed in charm-neutron-api:
status: New → Triaged
Changed in charm-nova-cloud-controller:
status: New → Triaged
Changed in charms.openstack:
status: New → Triaged
Changed in charm-cinder:
importance: Undecided → High
Changed in charm-glance:
importance: Undecided → High
Changed in charm-helpers:
importance: Undecided → High
Changed in charm-keystone:
importance: Undecided → High
Changed in charm-neutron-api:
importance: Undecided → High
Changed in charm-nova-cloud-controller:
importance: Undecided → High
Changed in charms.openstack:
importance: Undecided → High
status: Triaged → Invalid
David Ames (thedac)
Changed in charm-helpers:
status: Triaged → In Progress
assignee: nobody → David Ames (thedac)
David Ames (thedac)
Changed in charm-helpers:
status: In Progress → Fix Committed
Revision history for this message
David Ames (thedac) wrote :

I have uploaded this change to the glance charm to the charm store:

cs:~thedac/glance-0

Can anyone please give this a test run in their environments. My testing looks good. I'd like independent confirmation.

David Ames (thedac)
Changed in charm-cinder:
assignee: nobody → David Ames (thedac)
Changed in charm-glance:
assignee: nobody → David Ames (thedac)
Changed in charm-keystone:
assignee: nobody → David Ames (thedac)
Changed in charm-neutron-api:
assignee: nobody → David Ames (thedac)
Changed in charm-nova-cloud-controller:
assignee: nobody → David Ames (thedac)
status: Triaged → Fix Committed
Changed in charm-neutron-api:
status: Triaged → Fix Committed
Changed in charm-keystone:
status: Triaged → Fix Committed
Changed in charm-glance:
status: Triaged → Fix Committed
Changed in charm-cinder:
status: Triaged → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-glance (master)

Change abandoned by David Ames (<email address hidden>) on branch: master
Review: https://review.openstack.org/535499
Reason: Ch-syncs completed this.

Revision history for this message
Tytus Kurek (tkurek) wrote :

Why has "charms.openstack" been marked as invalid? The issue is present in designate charm for example. I will create a separate bug report.

Revision history for this message
Tytus Kurek (tkurek) wrote :

I created bug 1745389.

Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

Can this be backported to stable?

Revision history for this message
Gábor Mészáros (gabor.meszaros) wrote :

I'm not sure that this fixes the issue. In these environments we have os-{}-network configuration options unset. Charmhelpers still queries these options directly, but as they are not preset, it will skip them and render only the private address.
The issue is still in this line: https://github.com/juju/charm-helpers/blob/117dfa32089f427fd1d71c3a29c8ca88a222e25e/charmhelpers/contrib/openstack/context.py#L637

Revision history for this message
James Page (james-page) wrote :

Jason - it has been - stable charmhelpers resyncs finished landing today.

Revision history for this message
David Ames (thedac) wrote :

A summary to close out this bug.

@Tytus As James has pointed out, Bug #1745389 is really a new bug and we will address it there.

@Gábor Line 645 [0] is where address selection actually takes place. It uses get_relation_ip [1] which takes os-*-network as an option. If it is None it is ignored, and network-get (the spaces aware tool) is used.

@jhobbs These changes are in stable/17.11 at this time.

[0] https://github.com/juju/charm-helpers/blob/117dfa32089f427fd1d71c3a29c8ca88a222e25e/charmhelpers/contrib/openstack/context.py#L645
[1] https://github.com/juju/charm-helpers/blob/117dfa32089f427fd1d71c3a29c8ca88a222e25e/charmhelpers/contrib/network/ip.py#L560

Revision history for this message
Gábor Mészáros (gabor.meszaros) wrote :

@thedac: yes I ran another few test rounds, it was a mistake on my end. The change fixes my issue.

Revision history for this message
Tytus Kurek (tkurek) wrote :

@David:

Righ, it's a new bug. I was thinking it had been resolved as a part of this bug. Sorry for the mess.

James Page (james-page)
Changed in charm-keystone:
milestone: none → 18.02
Changed in charm-nova-cloud-controller:
milestone: none → 18.02
Changed in charm-neutron-api:
milestone: none → 18.02
Changed in charm-glance:
milestone: none → 18.02
Changed in charm-cinder:
milestone: none → 18.02
Ryan Beisner (1chb1n)
Changed in charm-keystone:
status: Fix Committed → Fix Released
Changed in charm-nova-cloud-controller:
status: Fix Committed → Fix Released
Changed in charm-neutron-api:
status: Fix Committed → Fix Released
Changed in charm-glance:
status: Fix Committed → Fix Released
Changed in charm-cinder:
status: Fix Committed → Fix Released
Changed in charm-helpers:
status: Fix Committed → Fix Released
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.