summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2012-05-01 16:16:32 -0700
committerSage Weil <sage@newdream.net>2012-05-01 16:16:32 -0700
commit5a2fe979e1405581d91dc67863a6f3978e00c22b (patch)
treeb9f7023369344ffd8921bef5f30974efe4bfdfbc
parent8ec39205b31b09e2ffc01427aee249830ef1f99e (diff)
downloadceph-5a2fe979e1405581d91dc67863a6f3978e00c22b.tar.gz
osd: allow uuid to be fed to mkfs with 'osd uuid' setting
E.g., ceph-osd --mkfs --osd-uuid <uuid> -i 123 ... Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r--src/common/config_opts.h1
-rw-r--r--src/osd/OSD.cc4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h
index e33c54b405d..08cbc6d9161 100644
--- a/src/common/config_opts.h
+++ b/src/common/config_opts.h
@@ -250,6 +250,7 @@ OPTION(osd_auto_upgrade_tmap, OPT_BOOL, true)
// If true, TMAPPUT sets uses_tmap DEBUGGING ONLY
OPTION(osd_tmapput_sets_uses_tmap, OPT_BOOL, false)
+OPTION(osd_uuid, OPT_UUID, uuid_d())
OPTION(osd_data, OPT_STR, "/var/lib/ceph/osd/$cluster-$id")
OPTION(osd_journal, OPT_STR, "/var/lib/ceph/osd/$cluster-$id/journal")
OPTION(osd_journal_size, OPT_INT, 0) // in mb
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index 50ff7561e7c..fdceb67064a 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -275,6 +275,10 @@ int OSD::mkfs(const std::string &dev, const std::string &jdev, uuid_d fsid, int
ret = -ENOENT;
goto out;
}
+
+ // if we are fed a uuid for this osd, use it.
+ store->set_fsid(g_conf->osd_uuid);
+
ret = store->mkfs();
if (ret) {
derr << "OSD::mkfs: FileStore::mkfs failed with error " << ret << dendl;