Discover which nova instance is hosting an address, FQDN, or URL

Registered by Ziad Sawalha on 2014-01-29

Given an IP address, hostname, domain name, or URL, resolve to an IP address and use OS_XXX environment variables to connect to Nova and find the instance that address is hosted on.

Blueprint information

Status:
Complete
Approver:
Caleb Groom
Priority:
Medium
Drafter:
Ziad Sawalha
Direction:
Approved
Assignee:
Ziad Sawalha
Definition:
Approved
Series goal:
Accepted for poc
Implementation:
Implemented
Milestone target:
milestone icon poc
Started by
Ziad Sawalha on 2014-01-30
Completed by
Caleb Groom on 2014-01-31

Related branches

Sprints

Whiteboard

(zns):
- Use python-openstackclient to discover resources on an OpenStack cloud.
- Document CLI and python usage
- Document sys-admin use case (starting from "pip install satori")
- CLI sample:
$ satori discover www.foo.com
Address:
   www.foo.com resolves to IPv4 address 4.4.4.4
Host:
   4.4.4.4 (www.foo.com) is hosted on a Nova Instance
   Instance Information:
       URI: https://nova.api.somecloud.com/v2/111222/servers/d9119040-f767-414
            1-95a4-d4dbf452363a
       Name: sampleserver01.foo.com
       ID: d9119040-f767-4141-95a4-d4dbf452363a
   ip-addresses:
       public:
           ::ffff:404:404
           4.4.4.4
       private:
           10.1.1.156
- python sample:
>>>from satori import discovery

>>>discover.run('www.foo.com')
{... a dict ...}

(cgroom): The CLI example has structured output. You could also just print the dict if the keys have sane names. I don't think there's a need right now to make the output formatted.

(zns): Since this is not final code (no tests, etc) and a dict would not have any ordering, I opted for structured formatting to demonstrate the sequence that the discovery took place in (host resolved, the nova API called). The aim is to easily demonstrate what Satori is doing. Would writing that out be more instructive? Like "Step 1 - hostname resolution..." etc...

(cgroom): That makes sense. Keep the structured text.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.