@@ -20,29 +20,22 @@ def preflight(self) -> None:
20
20
state_data ["report" ]["osdmap" ]
21
21
)
22
22
23
+ are_custom_metadata_pool_names_supported = self .k8s .get_rook_flag (
24
+ "mds_support_metadata_name" , True
25
+ )
26
+
23
27
for mds_fs_data in state_data ["fs" ]["ls" ]:
24
- if not mds_fs_data ["metadata_pool" ].endswith ("-metadata" ):
28
+ if not (
29
+ are_custom_metadata_pool_names_supported
30
+ and mds_fs_data ["metadata_pool" ].endswith ("-metadata" )
31
+ ):
25
32
self .logger .warn (
26
33
"ceph-mds filesystem '{0}' uses an incompatible pool metadata name '{1}' and can not be migrated to Rook automatically" .format (
27
34
mds_fs_data ["name" ], mds_fs_data ["metadata_pool" ]
28
35
)
29
36
)
30
37
31
- # Store pools for incompatible MDS filesystem as migrated ones
32
- migrated_pools = self .machine .get_execution_state_data (
33
- "MigrateMdsPoolsHandler" , "migrated_pools" , default_value = []
34
- )
35
-
36
- if mds_fs_data ["metadata_pool" ] not in migrated_pools :
37
- migrated_pools .append (mds_fs_data ["metadata_pool" ])
38
-
39
- for pool_data_osd_name in mds_fs_data ["data_pools" ]:
40
- if pool_data_osd_name not in migrated_pools :
41
- migrated_pools .append (pool_data_osd_name )
42
-
43
- state = self .machine .get_execution_state ("MigrateMdsPoolsHandler" )
44
- if state is not None :
45
- state .migrated_pools = migrated_pools
38
+ self ._handle_mds_metadata_pool_not_supported (mds_fs_data )
46
39
47
40
continue
48
41
@@ -92,6 +85,23 @@ def get_readable_key_value_state(self) -> Dict[str, str]:
92
85
93
86
return kv_state_data
94
87
88
+ def _handle_mds_metadata_pool_not_supported (self , mds_fs_data : Any ) -> None :
89
+ # Store pools for incompatible MDS filesystem as migrated ones
90
+ migrated_pools = self .machine .get_execution_state_data (
91
+ "MigrateMdsPoolsHandler" , "migrated_pools" , default_value = []
92
+ )
93
+
94
+ if mds_fs_data ["metadata_pool" ] not in migrated_pools :
95
+ migrated_pools .append (mds_fs_data ["metadata_pool" ])
96
+
97
+ for pool_data_osd_name in mds_fs_data ["data_pools" ]:
98
+ if pool_data_osd_name not in migrated_pools :
99
+ migrated_pools .append (pool_data_osd_name )
100
+
101
+ state = self .machine .get_execution_state ("MigrateMdsPoolsHandler" )
102
+ if state is not None :
103
+ state .migrated_pools = migrated_pools
104
+
95
105
def _migrate_pool (self , pool : Dict [str , Any ]) -> None :
96
106
migrated_mds_pools = self .machine .get_execution_state_data (
97
107
"MigrateMdsPoolsHandler" , "migrated_mds_pools" , default_value = []
@@ -118,6 +128,11 @@ def _migrate_pool(self, pool: Dict[str, Any]) -> None:
118
128
"mds_placement_label" : self .k8s .mds_placement_label ,
119
129
}
120
130
131
+ if self .k8s .get_rook_flag ("mds_support_metadata_name" , True ):
132
+ filesystem_definition_values ["mds_name" ] = pool_metadata_osd_configuration [
133
+ "pool_name"
134
+ ]
135
+
121
136
filesystem_definition_values ["data_pools" ] = []
122
137
123
138
for pool_data_osd_name in pool ["data" ]:
0 commit comments