From b132696e54b1eb2398b1b16815599644543f55e7 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 25 Oct 2021 15:05:33 +0200 Subject: [PATCH] rbd: note that thick-provisioning is deprecated Thick-provisioning was introduced to make accounting of assigned space for volumes easier. When thick-provisioned volumes are the only consumer of the Ceph cluster, this works fine. However, it is unlikely that this is the case. Instead, accounting of the requested (thin-provisioned) size of volumes is much more practical as different types of volumes can be tracked. OpenShift already provides cluster-wide quotas, which can combine accounting of requested volumes by grouping different StorageClasses. In addition to the difficult practise of allowing only thick-provisioned RBD backed volumes, the performance makes thick-provisioning troublesome. As volumes need to be completely allocated, data needs to be written to the volume. This can take a long time, depending on the size of the volume. Provisioning, cloning and snapshotting becomes very much noticeable, and because of the additional time consumption, more prone to failures. Signed-off-by: Niels de Vos --- docs/deploy-rbd.md | 2 +- examples/rbd/storageclass.yaml | 7 ++++--- internal/rbd/controllerserver.go | 10 ++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/deploy-rbd.md b/docs/deploy-rbd.md index b80a5aa28..f8fa2dea1 100644 --- a/docs/deploy-rbd.md +++ b/docs/deploy-rbd.md @@ -64,7 +64,7 @@ make image-cephcsi | `mounter` | no | if set to `rbd-nbd`, use `rbd-nbd` on nodes that have `rbd-nbd` and `nbd` kernel modules to map rbd images | | `encrypted` | no | disabled by default, use `"true"` to enable LUKS encryption on PVC and `"false"` to disable it. **Do not change for existing storageclasses** | | `encryptionKMSID` | no | required if encryption is enabled and a kms is used to store passphrases | -| `thickProvision` | no | if set to `"true"`, newly created RBD images will be completely allocated by writing zeros to it | +| `thickProvision` | no | if set to `"true"`, newly created RBD images will be completely allocated by writing zeros to it (**DEPRECATED**: recommended alternative solution is to use accounting/quotas for created volumes) | **NOTE:** An accompanying CSI configuration file, needs to be provided to the running pods. Refer to [Creating CSI configuration](../examples/README.md#creating-csi-configuration) diff --git a/examples/rbd/storageclass.yaml b/examples/rbd/storageclass.yaml index 61182eb10..a53aace7c 100644 --- a/examples/rbd/storageclass.yaml +++ b/examples/rbd/storageclass.yaml @@ -29,9 +29,10 @@ parameters: # eg: pool: rbdpool pool: - # Set thickProvision to true if you want RBD images to be fully allocated on - # creation (thin provisioning is the default). - thickProvision: "false" + # Deprecated: Set thickProvision to true if you want RBD images to be fully + # allocated on creation (thin provisioning is the default). + # thickProvision: "false" + # (required) RBD image features, CSI creates image with image-format 2 # CSI RBD currently supports `layering`, `journaling`, `exclusive-lock` # features. If `journaling` is enabled, must enable `exclusive-lock` too. diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index 813634592..1b8c387bb 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -1502,6 +1502,10 @@ func (cs *ControllerServer) ControllerExpandVolume( }, nil } +// logThickProvisioningDeprecation makes sure the deprecation warning about +// thick-provisining is logged only once. +var logThickProvisioningDeprecation = true + // isThickProvisionRequest returns true in case the request contains the // `thickProvision` option set to `true`. func isThickProvisionRequest(parameters map[string]string) bool { @@ -1517,5 +1521,11 @@ func isThickProvisionRequest(parameters map[string]string) bool { return false } + if logThickProvisioningDeprecation { + log.WarningLogMsg("thick-provisioning is deprecated and will " + + "be removed in a future release") + logThickProvisioningDeprecation = false + } + return thickBool }