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

CloudStack driver does not return ip addresses properly

    Details

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

      OSX, latest trunk from git

      Description

      the private ips and publics ips are not returned properly. If a cloud does not use floating ips but instead assigns public ips directly to the instance, the public ip is set as a private ips.

      1. cloudstack.patch
        1 kB
        sebastien goasguen

        Activity

        Hide
        kami Tomaz Muraus added a comment -

        No problem.

        I see, that's less than ideal

        I still prefer to leave public_ips empty instead of incorrectly (in many cases) putting private IPs there because this is confusing and can also break other things such as deploy_node for example.

        I agree about the driver needing a lot of love (including tests). Contributions are very welcome

        Show
        kami Tomaz Muraus added a comment - No problem. I see, that's less than ideal I still prefer to leave public_ips empty instead of incorrectly (in many cases) putting private IPs there because this is confusing and can also break other things such as deploy_node for example. I agree about the driver needing a lot of love (including tests). Contributions are very welcome
        Hide
        sebgoa sebastien goasguen added a comment -

        Thanks Tomaz,

        I set the public_ips to private_ips, because some clouds don't use the allocate IPs functionality and directly give a public IP which gets set in the private_ips field. It's definitely not ideal but worked with a production CloudStack based public cloud exoscale.ch

        Overall the driver needs a lot of love.

        -Sebastien

        Show
        sebgoa sebastien goasguen added a comment - Thanks Tomaz, I set the public_ips to private_ips, because some clouds don't use the allocate IPs functionality and directly give a public IP which gets set in the private_ips field. It's definitely not ideal but worked with a production CloudStack based public cloud exoscale.ch Overall the driver needs a lot of love. -Sebastien
        Hide
        kami Tomaz Muraus added a comment -

        I've refactored your patch a bit and merged it into trunk:

        • I've removed "if 'ipaddress' in nic.keys():" change because what we currently do ("if 'ipaddress' in nic") is more "pythonic" and does the same thing
        • On create_node I only populate "private_ips" because the returned IPs are private one. In your patch you populated both public_ips and private_ips with the same value which is not OK.
        • I've also added some tests. It's actually scary how under tested this driver is.

        Thanks

        Show
        kami Tomaz Muraus added a comment - I've refactored your patch a bit and merged it into trunk: I've removed "if 'ipaddress' in nic.keys():" change because what we currently do ("if 'ipaddress' in nic") is more "pythonic" and does the same thing On create_node I only populate "private_ips" because the returned IPs are private one. In your patch you populated both public_ips and private_ips with the same value which is not OK. I've also added some tests. It's actually scary how under tested this driver is. Thanks
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1485883 from Tomaz Muraus
        [ https://svn.apache.org/r1485883 ]

        Populate private_ips attribute in the CloudStack drive when returning
        a Node object from the create_node method.

        Also add a basic test case for create_node.

        Part of LIBCLOUD-329.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1485883 from Tomaz Muraus [ https://svn.apache.org/r1485883 ] Populate private_ips attribute in the CloudStack drive when returning a Node object from the create_node method. Also add a basic test case for create_node. Part of LIBCLOUD-329 .
        Hide
        kami Tomaz Muraus added a comment -

        Thanks.

        Can you please also add some tests which verify the correct behavior?

        Show
        kami Tomaz Muraus added a comment - Thanks. Can you please also add some tests which verify the correct behavior?
        Hide
        sebgoa sebastien goasguen added a comment -

        libcloud-329 patch

        Show
        sebgoa sebastien goasguen added a comment - libcloud-329 patch

          People

          • Assignee:
            kami Tomaz Muraus
            Reporter:
            sebgoa sebastien goasguen
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development