expect_false ceph auth get-key client.osd-lockbox.$uuid2
expect_false ceph config-key exists dm-crypt/osd/$uuid2/luks
- ceph osd destroy osd.$id2 --yes-i-really-mean-it
+ ceph osd destroy-new osd.$id2 --yes-i-really-mean-it
ceph osd destroy $id2 --yes-i-really-mean-it
ceph osd find $id2
expect_false ceph auth get-key osd.$id2
"but removes cephx keys, config-key data and lockbox keys, "\
"rendering data permanently unreadable.", \
"osd", "rw", "cli,rest")
+COMMAND("osd destroy-new " \
+ "name=id,type=CephOsdName " \
+ "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
+ "mark osd as being destroyed. Keeps the ID intact (allowing reuse), " \
+ "but removes cephx keys, config-key data and lockbox keys, "\
+ "rendering data permanently unreadable. Only works on new, unbooted osd ids.", \
+ "osd", "rw", "cli,rest")
COMMAND("osd purge " \
"name=id,type=CephOsdName " \
"name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
return true;
}
- } else if (prefix == "osd destroy" || prefix == "osd purge") {
+ } else if (prefix == "osd destroy" ||
+ prefix == "osd purge" ||
+ prefix == "osd destroy-new") {
/* Destroying an OSD means that we don't expect to further make use of
* the OSDs data (which may even become unreadable after this operation),
* and that we are okay with scrubbing all its cephx keys and config-key
goto reply;
}
- bool is_destroy = (prefix == "osd destroy");
+ bool is_destroy = (prefix == "osd destroy" ||
+ prefix == "osd destroy-new");
if (!is_destroy) {
assert("osd purge" == prefix);
}
goto reply;
}
+ if (prefix == "osd destroy-new" &&
+ (osdmap.get_state(id) & CEPH_OSD_NEW) == 0) {
+ ss << "osd." << id << " is not new";
+ err = -EPERM;
+ goto reply;
+ }
+
bool goto_reply = false;
paxos->plug();