Base driver requires redundant IPv6 capabilities

Bug #1734127 reported by Rodrigo Barbieri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Undecided
Ben Swartzlander

Bug Description

In order for a driver to implement IPv6 support, it is currently necessary to set certain variables and implement a method. See the LVM driver for example:

1) First, the driver needs to set ipv6_implemented = True so the Access helper can pass IPv6 access rules requests to the driver. If a driver does not set this flag, the IPv6 access rules are filtered out and remain "Queued_to_apply" in the API.

https://github.com/openstack/manila/blob/db8b63c139c97f9ee0e67f61e6e38be4821df5e5/manila/share/drivers/lvm.py#L173

2) The driver needs to return ipv6_support = True in the capabilities in order to make use of the extra spec defined in share types that map to this backend.

https://github.com/openstack/manila/blob/db8b63c139c97f9ee0e67f61e6e38be4821df5e5/manila/share/drivers/lvm.py#L219

3) The driver needs to implement a function that runs once during startup to obtain which IP versions are currently configured in the backend.

https://github.com/openstack/manila/blob/db8b63c139c97f9ee0e67f61e6e38be4821df5e5/manila/share/drivers/lvm.py#L435

Having all these 3 requirements seem redundant for what we want to accomplish:

1) There should be a flag that is capable of identifying if the driver has ipv6 implemented, even if not currently configured, so access rules can be accepted and eventually be effective

2) We want to report what the driver currently has enabled. For this, we would the driver to retrieve what IP versions are configured in the backend and have this information memoized so it doesn't have to query the update at every update_stats call.

We can clearly derive the ipv6_supported value from the values returned from get_configured_ip_version method, and we can do so at every update_stats execution because they are saved in a ip_version attribute in the base driver class, as can be seen here:

https://github.com/openstack/manila/blob/db8b63c139c97f9ee0e67f61e6e38be4821df5e5/manila/share/driver.py#L2477

In the base driver class, the method get_configured_ip_version adds ipv6_support field to the data collected from update_stats, but it does so after comparing to a previous value of ipv6_support in the same data. See here:

https://github.com/openstack/manila/blob/db8b63c139c97f9ee0e67f61e6e38be4821df5e5/manila/share/driver.py#L2501

That causes the value returned from get_configured_ip_version to never make it to update_stats data because of that dependency. To fix that, the driver is required to always return ipv6_support=True in the capabilities, which becomes redundant with ipv6_implemented = True.

Ideally, the logic highlighted in L2501 should be removed, no driver should be required to return ipv6_support=True in the capabilities because the base driver class appends its value to it according to the value in ip_version attribute, which is obtained from get_configured_ip_version method.

For more information about the discussion, see: http://eavesdrop.openstack.org/meetings/manila/2017/manila.2017-11-16-15.00.log.html#l-128

Changed in manila:
assignee: nobody → Ben Swartzlander (bswartz)
Changed in manila:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/524236
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=42db1e34a7aafa14073d47b02c0753b20ecbbb9e
Submitter: Zuul
Branch: master

commit 42db1e34a7aafa14073d47b02c0753b20ecbbb9e
Author: Ben Swartzlander <email address hidden>
Date: Thu Nov 30 11:01:44 2017 -0500

    Simplify the way drivers report support for ipv6

    Driver shouldn't have to report support for ipv6 in two
    places. Drivers that assert ipv6_implemented=True just
    need to implement get_configured_ip_versions. Likewise
    ipv4 support is computed by the same method.

    Closes-bug: #1734127

    Change-Id: I382767918a65b91e99ac1e604304ad01fac332e6

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 6.0.0.0b2

This issue was fixed in the openstack/manila 6.0.0.0b2 development milestone.

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.