Merge pull request #17242 from neha-ojha/wip-21023

mon: warn about using osd new instead of osd create

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Kefu Chai 2017-08-26 00:52:39 +08:00 committed by GitHub
commit 5127b858b4
2 changed files with 13 additions and 6 deletions

View 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=="

View File

@ -6833,6 +6833,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;