mon: add the {set,get} erasure_code_profile MonCommand

set erasure_code_profile parses the key=value pairs given in argument
and stores them in OSDMap::erasure_code_profile. The get
erasure_code_profile supports plain text display if the Formatter is not
set (or invalid).

  set erasure_code_profile myprofile a=b c=d

is stored as

  OSDMap::erasure_code_profile["myprofile"] = {"a":"b", "c":"d"}

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: replace pg_pool_t properties with erasure_code_profile

The generic map properties is only used for erasure code and should be
specialized. It is replaced by a string that can be looked up in
OSDMap::erasure_code_profiles to retrieve the key/value pairs that will
be interpreted by the erasure code plugin.

There is no upgrade path because properties is not found in any Ceph
release.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: OSDMonitor use erasure_code_profile instead of properties

The prepare_pool_properties is replaced with the
prepare_erasure_code_profile method which looks up the same content from
OSDMap::erasure_code_profiles instead of the argument vector.

The type and name substitution is applied in OSDMonitor and the
MonCommand prototypes for osd pool create and osd create-erasure are
updated.

The behavior is not modified.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: use erasure code profile when building the PGBackend

The PGBackend::build_pg_backend() prototype is modified to add an
OSDMapRef which is used to get the profile stored in the pg_pool_t
and pass it to the erasure code plugin.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: add crush ruleset name to osd pool create

The ruleset to be used for the new erasure coded pool was expected in
the properties, under the name crush_ruleset. It does not belong to the
erasure code profile and needs to be added to the prototype explicitly.

The crush ruleset name is added to the prototype of the prepare_new_pool
and prepare_pool_crush_ruleset methods.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: set the profile and ruleset defaults early

The poolstr is removed from the prepare_pool_crush_ruleset prototype
because it no longer decides for the default ruleset, if it is not
omitted by the caller of osd pool create.

If no profile
  profile = default
If no ruleset and profile is default
  ruleset = erasure-code
If no ruleset and profile is not default
  ruleset = the name of the pool

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: create erasure_code_profile in OSDMap::build_simple

The "default" erasure_code_profile is set by OSDMap::build_simple using
the osd_pool_default_erasure_code_profile default configuration option.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: create the erasure-code ruleset in OSDMap::build_simple

Using the "default" profile, add the matching erasure-code ruleset.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: add osd crush create-erasure functional tests

Cleanup the TEST_crush_rule_all function from redundant leftovers.
Explicitly test crush rule rm instead of implicitly.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd,mon: use profile instead of properties

The qa and functional tests are adapted to the new command prototype
requiring a profile instead of a list of properties. When possible the
implicit ruleset creation is used to simplify the test setup.

Signed-off-by: Loic Dachary <loic@dachary.org>
doc: update the erasure-code dev documentation

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