Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-297

OpenStack Network label is arbitrary, libcloud wrongly assumes "public" or "private"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.12.3
    • Component/s: None
    • Labels:
      None

      Description

      The openstack.py driver in libcloud assumes that all OpenStack installations have only three network labels, "public", "internet" and "private".
      However, the label is actually an arbitrary string according to the OpenStack specs, and the cloud I happen to be using has assigned a different string to their network. As further reference, I looked at the python-novaclient code and it assumes the network label to be any arbitrary string as well.
      I have fixed the issue for my personal use with a dirty hack that assigns any non-"public" network to the "private" group. However, the false assumption that there are pre-defined public and private networks in OpenStack still lives on.
      I hope someone with better familiarity with the OpenStack driver and its relation to the rest of libcloud can fix this by removing the notion of predefined public and private networks, in line with OpenStack specifications.
      I will attach a patch for my quick-fix (same as https://github.com/apache/libcloud/pull/95), but I suggest that this be fixed more thoroughly.

      1. network-label.patch
        0.9 kB
        Grischa Meyer

        Activity

        Hide
        grischa Grischa Meyer added a comment -

        Great, thanks!
        It works for me, so I am happy with the solution. I just thought it's not the most "proper" way to do it. Given the libcloud "conventions" which I was not aware of, it is probably a good solution.
        If in the future there are cases where this convention gets broken in other ways, it can be revisited then. For now it will work fine.
        Cheers

        Show
        grischa Grischa Meyer added a comment - Great, thanks! It works for me, so I am happy with the solution. I just thought it's not the most "proper" way to do it. Given the libcloud "conventions" which I was not aware of, it is probably a good solution. If in the future there are cases where this convention gets broken in other ways, it can be revisited then. For now it will work fine. Cheers
        Hide
        kami Tomaz Muraus added a comment -

        Thanks.

        I've added a test, refactored your patch a bit and merged it into trunk.

        I know that the current approach is not exactly how OpenStack specification defines it, but one of the main goals of Libcloud is to make working with multiple providers easier.

        To pull this off with all of the different providers and APIs we need to impose some "conventions" and assume some things like naming a network "public" and "internet" in this case (most of the public OpenStack providers do it this way).

        We are always open to feedback though - if you can think of a better approach for this specific case, let us know.

        Show
        kami Tomaz Muraus added a comment - Thanks. I've added a test, refactored your patch a bit and merged it into trunk. I know that the current approach is not exactly how OpenStack specification defines it, but one of the main goals of Libcloud is to make working with multiple providers easier. To pull this off with all of the different providers and APIs we need to impose some "conventions" and assume some things like naming a network "public" and "internet" in this case (most of the public OpenStack providers do it this way). We are always open to feedback though - if you can think of a better approach for this specific case, let us know.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1447256 from Tomaz Muraus
        [ https://svn.apache.org/r1447256 ]

        Improve public and private IP address handling in OpenStack 1.1 driver. Assume
        every IP address which doesn't have a label "public" or "internet" is private.

        Part of LIBCLOUD-297.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1447256 from Tomaz Muraus [ https://svn.apache.org/r1447256 ] Improve public and private IP address handling in OpenStack 1.1 driver. Assume every IP address which doesn't have a label "public" or "internet" is private. Part of LIBCLOUD-297 .
        Hide
        grischa Grischa Meyer added a comment -

        The patch I used as quick fix. Doesn't fully address the issue though

        Show
        grischa Grischa Meyer added a comment - The patch I used as quick fix. Doesn't fully address the issue though

          People

          • Assignee:
            kami Tomaz Muraus
            Reporter:
            grischa Grischa Meyer
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development