mon: MDS data and metadata pool numbers are hardcoded

The MDS assumes pool 0 and 1 are suitable for data and metadata
respectively. Instead of relying on the CEPH_DATA_RULE and
CEPH_METADATA_RULE constants that only match by chance, set a hardcoded
value specific to MDS to reduce the fragility of the hardcoded
assumption.

Signed-off-by: Loic Dachary <loic@dachary.org>
client: SyntheticClient uses the first available pool

It is unrelated to CEPH_DATA_RULE which is replaced by
SYNCLIENT_FIRST_POOL.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: factorize build_simple and build_simple_from_conf

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: build_simple creates a single rule

The three rules created by build_simple are identical. They are replaced
by a single rule named replicated_rule which is set to be used by the
data, rbd and metadata pools.

Instead of hardcoding the ruleset number to zero, it is read from
osd_pool_default_crush_rule which defaults to zero.

The CEPH_DEFAULT_CRUSH_REPLICATED_RULE enum is moved from osd_type.h to
config.h because it may be needed when osd_type.h is not included.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: osd-pool-create must not loop forever on kill

Looping forever on kill does not serve any useful purpose.
Reduce the verbosity of the exit trap to help diagnose error
conditions.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: implement --osd-pool-default-crush-rule-replicated

--osd-pool-default-crush-rule-replicated replaces
--osd-pool-default-crush-rule

If --osd-pool-default-crush-rule is set to a value that is not the
default, it takes precedence over
--osd-pool-default-crush-rule-replicated and a deprecation warning is
displayed.

The CrushWrapper::get_osd_pool_default_crush_replicated_rule helper is
used to implement this behaviour.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: implement --osd-pool-default-crush-erasure-rule

It must be different from the replicated default.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: create default ruleset for erasure pools

The ruleset --osd_pool_default_crush_erasure_rule is created to be
suitable for erasure coded pools when OSDMap::build_simple is required
to build the default OSD map of a new cluster.

Signed-off-by: Loic Dachary <loic@dachary.org>