]> git.proxmox.com Git - pve-docs.git/blobdiff - pveceph.adoc
close #4031: vm: import: simplify example for creating VM from existing disk
[pve-docs.git] / pveceph.adoc
index abc749b15920793fd36e4f7cea266c22c6cfc453..737f13b2510ff82b9b2776fa2291fad2f3c46c48 100644 (file)
@@ -499,7 +499,7 @@ make better decisions.
 .Example for creating a pool over the CLI
 [source,bash]
 ----
-pveceph pool create <name> --add_storages
+pveceph pool create <pool-name> --add_storages
 ----
 
 TIP: If you would also like to automatically define a storage for your
@@ -548,75 +548,96 @@ manual.
 
 
 [[pve_ceph_ec_pools]]
-Erasure Coded (EC) Pools
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-Erasure coded (EC) pools can offer more usable space for the price of
-performance. In replicated pools, multiple replicas of the data are stored
-('size'). In erasure coded pool, data is split into 'k' data chunks with
-additional 'm' coding chunks.  The coding chunks can be used to recreate data
-should data chunks be missing.  The number of coding chunks, 'm', defines how
-many OSDs can be lost without losing any data.  The total amount of objects
-stored is 'k + m'.
-
-The default 'min_size' of an EC pool depends on the 'm' parameter. If 'm = 1',
-the 'min_size' of the EC pool will be 'k'. The 'min_size' will be 'k + 1' if
-'m > 1'. The Ceph documentation recommends a conservative 'min_size' of 'k + 2'
+Erasure Coded Pools
+~~~~~~~~~~~~~~~~~~~
+
+Erasure coding (EC) is a form of `forward error correction' codes that allows
+to recover from a certain amount of data loss. Erasure coded pools can offer
+more usable space compared to replicated pools, but they do that for the price
+of performance.
+
+For comparision: in classic, replicated pools, multiple replicas of the data
+are stored (`size`) while in erasure coded pool, data is split into `k` data
+chunks with additional `m` coding (checking) chunks. Those coding chunks can be
+used to recreate data should data chunks be missing.
+
+The number of coding chunks, `m`, defines how many OSDs can be lost without
+losing any data. The total amount of objects stored is `k + m`.
+
+Creating EC Pools
+^^^^^^^^^^^^^^^^^
+
+You can create erasuce coded (EC) through using the `pveceph` CLI tooling. As
+EC code work different than replicated pools, planning a setup and the pool
+parameters used needs to adapt.
+
+The default `min_size` of an EC pool depends on the `m` parameter. If `m = 1`,
+the `min_size` of the EC pool will be `k`. The `min_size` will be `k + 1` if
+`m > 1`. The Ceph documentation recommends a conservative `min_size` of `k + 2`
 footnote:[Ceph Erasure Coded Pool Recovery
 {cephdocs-url}/rados/operations/erasure-code/#erasure-coded-pool-recovery].
 
-If there are less than 'min_size' OSDs available, any IO to the pool will be
+If there are less than `min_size` OSDs available, any IO to the pool will be
 blocked until there are enough OSDs available again.
 
-NOTE: When planning an erasure coded pool, keep an eye on the 'min_size' as it
+NOTE: When planning an erasure coded pool, keep an eye on the `min_size` as it
 defines how many OSDs need to be available. Otherwise, IO will be blocked.
 
-For example, an EC pool with 'k = 2' and 'm = 1' will have 'size = 3',
-'min_size = 2' and will stay operational if one OSD fails. If the pool is
-configured with 'k = 2', 'm = 2', it will have a 'size = 4' and 'min_size = 3'
+For example, an EC pool with `k = 2` and `m = 1` will have `size = 3`,
+`min_size = 2` and will stay operational if one OSD fails. If the pool is
+configured with `k = 2`, `m = 2`, it will have a `size = 4` and `min_size = 3`
 and stay operational if one OSD is lost.
 
 To create a new EC pool, run the following command:
 
 [source,bash]
 ----
-pceveph pool create <pool name> --erasure-coding k=2,m=1
+pveceph pool create <pool-name> --erasure-coding k=2,m=1
 ----
 
-Optional parameters are 'failure-domain' and 'device-class'. If you
+Optional parameters are `failure-domain` and `device-class`. If you
 need to change any EC profile settings used by the pool, you will have to
 create a new pool with a new profile.
 
 This will create a new EC pool plus the needed replicated pool to store the RBD
-omap and other metadata. In the end, there will be a '<pool name>-data' and
-'<pool name>-metada' pool. The default behavior is to create a matching storage
+omap and other metadata. In the end, there will be a `<pool name>-data` and
+`<pool name>-metada` pool. The default behavior is to create a matching storage
 configuration as well. If that behavior is not wanted, you can disable it by
-providing the '--add_storages 0' parameter.  When configuring the storage
-configuration manually, keep in mind that the 'data-pool' parameter needs to be
+providing the `--add_storages 0` parameter.  When configuring the storage
+configuration manually, keep in mind that the `data-pool` parameter needs to be
 set. Only then will the EC pool be used to store the data objects. For example:
 
-NOTE: The optional parameters '--size', '--min_size' and '--crush_rule' will be
+NOTE: The optional parameters `--size`, `--min_size` and `--crush_rule` will be
 used for the replicated metadata pool, but not for the erasure coded data pool.
-If you need to change the 'min_size' on the data pool, you can do it later.
-The 'size' and 'crush_rule' parameters cannot be changed on erasure coded
+If you need to change the `min_size` on the data pool, you can do it later.
+The `size` and `crush_rule` parameters cannot be changed on erasure coded
 pools.
 
-[source,bash]
-----
-pvesm add rbd <storage name> --pool <replicated pool> --data-pool <ec pool>
-----
-
 If there is a need to further customize the EC profile, you can do so by
 creating it with the Ceph tools directly footnote:[Ceph Erasure Code Profile
 {cephdocs-url}/rados/operations/erasure-code/#erasure-code-profiles], and
-specify the profile to use with the 'profile' parameter.
+specify the profile to use with the `profile` parameter.
 
 For example:
 [source,bash]
 ----
-pceveph pool create <pool name> --erasure-coding profile=<profile name>
+pveceph pool create <pool-name> --erasure-coding profile=<profile-name>
+----
+
+Adding EC Pools as Storage
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You can also add an already existing EC pool as storage to {pve}, it works the
+same as adding any `RBD` pool but requires to pass the extra `data-pool`
+option.
+
+[source,bash]
+----
+pvesm add rbd <storage-name> --pool <replicated-pool> --data-pool <ec-pool>
 ----
 
+TIP: Do not forget to add the `keyring` and `monhost` option for any external
+ceph clusters, not managed by the local {pve} cluster.
 
 Destroy Pools
 ~~~~~~~~~~~~~