mirror of
https://github.com/ceph/ceph
synced 2025-02-21 18:17:42 +00:00
crimson/osd: use configured ceph-osd uuid in mkfs
Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
parent
d0dbb36e2e
commit
e799b38aed
@ -137,9 +137,13 @@ int main(int argc, char* argv[])
|
||||
hb_back_msgr.stop());
|
||||
});
|
||||
if (config.count("mkfs")) {
|
||||
osd.invoke_on(0, &OSD::mkfs,
|
||||
local_conf().get_val<uuid_d>("fsid"))
|
||||
.then([] { seastar::engine().exit(0); }).get();
|
||||
osd.invoke_on(
|
||||
0,
|
||||
&OSD::mkfs,
|
||||
local_conf().get_val<uuid_d>("osd_uuid"),
|
||||
local_conf().get_val<uuid_d>("fsid")).then([] {
|
||||
seastar::engine().exit(0);
|
||||
}).get();
|
||||
} else {
|
||||
osd.invoke_on(0, &OSD::start).get();
|
||||
}
|
||||
|
@ -99,16 +99,22 @@ CompatSet get_osd_initial_compat_set()
|
||||
}
|
||||
}
|
||||
|
||||
seastar::future<> OSD::mkfs(uuid_d cluster_fsid)
|
||||
seastar::future<> OSD::mkfs(uuid_d osd_uuid, uuid_d cluster_fsid)
|
||||
{
|
||||
return store->mkfs().then([this] {
|
||||
return store->mount();
|
||||
}).then([cluster_fsid, this] {
|
||||
}).then([cluster_fsid, osd_uuid, this] {
|
||||
superblock.cluster_fsid = cluster_fsid;
|
||||
superblock.osd_fsid = store->get_fsid();
|
||||
superblock.osd_fsid = osd_uuid;
|
||||
superblock.whoami = whoami;
|
||||
superblock.compat_features = get_osd_initial_compat_set();
|
||||
|
||||
logger().info(
|
||||
"{} writing superblock cluster_fsid {} osd_fsid {}",
|
||||
__func__,
|
||||
cluster_fsid,
|
||||
superblock.osd_fsid);
|
||||
|
||||
meta_coll = make_unique<OSDMeta>(
|
||||
store->create_new_collection(coll_t::meta()), store.get());
|
||||
ceph::os::Transaction t;
|
||||
|
@ -107,7 +107,7 @@ public:
|
||||
ceph::net::Messenger& hb_back_msgr);
|
||||
~OSD() override;
|
||||
|
||||
seastar::future<> mkfs(uuid_d fsid);
|
||||
seastar::future<> mkfs(uuid_d osd_uuid, uuid_d cluster_fsid);
|
||||
|
||||
seastar::future<> start();
|
||||
seastar::future<> stop();
|
||||
|
Loading…
Reference in New Issue
Block a user