]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add 'rotate-stored-key' asok command
authorSage Weil <sage@newdream.net>
Mon, 25 Oct 2021 20:08:31 +0000 (16:08 -0400)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 12 Sep 2022 17:03:24 +0000 (17:03 +0000)
This writes the key to the osd_key in the block device label.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSD.cc

index 8b9aa4feb12b1330f76e63630c7c5491406f5b4e..acbfdf4667c22287db2ec1158c5f8890086c8436 100644 (file)
@@ -2794,6 +2794,8 @@ will start to track new ops received afterwards.";
     store->generate_db_histogram(f);
   } else if (prefix == "flush_store_cache") {
     store->flush_cache(&ss);
+  } else if (prefix == "rotate-stored-key") {
+    store->write_meta("osd_key", inbl.to_str());
   } else if (prefix == "dump_pgstate_history") {
     f->open_object_section("pgstate_history");
     f->open_array_section("pgs");
@@ -3987,6 +3989,10 @@ void OSD::final_init()
                                      asok_hook,
                                      "Flush bluestore internal cache");
   ceph_assert(r == 0);
+  r = admin_socket->register_command("rotate-stored-key",
+                                     asok_hook,
+                                     "Update the stored osd_key");
+  ceph_assert(r == 0);
   r = admin_socket->register_command("dump_pgstate_history",
                                     asok_hook,
                                     "show recent state history");