Is it possible to get an instance info by ip address?

asked 2014-04-03 05:14:31 -0600

Ekk gravatar image

We setup openstack and set it to assign floating ip when a new instance is created. I know that we can get an instance's information using its id but I wonder if it's possible to do that by an ip address?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-04-03 07:45:34 -0600

larsks gravatar image

updated 2014-04-03 07:46:10 -0600

Sure it's possible, if you're willing to write some code. For example, I have an instance with floating ip address "". I can get information about floating ip from the network api:

curl -H 'x-auth-token: ...' http://localhost:9696/v2.0/floatingips

Which will get me something like:

  "floatingips": [
    "id": "8dcbbc48-16d3-4a70-a77c-db7f5e31d604",
      "port_id": "2bc943e3-d575-4a67-ba37-19cc8516ca48",
      "floating_ip_address": "",
      "fixed_ip_address": "",
      "floating_network_id": "93c8ddfc-7baa-4667-a01c-dfbdf5d47f15",
      "tenant_id": "28a490a259974817b88ce490a74df8d2",
      "router_id": "acc6b46f-d040-490f-8d1f-7d6f9a0df8d9"

This gets me a port ID, and I can find details about ports like this:

curl -H 'x-auth-token: ...' http://localhost:9696/v2.0/ports/2bc943e3-d575-4a67-ba37-19cc8516ca48

Which gives me:

  "port": {
    "device_id": "71d68b44-625e-4aca-81e0-fa02c80da6b3",
    "security_groups": [

Here the device_id is the UUID of the instance attached to this port. And if I run:

nova show 71d68b44-625e-4aca-81e0-fa02c80da6b3

I get the information about my instance.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-04-03 05:14:31 -0600

Seen: 115 times

Last updated: Apr 03 '14