From: Sage Weil Date: Fri, 22 Mar 2019 22:30:11 +0000 (-0500) Subject: mon/OSDMonitor: allow 'osd require-osd-release octopus' X-Git-Tag: v15.0.0^2~14 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2806de11474ea31b6d01879e3366b719fd9cbcc8;p=ceph-ci.git mon/OSDMonitor: allow 'osd require-osd-release octopus' Signed-off-by: Sage Weil --- diff --git a/qa/workunits/mon/crush_ops.sh b/qa/workunits/mon/crush_ops.sh index 4ad8f3544b6..a6876198546 100755 --- a/qa/workunits/mon/crush_ops.sh +++ b/qa/workunits/mon/crush_ops.sh @@ -19,8 +19,6 @@ ceph osd crush rule create-simple foo default host ceph osd crush rule create-simple foo default host ceph osd crush rule create-simple bar default host -# make sure we're at luminous+ before using crush device classes -ceph osd require-osd-release nautilus ceph osd crush rm-device-class all ceph osd crush set-device-class ssd osd.0 ceph osd crush set-device-class hdd osd.1 diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 62d1b244c26..fe701babc6d 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -793,7 +793,7 @@ COMMAND("osd unset " \ "notieragent|nosnaptrim", \ "unset ", "osd", "rw") COMMAND("osd require-osd-release "\ - "name=release,type=CephChoices,strings=luminous|mimic|nautilus " \ + "name=release,type=CephChoices,strings=luminous|mimic|nautilus|octopus " \ "name=yes_i_really_mean_it,type=CephBool,req=false", \ "set the minimum allowed OSD release to participate in the cluster", "osd", "rw") diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index c62932f1e0e..5b7f3b98e43 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -10365,6 +10365,19 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, err = -EPERM; goto reply; } + } else if (rel == CEPH_RELEASE_OCTOPUS) { + if (!mon->monmap->get_required_features().contains_all( + ceph::features::mon::FEATURE_OCTOPUS)) { + ss << "not all mons are octopus"; + err = -EPERM; + goto reply; + } + if ((!HAVE_FEATURE(osdmap.get_up_osd_features(), SERVER_OCTOPUS)) + && !sure) { + ss << "not all up OSDs have CEPH_FEATURE_SERVER_OCTOPUS feature"; + err = -EPERM; + goto reply; + } } else { ss << "not supported for this release yet"; err = -EPERM;