]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: include device_ids in metadata
authorSage Weil <sage@redhat.com>
Mon, 4 Jun 2018 14:11:56 +0000 (09:11 -0500)
committerSage Weil <sage@redhat.com>
Sat, 9 Jun 2018 19:25:22 +0000 (14:25 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index b23e88fa75389606cff8bc9a5076ad6a751df250..80d5bd6b689581df75455b6c1d9781e528893cdf 100644 (file)
@@ -48,6 +48,7 @@
 #include "common/version.h"
 #include "common/pick_address.h"
 #include "common/SubProcess.h"
+#include "common/blkdev.h"
 
 #include "os/ObjectStore.h"
 #ifdef HAVE_LIBFUSE
@@ -5416,6 +5417,14 @@ void OSD::_collect_metadata(map<string,string> *pm)
   set<string> devnames;
   store->get_devices(&devnames);
   (*pm)["devices"] = stringify(devnames);
+  string devids;
+  for (auto& dev : devnames) {
+    if (!devids.empty()) {
+      devids += ",";
+    }
+    devids += dev + "=" + get_device_id(dev);
+  }
+  (*pm)["device_ids"] = devids;
 
   dout(10) << __func__ << " " << *pm << dendl;
 }