From 834ab275b703637b1c3f1a466f610ef672f5df73 Mon Sep 17 00:00:00 2001 From: Neha Ojha Date: Thu, 24 Aug 2017 12:05:58 -0700 Subject: [PATCH] mon: warn about using osd new instead of osd create Signed-off-by: Neha Ojha --- doc/man/8/ceph.rst | 14 ++++++++------ src/mon/OSDMonitor.cc | 5 +++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/man/8/ceph.rst b/doc/man/8/ceph.rst index a95b4a7e28358..2ae3806704b20 100644 --- a/doc/man/8/ceph.rst +++ b/doc/man/8/ceph.rst @@ -560,17 +560,19 @@ Usage:: ceph osd create {} {} -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.*, 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.*, 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 {} {} -i {} -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==" diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 164899aed2e6d..c086333134aa3 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -6784,6 +6784,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; -- 2.39.5