]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/OSDMap: add 'zone' to default crush map
authorSage Weil <sage@redhat.com>
Wed, 20 Mar 2019 09:29:23 +0000 (04:29 -0500)
committerSage Weil <sage@redhat.com>
Thu, 21 Mar 2019 17:03:13 +0000 (12:03 -0500)
This lets use have a root -> region -> zone -> host hierarchy, like you
will see in the public cloud.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSDMap.cc
src/test/cli/osdmaptool/create-print.t
src/test/cli/osdmaptool/create-racks.t
src/test/cli/osdmaptool/crush.t
src/test/cli/osdmaptool/tree.t
src/test/crush/crush-choose-args-expected-one-more-0.txt
src/test/crush/crush-choose-args-expected-one-more-3.txt

index 7bd569fc364742f4004b0a7a672024a3c6de14ff..5affd814f4b9321458213985fb80efdc5b9de8fe 100644 (file)
@@ -3957,9 +3957,10 @@ int OSDMap::_build_crush_types(CrushWrapper& crush)
   crush.set_type_name(6, "pod");
   crush.set_type_name(7, "room");
   crush.set_type_name(8, "datacenter");
-  crush.set_type_name(9, "region");
-  crush.set_type_name(10, "root");
-  return 10;
+  crush.set_type_name(9, "zone");
+  crush.set_type_name(10, "region");
+  crush.set_type_name(11, "root");
+  return 11;
 }
 
 int OSDMap::build_simple_crush_map(CephContext *cct, CrushWrapper& crush,
index 4ea8050e72fc8b20b1caa1d57607a5130dc40e0f..233055aed8c84a2f9ef672dda8277f02104bcad1 100644 (file)
@@ -31,8 +31,9 @@
   type 6 pod
   type 7 room
   type 8 datacenter
-  type 9 region
-  type 10 root
+  type 9 zone
+  type 10 region
+  type 11 root
   
   # buckets
   host localhost {
index a7c59f02b9ccb0f13eaa80aca33a90fee51e98c1..b68099b7f67709bc6f011e549df256eb3b48430d 100644 (file)
   type 6 pod
   type 7 room
   type 8 datacenter
-  type 9 region
-  type 10 root
+  type 9 zone
+  type 10 region
+  type 11 root
   
   # buckets
   host cephstore5522 {
index c01c952b8041dbdb3d134bb61eacbaa56851b3eb..1d15bf4642aff9e10f20aed7bf38e419af1b12a1 100644 (file)
@@ -6,5 +6,5 @@
   osdmaptool: exported crush map to oc
   $ osdmaptool --import-crush oc myosdmap
   osdmaptool: osdmap file 'myosdmap'
-  osdmaptool: imported 485 byte crush map from oc
+  osdmaptool: imported 497 byte crush map from oc
   osdmaptool: writing epoch 3 to myosdmap
index 394a4f38436a944ff8c4334b1d37e81a5513a393..fa55b4a9837e2a5478c8c80fb04edd87ad926f1d 100644 (file)
@@ -20,7 +20,7 @@
               "id": -1,
               "name": "default",
               "type": "root",
-              "type_id": 10,
+              "type_id": 11,
               "children": [
                   -3
               ]
index 23068e68c865c43a90952038d4ca49aaa99004fa..bad7f0becfe94e5ae1e3719c68b5698c33c9ff0f 100644 (file)
@@ -22,8 +22,9 @@ type 5 pdu
 type 6 pod
 type 7 room
 type 8 datacenter
-type 9 region
-type 10 root
+type 9 zone
+type 10 region
+type 11 root
 
 # buckets
 host HOST {
index 53cc3d11900ec10a524ba6b79c12dcc7a442e5ab..14cdd9c26d92261c5a5ae58cd312f2cf8c81cf97 100644 (file)
@@ -22,8 +22,9 @@ type 5 pdu
 type 6 pod
 type 7 room
 type 8 datacenter
-type 9 region
-type 10 root
+type 9 zone
+type 10 region
+type 11 root
 
 # buckets
 host HOST {