swift-storage charm not network-space aware

Bug #1697491 reported by Drew Freiberger
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Swift Proxy Charm
Fix Released
Medium
James Page
OpenStack Swift Storage Charm
Fix Released
Medium
James Page

Bug Description

I have a juju-deployer config such as:

    swift-storage-z1:
      charm: swift-storage
      bindings:
        "": space-mgmt

    ceph-osd:
      charm: ceph-osd
      bindings:
        public: space-sta
        cluster: space-stc
        "": space-mgmt

    swift-proxy:
      charm: swift-proxy
      bindings:
        "": space-mgmt
        public: space-api
        admin: space-mgmt
        internal: space-mgmt

All charms are 17.02 version.

ceph-osd and swift-storage-z1 both land on metal with all spaces defined with IPs in MAAS 2.x.

Let's say space-mgmt is 10.116.24.0/21, space-api is 20.30.40.0/25, space-sta is 10.116.166.0/23 and space-stc is 10.116.0.0/24.
So, my swift-storage.z1/0 host has IPs:
10.116.24.2
20.30.40.2
10.116.166.2
10.116.0.2

my swift-proxy/0 unit is running in an LXD with ips
10.116.24.3
20.30.40.3

When running add-relation swift-storage-z1 swift-proxy, swift-proxy is receiving relation_get('private-address') return of 10.116.166.2, but that's not accessible from swift-proxy as that's the space-sta network which is not part of either swift-storage or swift-proxy bindings, but does exist on the metal due to other uses on metal.

I would expect that with bindings aware code in juju 2.1.3, that the swift-storage-z1/0 unit would be assigned private-address within juju's core code of the ip on space-mgmt as the default binding for the service/application.

Revision history for this message
Drew Freiberger (afreiberger) wrote :

per Billy Olsen, charm-swift-storage is not space-aware. Going to try work-around of encapsulating in an LXD to separate IP namespaces for this service.

Revision history for this message
Drew Freiberger (afreiberger) wrote :

Ended up adding in an extra-bindings and code to replace the private-address in the relation with a query for the binding (if present) as a workaround.

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

swift-storage still currently relies on the implicit private-address set by juju on relations to swift-proxy.

@hooks.hook()
def swift_storage_relation_joined(rid=None):
    rel_settings = {
        'zone': config('zone'),
        'object_port': config('object-server-port'),
        'container_port': config('container-server-port'),
        'account_port': config('account-server-port'),
    }

    devs = determine_block_devices() or []
    devs = [os.path.basename(d) for d in devs]
    rel_settings['device'] = ':'.join(devs)
    # Keep a reference of devices we are adding to the ring
    remember_devices(devs)

    if config('prefer-ipv6'):
        rel_settings['private-address'] = get_ipv6_addr()[0]

    relation_set(relation_id=rid, **rel_settings)

We should just update this to use the get_relation_ip helper to set a good address for spaces, config and prefer-ipv6.

summary: - When using juju2 and maas2 with spaces, private-address for swift-
- storage-relation-joined is not set to address related to default binding
- on charm
+ swift-storage charm not network-space aware
Changed in charm-swift-storage:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 18.02
status: Triaged → In Progress
assignee: nobody → James Page (james-page)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-swift-storage (master)

Fix proposed to branch: master
Review: https://review.openstack.org/508486

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

Adding proxy task as well so both end of the swift-storage relation can be bound correctly.

Changed in charm-swift-proxy:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 18.02
James Page (james-page)
Changed in charm-swift-storage:
milestone: 18.02 → 17.11
Changed in charm-swift-proxy:
milestone: 18.02 → 17.11
assignee: nobody → James Page (james-page)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-swift-storage (master)

Reviewed: https://review.openstack.org/508486
Committed: https://git.openstack.org/cgit/openstack/charm-swift-storage/commit/?id=b32f68af0f72803168ba5769f56567457b961ce0
Submitter: Jenkins
Branch: master

commit b32f68af0f72803168ba5769f56567457b961ce0
Author: James Page <email address hidden>
Date: Fri Sep 29 11:33:48 2017 +0100

    Add network-space support for swift-storage relation

    Resolve correct private-address for use on the swift-storage
    relation, supporting 'prefer-ipv6' as well as Juju 2.0 network
    spaces.

    Change-Id: I3ee111c6abdd028c2c29e80dceb99178443da45a
    Closes-Bug: 1697491

Changed in charm-swift-storage:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-swift-proxy (master)

Fix proposed to branch: master
Review: https://review.openstack.org/517236

Changed in charm-swift-proxy:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-swift-proxy (master)

Reviewed: https://review.openstack.org/517236
Committed: https://git.openstack.org/cgit/openstack/charm-swift-proxy/commit/?id=27c669a65762fae6af6917f1b130b124b70065ff
Submitter: Zuul
Branch: master

commit 27c669a65762fae6af6917f1b130b124b70065ff
Author: James Page <email address hidden>
Date: Thu Nov 2 09:55:47 2017 +0000

    Enable network-spaces for swift-storage relation

    Ensure that any network space binding provided by the end user
    is used as units join the swift-storage relation.

    This allows backend communication to swift-storage units to be
    network isolated from frontend public access to the swift
    deployment.

    Change-Id: If29ba3dfb1379f0cda20d9685e654d911d67df1d
    Closes-Bug: 1697491

Changed in charm-swift-proxy:
status: In Progress → Fix Committed
James Page (james-page)
Changed in charm-swift-storage:
status: Fix Committed → Fix Released
Changed in charm-swift-proxy:
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.