-
-
Save zhouyuan/f8aebbbd533d10187e677b7dbaa84875 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/deploy/mod/deploy.py b/deploy/mod/deploy.py | |
index 9d66690..b098236 100644 | |
--- a/deploy/mod/deploy.py | |
+++ b/deploy/mod/deploy.py | |
@@ -39,6 +39,7 @@ class Deploy(object): | |
self.cluster["ceph_conf"]["osd"]["osd_data"] = "/var/lib/ceph/mnt/osd-device-$id-data" | |
self.cluster["collector"] = self.all_conf_data.get_list("collector") | |
self.cluster["ceph_disk"] = {} | |
+ self.cluster["disk_format"] = self.all_conf_data.get("disk_format") | |
for key, value in self.all_conf_data.get_group("ceph_hard_config").items(): | |
section_name = "global" | |
@@ -156,7 +157,8 @@ class Deploy(object): | |
'giant': '0.87', | |
'hammer': '0.94', | |
'infernalis': '9.2', | |
- 'jewel': '10.2'} | |
+ 'jewel': '10.2', | |
+ 'kraken': '11.1'} | |
for node, version_code in installed.items(): | |
if version == "": | |
for release_name, short_version in version_map.items(): | |
@@ -289,6 +291,23 @@ class Deploy(object): | |
cephconf.append(" mon addr = %s\n" % self.cluster["mons"][mon]) | |
backend_storage = self.cluster["ceph_conf"]["global"]["osd_objectstore"] | |
+ | |
+ disk_format_list = common.parse_disk_format(self.cluster["disk_format"]) | |
+ if backend_storage == "filestore": | |
+ assert(2 == len(disk_format_list)) | |
+ osd_pos = disk_format_list.index("osd") | |
+ journal_pos = disk_format_list.index("journal") | |
+ elif backend_storage == "bluestore": | |
+ assert(3 <= len(disk_format_list)) | |
+ assert(4 >= len(disk_format_list)) | |
+ osd_pos = disk_format_list.index("osd") | |
+ block_pos = disk_format_list.index("data") | |
+ if (3 == len(disk_format_list)): | |
+ db_wal_pos = disk_format_list.index("db_wal") | |
+ else: | |
+ db_pos = disk_format_list.index("db") | |
+ wal_pos = disk_format_list.index("wal") | |
+ | |
for osd in sorted(osds): | |
for device_bundle in common.get_list(osd_dict[osd]): | |
device_bundle_len = len(device_bundle) | |
@@ -298,33 +317,32 @@ class Deploy(object): | |
cephconf.append(" public addr = %s\n" % osds[osd]["public"]) | |
cephconf.append(" cluster addr = %s\n" % osds[osd]["cluster"]) | |
if ceph_disk: | |
- cephconf.append(" devs = %s\n" % (device_bundle[0])) | |
+ cephconf.append(" devs = %s\n" % (device_bundle[osd_pos])) | |
else: | |
- cephconf.append(" devs = %s\n" % device_bundle[0]) | |
+ cephconf.append(" devs = %s\n" % device_bundle[osd_pos]) | |
if device_bundle_len == 1 or device_bundle[1] == "": | |
continue | |
if ceph_disk: | |
if backend_storage == "filestore": | |
- cephconf.append(" osd journal = %s\n" % (device_bundle[1])) | |
+ cephconf.append(" osd journal = %s\n" % (device_bundle[journal_pos])) | |
else: | |
- cephconf.append(" bluestore_block_path = %s\n" % (device_bundle[1])) | |
+ cephconf.append(" bluestore_block_path = %s\n" % (device_bundle[block_pos])) | |
else: | |
if backend_storage == "filestore": | |
- cephconf.append(" osd journal = %s\n" % device_bundle[1]) | |
+ cephconf.append(" osd journal = %s\n" % device_bundle[journal_pos]) | |
else: | |
- cephconf.append(" bluestore_block_path = %s\n" % device_bundle[1]) | |
+ cephconf.append(" bluestore_block_path = %s\n" % device_bundle[block_pos]) | |
if device_bundle_len == 2 or backend_storage == "filestore": | |
continue | |
- if ceph_disk: | |
- cephconf.append(" bluestore_block_db_path = %s\n" % (device_bundle[2])) | |
- else: | |
- cephconf.append(" bluestore_block_db_path = %s\n" % device_bundle[2]) | |
+ | |
+ # bluestore specific | |
if device_bundle_len == 3: | |
+ cephconf.append(" bluestore_block_db_path = %s\n" % (device_bundle[db_wal_pos])) | |
continue | |
- if ceph_disk: | |
- cephconf.append(" bluestore_block_wal_path = %s\n" % (device_bundle[3])) | |
- else: | |
- cephconf.append(" bluestore_block_wal_path = %s\n" % device_bundle[3]) | |
+ if device_bundle_len == 4: | |
+ cephconf.append(" bluestore_block_db_path = %s\n" % (device_bundle[db_pos])) | |
+ cephconf.append(" bluestore_block_wal_path = %s\n" % device_bundle[wal_pos]) | |
+ | |
for bluestore_block_path in self.bluestore_block_pathes: | |
if osds[osd].has_key(bluestore_block_path): | |
cephconf.append(" %s = %s\n" % (bluestore_block_path, osds[osd][bluestore_block_path])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment