diff --git a/nodes/fuel.py b/nodes/fuel.py
index 20390aa..76dedcd 100644
--- a/nodes/fuel.py
+++ b/nodes/fuel.py
@@ -1,3 +1,4 @@
+import node
 import fuel_rest_api
 
 
@@ -6,4 +7,4 @@
     connection = fuel_rest_api.KeystoneAuth(root_url, credentials)
     fi = fuel_rest_api.FuelInfo(connection)
 
-    return fi.nodes
\ No newline at end of file
+    return [node.Node(n.ip, n.get_roles()) for n in fi.nodes]
\ No newline at end of file
diff --git a/nodes/node.py b/nodes/node.py
new file mode 100644
index 0000000..4ee2109
--- /dev/null
+++ b/nodes/node.py
@@ -0,0 +1,33 @@
+class Node(object):
+
+    def __init__(self, ip, roles, username=None,
+                 password=None, key_path=None, port=None):
+        self.roles = roles
+        self.ip = ip
+        self.username = username
+        self.password = password
+        self.port = port
+        self.key_path = key_path
+
+    def set_conn_attr(self, name, value):
+        setattr(self, name, value)
+
+    @property
+    def connection(self):
+        connection = []
+
+        if self.username:
+            connection.append(self.username)
+            if self.password:
+                connection.extend([":", self.password, "@"])
+            connection.append("@")
+
+        connection.append(self.ip)
+        if self.port:
+            connection.extend([":", self.port])
+            if self.key_path:
+                connection.extend([":", self.key_path])
+        else:
+            if self.key_path:
+                connection.extend([":", ":", self.key_path])
+        return "".join(connection)
diff --git a/nodes/openstack.py b/nodes/openstack.py
index 8b425cb..7444e46 100644
--- a/nodes/openstack.py
+++ b/nodes/openstack.py
@@ -1,11 +1,33 @@
-from novaclient.v1_1 import client as novacl
+import node
+
+from novaclient.client import Client
+
+
+def get_floating_ip(vm):
+    addrs = vm.addresses
+    for net_name, ifaces in addrs.items():
+        for iface in ifaces:
+            if iface.get('OS-EXT-IPS:type') == "floating":
+                return iface['addr']
+    raise Exception("No floating ip found for VM %s" % repr(vm))
+
+
+def discover_openstack_vms(conn_details):
+    """Discover vms running in openstack
+    :param conn_details - dict with openstack connection details -
+        auth_url, api_key (password), username
+    """
+    client = Client(version='1.1', **conn_details)
+    servers = client.servers.list(search_opts={"all_tenant": True})
+    return [node.Node(get_floating_ip(server), ["test_vm"])
+            for server in servers]
 
 
 def discover_openstack_nodes(conn_details):
     """Discover openstack nodes
-    :param connection_details - dict with openstack connection details -
+    :param conn_details - dict with openstack connection details -
         auth_url, api_key (password), username
     """
-    client = novacl.Client(**conn_details)
-    servers = client.servers.list(search_opts={"all_tenant": True})
-    return servers
+    client = Client(version='1.1', **conn_details)
+    services = client.services.list()
+    return [node.Node(server.ip, ["test_vm"]) for server in services]
