summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2019-03-20 10:29:23 +0100
committerSage Weil <sage@redhat.com>2019-03-21 18:03:13 +0100
commit39f4e77d13377763a579f2afcd9341c00ca5b319 (patch)
tree2f50d5362760acbac77c34445aad1e21b71d5494
parentMerge pull request #27045 from smithfarm/wip-38810 (diff)
downloadceph-39f4e77d13377763a579f2afcd9341c00ca5b319.tar.xz
ceph-39f4e77d13377763a579f2afcd9341c00ca5b319.zip
osd/OSDMap: add 'zone' to default crush map
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>
-rw-r--r--src/osd/OSDMap.cc7
-rw-r--r--src/test/cli/osdmaptool/create-print.t5
-rw-r--r--src/test/cli/osdmaptool/create-racks.t5
-rw-r--r--src/test/cli/osdmaptool/crush.t2
-rw-r--r--src/test/cli/osdmaptool/tree.t2
-rw-r--r--src/test/crush/crush-choose-args-expected-one-more-0.txt5
-rw-r--r--src/test/crush/crush-choose-args-expected-one-more-3.txt5
7 files changed, 18 insertions, 13 deletions
diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc
index 7bd569fc364..5affd814f4b 100644
--- a/src/osd/OSDMap.cc
+++ b/src/osd/OSDMap.cc
@@ -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,
diff --git a/src/test/cli/osdmaptool/create-print.t b/src/test/cli/osdmaptool/create-print.t
index 4ea8050e72f..233055aed8c 100644
--- a/src/test/cli/osdmaptool/create-print.t
+++ b/src/test/cli/osdmaptool/create-print.t
@@ -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 {
diff --git a/src/test/cli/osdmaptool/create-racks.t b/src/test/cli/osdmaptool/create-racks.t
index a7c59f02b9c..b68099b7f67 100644
--- a/src/test/cli/osdmaptool/create-racks.t
+++ b/src/test/cli/osdmaptool/create-racks.t
@@ -265,8 +265,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 cephstore5522 {
diff --git a/src/test/cli/osdmaptool/crush.t b/src/test/cli/osdmaptool/crush.t
index c01c952b804..1d15bf4642a 100644
--- a/src/test/cli/osdmaptool/crush.t
+++ b/src/test/cli/osdmaptool/crush.t
@@ -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
diff --git a/src/test/cli/osdmaptool/tree.t b/src/test/cli/osdmaptool/tree.t
index 394a4f38436..fa55b4a9837 100644
--- a/src/test/cli/osdmaptool/tree.t
+++ b/src/test/cli/osdmaptool/tree.t
@@ -20,7 +20,7 @@
"id": -1,
"name": "default",
"type": "root",
- "type_id": 10,
+ "type_id": 11,
"children": [
-3
]
diff --git a/src/test/crush/crush-choose-args-expected-one-more-0.txt b/src/test/crush/crush-choose-args-expected-one-more-0.txt
index 23068e68c86..bad7f0becfe 100644
--- a/src/test/crush/crush-choose-args-expected-one-more-0.txt
+++ b/src/test/crush/crush-choose-args-expected-one-more-0.txt
@@ -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 {
diff --git a/src/test/crush/crush-choose-args-expected-one-more-3.txt b/src/test/crush/crush-choose-args-expected-one-more-3.txt
index 53cc3d11900..14cdd9c26d9 100644
--- a/src/test/crush/crush-choose-args-expected-one-more-3.txt
+++ b/src/test/crush/crush-choose-args-expected-one-more-3.txt
@@ -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 {