Module - ceph_pools_pg_protection

This module provides for the following ansible plugin:

  • ceph_pools_pg_protection

Module Documentation

The Ceph PG overdose protection check (https://ceph.com/community/new-luminous-pg-overdose-protection) is executed by Ceph before a pool is created. If the check does not pass, then the pool is not created.

When TripleO deploys Ceph it triggers ceph-ansible which creates the pools that OpenStack needs.

This validation runs the same check that the overdose protection uses to determine if the user should update their CephPools, PG count, or number of OSDs. Without this check a deployer may have to wait until after Ceph is running, but before the pools are created to realize the deployment will fail.

Used by the ceph-pg validation.

Owned by the "DFG:Storage Squad:Ceph"

Options

num_osds

The number of Ceph OSDs expected to be running during Pool creation.

TripleO does not have this parameter

In theory you can derive this parameter from TripleO parameters

ceph_pool_default_size

The same as the TripleO CephPoolDefaultSize parameter

Number of replicas of the data

ceph_pool_default_pg_num

The same as the TripleO CephPoolDefaultPgNum parameter

The default number of Placement Groups a pool should have

Ceph defaults this number to 16

TripleO defaults this number to 128

ceph_pools

The same as the TripleO CephPools parameter

A list of dictionaries

Each embedded dict must have a name parameter

Optional pg_num and size parameters may be set per pool

Authors

John Fulton (fultonj)

Example Tasks

- name: Is the CephPools parameter configured correctly?
  ceph_pools_pg_protection:
    num_osds: 36
    ceph_pool_default_size: 3
    ceph_pool_default_pg_num: 128
    ceph_pools:
    - {name: volumes, pg_num: 1024, pgp_num: 1024, application: rbd, size: 3}
    - {name: vms, pg_num: 512, pgp_num: 512, application: rbd, size: 3}
    - {name: images, pg_num: 128, pgp_num: 128, application: rbd, size: 3}
    register: pool_creation_simulation
- name: Fail if CephPools parameter is not configured correctly
  fail:
    msg: pool_creation_simulation["message"]
  when: not pool_creation_simulation["valid_input"]

# Call this module from within TripleO Heat Templates (if only num_osds was derived)
- name: Is the CephPools parameter configured correctly?
  ceph_pools_pg_protection:
    num_osds: 36
    ceph_pool_default_size: {get_param: CephPoolDefaultSize}
    ceph_pool_default_pg_num: {get_param: CephPoolDefaultPgNum}
    ceph_pools: {get_param: CephPools}
    register: pool_creation_simulation