Chapter 20. Create a Pool


Before creating pools, refer to the Pool, PG and CRUSH Config section of the Ceph Configuration Guide. Consider overriding the default value for the number of placement groups in you Ceph configuration file, as the default is NOT ideal. For example:

osd pool default pg num = 100
osd pool default pgp num = 100

To create a pool, execute:

ceph osd pool create <pool-name> <pg-num> [<pgp-num>] [replicated] \
         [crush-ruleset-name]
ceph osd pool create <pool-name> <pg-num>  <pgp-num>   erasure \
         [erasure-code-profile] [crush-ruleset-name]

Where:

<pool-name>

Description
The name of the pool. It must be unique.
Type
String
Required
Yes. Picks up default or Ceph configuration value if not specified.

<pg-num>

Description
The total number of placement groups for the pool. See Placement Groups for details on calculating a suitable number. The default value 8 is NOT suitable for most systems. Also, see Ceph Placement Groups per Pool Calculator.
Type
Integer
Required
Yes
Default
8

<pgp-num>

Description
The total number of placement groups for placement purposes. This should be equal to the total number of placement groups, except for placement group splitting scenarios.
Type
Integer
Required
Yes. Picks up default or Ceph configuration value if not specified.
Default
8

<replicated or erasure>

Description
The pool type which may either be replicated to recover from lost OSDs by keeping multiple copies of the objects or erasure to get a kind of generalized RAID5 capability. The replicated pools require more raw storage but implement all Ceph operations. The erasure pools require less raw storage but only implement a subset of the available operations.
Type
String
Required
No.
Default
replicated

[crush-ruleset-name]

Description
The name of the crush ruleset for this pool. If specified ruleset doesn’t exist, the creation of replicated pool will fail with -ENOENT. But replicated pool will create a new erasure ruleset with specified name.
Type
String
Required
No.
Default
"erasure-code" for erasure pool. Pick up Ceph configuration variable osd_pool_default_crush_replicated_ruleset for replicated pool.

[erasure-code-profile=profile]

Description
For erasure pools only. Use the erasure code profiles. It must be an existing profile as defined by osd erasure-code-profile set.
Type
String
Required
No.

When you create a pool, set the number of placement groups to a reasonable value (e.g., 100). Consider the total number of placement groups per OSD too. Placement groups are computationally expensive, so performance will degrade when you have many pools with many placement groups (e.g., 50 pools with 100 placement groups each). The point of diminishing returns depends upon the power of the OSD host.

See Placement Groups for details on calculating an appropriate number of placement groups for your pool. Also see Ceph Placement Groups (PGs) per Pool Calculator.

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.