]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Removed nw_info from sysinfo
authorBabu Shanmugam <anbu@enovance.com>
Fri, 7 Mar 2014 12:49:20 +0000 (12:49 +0000)
committerBabu Shanmugam <anbu@enovance.com>
Fri, 7 Mar 2014 12:49:20 +0000 (12:49 +0000)
Signed-off-by: Babu Shanmugam <anbu@enovance.com>
README.md
client/ceph-brag
server/ceph_brag/json.py
server/ceph_brag/model/db.py
server/sample.json

index cb2622100871d5d186d122454e641a4b8c8b1939..9791eeea9b50b9cda23a32f2264caff07b7c725e 100644 (file)
--- a/README.md
+++ b/README.md
@@ -75,10 +75,6 @@ Run 'ceph-brag -h' to get the usage information of this tool.
       ],
       "sysinfo": [
         {
-          "nw_info": {
-            "hostname": "ceph-brag",
-            "address": "127.0.0.1"
-          },
           "hw_info": {
             "swap_kb": 0,
             "arch": "x86_64",
index b28bcd49267313432f19457e5f5908f1ea391edc..c4dc41cd7911e437dcd7cf19001f6795bfbe1a2f 100755 (executable)
@@ -165,7 +165,6 @@ def get_sysinfo(max_osds):
         osd_metadata_available = True
       os_info = {}
       hw_info = {}
-      nw_info = {}
 
       jmeta = json.loads(o)
 
@@ -194,11 +193,6 @@ def get_sysinfo(max_osds):
       hw_info['swap_kb'] = int(jmeta['mem_swap_kb'])
       meta['hw_info'] = hw_info
   
-    (ip, hname) = get_osd_host(count)
-    nw_info['address'] = ip
-    nw_info['hostname'] = hname
-    meta['nw_info'] = nw_info
-
     sysinfo.append(meta)
     count = count + 1
 
@@ -207,25 +201,6 @@ def get_sysinfo(max_osds):
 
   return sysinfo
 
-def get_osd_host(osd_id):
-  loc = {}
-
-  (rc, o, e) = run_command(['ceph', 'osd', 'find', str(osd_id)])
-  if rc is not 0:
-    raise RuntimeError("\'ceph osd find\' failed - " + e)
-
-  jloc = json.loads(o)
-
-  mo = re.search("(\d+.\d+.\d+.\d+).*", jloc['ip'])
-  if mo is None:
-    #Might be in ipv6 format, TODO: Verify
-    return None;
-
-  ip = mo.group(1)
-  host = jloc['crush_location']['host']
-
-  return (ip, host)
-
 def get_ownership_info():
   (rc, o, e) = run_command(['ceph', 'config-key', 'get',
                             CLUSTER_OWNERSHIP_NAME])
index f272209477ed92fee7f861fa56c38c525cf39bd3..07ba7c4256bb1e0557f9c8b0c6608ee0ea903232 100644 (file)
@@ -45,8 +45,7 @@ def jsonify_pools_info(pool):
 
 @jsonify.register(db.osds_info)
 def jsonify_osds_info(osd):
-    return dict(nw_info={'address':osd.nw_address,'hostname':osd.hostname},
-                hw_info={'swap_kb':osd.swap_kb,'mem_kb':osd.mem_kb,
+    return dict(hw_info={'swap_kb':osd.swap_kb,'mem_kb':osd.mem_kb,
                          'arch':osd.arch, 'cpu':osd.cpu},
                 id=osd.osd_id,
                 os_info={'os':osd.os,'version':osd.os_version,
index 4696a31332732e1bb500559865f5ebd84766b29c..66b8d6118150010239523309032d00a92cf3617d 100644 (file)
@@ -67,8 +67,6 @@ class osds_info(Base):
   index = Column(Integer, primary_key=True)
   vid = Column(ForeignKey('version_info.index'))
   osd_id = Column(String(8))
-  nw_address = Column(String(16))
-  hostname = Column(String(16))
   swap_kb = Column(Integer)
   mem_kb = Column(Integer)
   arch = Column(String(16))
@@ -190,8 +188,6 @@ def put_new_version(data):
     for o in osds:
       osd = osds_info(vid=vi.index,
                       osd_id=o['id'],
-                      nw_address=o['nw_info']['address'],
-                      hostname=o['nw_info']['hostname'],
                       swap_kb=o['hw_info']['swap_kb'],
                       mem_kb=o['hw_info']['mem_kb'],
                       arch=o['hw_info']['arch'],
index d51fe59f7f95643db6549d4b083fa094b105dc23..5218b65b0d02a8b4c924f380d49a6fecdd23a932 100644 (file)
@@ -1,74 +1,72 @@
 {
-      "cluster_creation_date": "2014-01-16 13:38:41.928551",
-      "uuid": "20679d0e-04b1-4004-8ee9-45ac271510e9",
-      "components_count": {
-        "bytes": {
-          "count": 0,
-          "scale": "bytes"
-        },
-        "osds": 1,
-        "objects": 0,
-        "pgs": 192,
-        "pools": 3,
-        "mdss": 1,
-        "mons": 1
+  "cluster_creation_date": "2014-01-16 13:38:41.928551",
+  "uuid": "20679d0e-04b1-4004-8ee9-45ac271510e9",
+  "components_count": {
+    "num_pgs": 192,
+    "num_mdss": 1,
+    "num_osds": 1,
+    "num_bytes": "0 bytes",
+    "num_pools": 3,
+    "num_mons": 1,
+    "num_objects": 0
+  },
+  "crush_types": [
+    {
+      "count": 1,
+      "type": "osd"
+    },
+    {
+      "count": 1,
+      "type": "rack"
+    },
+    {
+      "count": 1,
+      "type": "host"
+    },
+    {
+      "count": 1,
+      "type": "root"
+    }
+  ],
+  "ownership": {
+    "organization": "eNovance",
+    "description": "Use case1",
+    "name": "Cluster1",
+    "email": "mail@enovance.com"
+  },
+  "pool_metadata": [
+    {
+      "type": "replicated",
+      "id": "0",
+      "size": 3
+    },
+    {
+      "type": "replicated",
+      "id": "1",
+      "size": 3
+    },
+    {
+      "type": "replicated",
+      "id": "2",
+      "size": 3
+    }
+  ],
+  "sysinfo": [
+    {
+      "hw_info": {
+        "swap_kb": 0,
+        "arch": "x86_64",
+        "cpu": "Intel Xeon E312xx (Sandy Bridge)",
+        "mem_kb": 2051648
       },
-      "crush_types": [
-        "osd",
-        "host",
-        "chassis",
-        "rack",
-        "row",
-        "pdu",
-        "pod",
-        "room",
-        "datacenter",
-        "region",
-        "root"
-      ],
-      "ownership": {
-        "organization": "eNovance",
-        "description": "Use case1",
-        "email": "mail@enovance.com",
-        "name": "Cluster1"
+      "id": 0,
+      "os_info": {
+        "version": "3.2.0-23-virtual",
+        "os": "Linux",
+        "description": "#36-Ubuntu SMP Tue Apr 10 22:29:03 UTC 2012",
+        "distro": "Ubuntu 12.04 precise (Ubuntu 12.04 LTS)"
       },
-      "pool_metadata": [
-        {
-          "rep_size": 3,
-          "id": "0",
-          "name": "data"
-        },
-        {
-          "rep_size": 3,
-          "id": "1",
-          "name": "metadata"
-        },
-        {
-          "rep_size": 3,
-          "id": "2",
-          "name": "rbd"
-        }
-      ],
-      "sysinfo": [
-        {
-          "nw_info": {
-            "hostname": "ceph-brag",
-            "address": "127.0.0.1"
-          },
-          "hw_info": {
-            "swap_kb": 0,
-            "arch": "x86_64",
-            "cpu": "Intel Xeon E312xx (Sandy Bridge)",
-            "mem_kb": 2051648
-          },
-          "id": 0,
-          "os_info": {
-            "version": "3.2.0-23-virtual",
-            "os": "Linux",
-            "description": "#36-Ubuntu SMP Tue Apr 10 22:29:03 UTC 2012",
-            "distro": "Ubuntu 12.04 precise (Ubuntu 12.04 LTS)"
-          },
-          "ceph_version": "ceph version 0.75-229-g4050eae (4050eae32cd77a1c210ca11d0f12c74daecb1bd3)"
-        }
-      ]
+      "ceph_version": "0.75-229-g4050eae(4050eae32cd77a1c210ca11d0f12c74daecb1bd3)"
     }
+  ]
+}