Trove - IP Address Not Returned in Get Command If Addresses is Dynamic

Bug #1199528 reported by Auston McReynolds
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Committed
Medium
Steve Leon

Bug Description

When asking for the status of a Trove deployment:

$ trove-cli instance get --id bf39fa53-58eb-439d-bd33-f631c512a412

```
{
    "created": "2013-06-25T21:52:41",
    "flavor": {
        "id": 6,
        "links": [
            {
                "href": "https://REDACTED:8779/v1.0/89f6c273df2142e8abf4fcd36df3cbdf/flavors/6",
                "rel": "self"
            },
            {
                "href": "https://REDACTED:8779/flavors/6",
                "rel": "bookmark"
            }
        ]
    },
    "id": "bf39fa53-58eb-439d-bd33-f631c512a412",
    "links": [
        {
            "href": "https://REDACTED:8779/v1.0/89f6c273df2142e8abf4fcd36df3cbdf/instances/bf39fa53-58eb-439d-bd33-f631c512a412",
            "rel": "self"
        },
        {
            "href": "https://REDACTED:8779/instances/bf39fa53-58eb-439d-bd33-f631c512a412",
            "rel": "bookmark"
        }
    ],
    "name": "DBaaSBox",
    "status": "ACTIVE",
    "updated": "2013-06-25T21:52:44",
    "volume": {
        "size": 5,
        "used": 0.23715972900390625
    }
}
```

It shows as ACTIVE, but the response does not contain an IP (the lack of a hostname is to be expected in this situation because `CONF.trove_dns_support` is set to False).

Relevant: https://github.com/openstack/trove/blob/7ab80b554dde5f1f1e61b6a8c45492c5ac27ed6b/trove/instance/views.py#L93

I have `CONF.add_addresses` set to True, so that's not the issue. The issue is that the addresses frag returned from Nova is not what Trove is expecting.

The "trove-cli instance get" command at some point executes the equivalent of a "nova show":

$ curl -i http://REDACTED:8774/v2/89f6c273df2142e8abf4fcd36df3cbdf/servers/a665572b-b5a4-4320-a0ce-fe8c596f6431 -X GET -H "X-Auth-Project-Id: trove" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: REDACTED"

Which results in the following (snippet):

```
{
   "server":{
      "status":"ACTIVE",
      "updated":"2013-06-25T21:53:39Z",
      "hostId":"REDACTED",
      "OS-EXT-SRV-ATTR:host":"REDACTED",
      "addresses":{
         "foo-bar-net-REDACTED_IP_ADDRESS-0_24":[
            {
               "version":4,
               "addr":"REDACTED_IP_ADDRESS"
            }
         ]
      },
```

Example:

"addresses":{
  "globo-corp-net-10-99-99-99-0_24":[
    {
      "version":4,
      "addr":"10.99.99.99"
    }
  ]
},

Unfortunately, the Trove function is specifically looking for "private" or "usernet" under "addresses": https://github.com/openstack/trove/blob/7ab80b554dde5f1f1e61b6a8c45492c5ac27ed6b/trove/instance/views.py#L29

Given that the address name will be dynamic, a CONF property like nova_address_prefix (or mask) is needed.

Changed in trove:
assignee: nobody → Steve Leon (steve-leon)
milestone: none → havana-3
importance: Undecided → Medium
status: New → Fix Committed
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.