]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: guard "osd crush rule create-replicated"
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 10 Jul 2017 03:25:53 +0000 (11:25 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 10 Jul 2017 03:25:53 +0000 (11:25 +0800)
require Luminous before using the crush device classes.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/mon/OSDMonitor.cc

index 467c84cfcf1d3ac46a5c903f5eff0cb390ab8b1f..86657e3a9fd3a268a83512949913031c73b12ac8 100644 (file)
@@ -7859,6 +7859,15 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     cmd_getval(g_ceph_context, cmdmap, "type", type);
     cmd_getval(g_ceph_context, cmdmap, "class", device_class);
 
+    if (!device_class.empty()) {
+      if (osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) {
+        ss << "you must complete the upgrade and 'ceph osd require-osd-release "
+           << "luminous' before using crush device classes";
+        err = -EPERM;
+        goto reply;
+      }
+    }
+
     if (osdmap.crush->rule_exists(name)) {
       // The name is uniquely associated to a ruleid and the rule it contains
       // From the user point of view, the rule is more meaningfull.