5.4. Assigning custom attributes to different Ceph pools

By default, Ceph Storage pools created with director have the same number of placement groups (pg_num and pgp_num) and sizes. You can use either method in 5章Customizing the Ceph Storage cluster to override these settings globally. Doing so applies the same values to all pools.

Use the CephPools parameter to apply different attributes to each Ceph Storage pool or create a new custom pool.

Procedure

  1. Replace POOL with the name of the pool that you want to configure:

    parameter_defaults:
      CephPools:
        - name: POOL
  2. Configure placement groups by doing one of the following:

    • To manually override the default settings, set pg_num to the number of placement groups:

      parameter_defaults:
        CephPools:
          - name: POOL
            pg_num: 128
            application: rbd
    • Alternatively, to automatically scale placement groups, set pg_autoscale_mode to True and set target_size_ratio to a percentage relative to your expected Ceph Storage requirements:

      parameter_defaults:
        CephPools:
          - name: POOL
            pg_autoscale_mode: True
            target_size_ratio: PERCENTAGE
            application: rbd

      Replace PERCENTAGE with a decimal. For example, 0.5 equals 50 percent. The total percentage must equal 1.0 or 100 percent.

      The following values are for example only:

      paramter_defaults:
        CephPools:
          - {"name": backups, "target_size_ratio": 0.1, "pg_autoscale_mode": True, "application": rbd}
          - {"name": volumes, "target_size_ratio": 0.5, "pg_autoscale_mode": True, "application": rbd}
          - {"name": vms,     "target_size_ratio": 0.2, "pg_autoscale_mode": True, "application": rbd}
          - {"name": images,  "target_size_ratio": 0.2, "pg_autoscale_mode": True, "application": rbd}

      For more information, see The placement group autoscaler in the Red Hat Ceph Storage Installation Guide.

  3. Specify the application type.

    The application type for Compute, Block Storage, and Image Storage is`rbd`. However, depending on what you use the pool for, you can specify a different application type.

    For example, the application type for the gnocchi metrics pool is openstack_gnocchi. For more information, see Enable Application in the Storage Strategies Guide .

    注記

    If you do not use the CephPools parameter, director sets the appropriate application type automatically, but only for the default pool list.

  4. Optional: Add a pool called custompool to create a custom pool, and set the parameters specific to the needs of your environment:

    parameter_defaults:
      CephPools:
        - name: custompool
          pg_num: 128
          application: rbd
ヒント

For typical pool configurations of common Ceph use cases, see the Ceph Placement Groups (PGs) per Pool Calculator. This calculator is normally used to generate the commands for manually configuring your Ceph pools. In this deployment, the director configures the pools based on your specifications.

警告

Red Hat Ceph Storage 3 (Luminous) introduced a hard limit on the maximum number of PGs an OSD can have, which is 200 by default. Do not override this parameter beyond 200. If there is a problem because the Ceph PG number exceeds the maximum, adjust the pg_num per pool to address the problem, not the mon_max_pg_per_osd.