MCPcopy Create free account
hub / github.com/ceph/ceph / create_pool

Method create_pool

qa/tasks/ceph_manager.py:2232–2279  ·  view source on GitHub ↗

Create a pool named from the pool_name parameter. :param pool_name: name of the pool being created. :param pg_num: initial number of pgs. :param erasure_code_profile_name: if set and !None create an erasure coded pool using t

(self, pool_name, pg_num=16,
                    erasure_code_profile_name=None,
                    erasure_code_crush_rule_name=None,
                    min_size=None,
                    erasure_code_use_overwrites=False)

Source from the content-addressed store, hash-verified

2230 self.remove_pool(pool_name)
2231
2232 def create_pool(self, pool_name, pg_num=16,
2233 erasure_code_profile_name=None,
2234 erasure_code_crush_rule_name=None,
2235 min_size=None,
2236 erasure_code_use_overwrites=False):
2237 """
2238 Create a pool named from the pool_name parameter.
2239 :param pool_name: name of the pool being created.
2240 :param pg_num: initial number of pgs.
2241 :param erasure_code_profile_name: if set and !None create an
2242 erasure coded pool using the profile
2243 :param erasure_code_crush_rule_name: if set and !None create an
2244 erasure coded pool using the crush rule
2245 :param erasure_code_use_overwrites: if true, allow overwrites
2246 """
2247 with self.lock:
2248 assert isinstance(pool_name, str)
2249 assert isinstance(pg_num, int)
2250 assert pool_name not in self.pools
2251 self.log("creating pool_name %s" % (pool_name,))
2252 if erasure_code_profile_name:
2253 cmd_args = ['osd', 'pool', 'create',
2254 pool_name, str(pg_num),
2255 str(pg_num), 'erasure',
2256 erasure_code_profile_name]
2257
2258 if erasure_code_crush_rule_name:
2259 cmd_args.extend([erasure_code_crush_rule_name])
2260 self.raw_cluster_cmd(*cmd_args)
2261 else:
2262 self.raw_cluster_cmd('osd', 'pool', 'create',
2263 pool_name, str(pg_num))
2264 if min_size is not None:
2265 self.raw_cluster_cmd(
2266 'osd', 'pool', 'set', pool_name,
2267 'min_size',
2268 str(min_size))
2269 if erasure_code_use_overwrites:
2270 self.raw_cluster_cmd(
2271 'osd', 'pool', 'set', pool_name,
2272 'allow_ec_overwrites',
2273 'true')
2274 self.raw_cluster_cmd(
2275 'osd', 'pool', 'application', 'enable',
2276 pool_name, 'rados', '--yes-i-really-mean-it',
2277 run.Raw('||'), 'true')
2278 self.pools[pool_name] = pg_num
2279 time.sleep(1)
2280
2281 def add_pool_snap(self, pool_name, snap_name):
2282 """

Callers 11

poolMethod · 0.95
taskFunction · 0.95
taskFunction · 0.95
initFunction · 0.45
taskFunction · 0.45
taskFunction · 0.45
taskFunction · 0.45
setupFunction · 0.45
_setup_poolMethod · 0.45
_setup_poolMethod · 0.45

Calls 4

raw_cluster_cmdMethod · 0.95
extendMethod · 0.80
logMethod · 0.45
sleepMethod · 0.45

Tested by 3

initFunction · 0.36
setupFunction · 0.36
_setup_poolMethod · 0.36