]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: warn about using osd new instead of osd create 17302/head
authorNeha Ojha <nojha@redhat.com>
Thu, 24 Aug 2017 19:05:58 +0000 (12:05 -0700)
committerKefu Chai <kchai@redhat.com>
Mon, 28 Aug 2017 13:05:00 +0000 (21:05 +0800)
Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit 834ab275b703637b1c3f1a466f610ef672f5df73)

doc/man/8/ceph.rst
src/mon/OSDMonitor.cc

index a95b4a7e283582ba2939e585f9274440c0fe1150..2ae3806704b20eb9f5d16346874a86525e56bc57 100644 (file)
@@ -560,17 +560,19 @@ Usage::
 
        ceph osd create {<uuid>} {<id>}
 
-Subcommand ``new`` reuses a previously destroyed OSD *id*. The new OSD will
-have the specified *uuid*, and the command expects a JSON file containing
-the base64 cephx key for auth entity *client.osd.<id>*, as well as optional
-base64 cepx key for dm-crypt lockbox access and a dm-crypt key. Specifying
-a dm-crypt requires specifying the accompanying lockbox cephx key.
+Subcommand ``new`` can be used to create a new OSD or to recreate a previously
+destroyed OSD with a specific *id*. The new OSD will have the specified *uuid*,
+and the command expects a JSON file containing the base64 cephx key for auth
+entity *client.osd.<id>*, as well as optional base64 cepx key for dm-crypt
+lockbox access and a dm-crypt key. Specifying a dm-crypt requires specifying
+the accompanying lockbox cephx key.
 
 Usage::
 
     ceph osd new {<id>} {<uuid>} -i {<secrets.json>}
 
-The secrets JSON file is expected to maintain a form of the following format::
+The secrets JSON file is optional but if provided, is expected to maintain
+a form of the following format::
 
     {
         "cephx_secret": "AQBWtwhZdBO5ExAAIDyjK2Bh16ZXylmzgYYEjg=="
index 00c4d54fd79d5ec10af0c4106efdaf3a9924e55c..5643261748fe164fc539ecd8b4b19477e76f7e85 100644 (file)
@@ -6752,6 +6752,11 @@ int OSDMonitor::prepare_command_osd_create(
 {
   dout(10) << __func__ << " id " << id << " uuid " << uuid << dendl;
   assert(existing_id);
+  if (osdmap.is_destroyed(id)) {
+    ss << "ceph osd create has been deprecated. Please use ceph osd new "
+          "instead.";
+    return -EINVAL;
+  }
 
   if (uuid.is_zero()) {
     dout(10) << __func__ << " no uuid; assuming legacy `osd create`" << dendl;