Skip to content

Commit

Permalink
Describe clone-strategy annotation (#2243)
Browse files Browse the repository at this point in the history
Describes the possibility to configure preferred clone method on storageClass by using annotation.
The original change that introduced it #2004

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>
  • Loading branch information
brybacki committed Apr 22, 2022
1 parent 8a2cada commit d7ae7d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions doc/efficient-cloning.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ _The required prerequisites in order to trigger efficient cloning methods_
* CSI Volume Cloning: [csi-cloning](./csi-cloning.md)
* Smart Cloning: [smart-clone](./smart-clone.md)
* Namespace Transfer: [namespace-transfer](./namespace-transfer.md)
* StorageProfile (description of cloneStrategy): [storageprofile](./storageprofile.md)
24 changes: 13 additions & 11 deletions doc/storageprofile.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ Current version supports the following parameters:

Values for accessModes and volumeMode are exactly the same as for PVC: `accessModes` is a list of `[ReadWriteMany|ReadWriteOnce|ReadOnlyMany]`
and `volumeMode` is a single value `Filesystem` or `Block`.
The value for `cloneStrategy` can be one of: `copy`,`snapshot`,`csi-clone`.
Multiple claim property sets can be specified (`claimPropertySets` is a list).

The value for `cloneStrategy` can be one of: `copy`,`snapshot`,`csi-clone`.
When the value is not specified the CDI will try to use the `snapshot` if possible otherwise it falls back to `copy`.
If the storage class (and its provider) is capable of doing CSI Volume Clone then the user may choose `csi-clone` as a preferred clone method.

Multiple claim property sets can be specified (`claimPropertySets` is a list).
StorageClass can be annotated with `cdi.kubevirt.io/clone-strategy`. The annotation value can be one of: `copy`,`snapshot`,`csi-clone`.
CDI is using this annotation value when configuring the clone strategy on storage profile.
This is helpful for known provisioners that want different behavior for certain configurations in the storage class


## Handling the DV with defaults from Storage Profiles

Expand Down Expand Up @@ -203,16 +208,13 @@ Notice the event on the DV.
## User defined Storage Profile

User with access rights to edit StorageProfile can configure recommended parameters. Edit spec section of StorageProfile by adding claimPropertySets with accessModes and volumeMode.
When editting volumeMode you must also configure accessModes.
When editing volumeMode you must also configure accessModes.
Shortly, all provided parameters should be visible in the status section. User defined parameter has higher priority and overrides the one provided by CDI.

## Priorities

1. Parameter defined on DataVolume
2. User provided parameters - defined on StorageProfile spec section.
3. Parameters provided by CDI.
4. Empty or kubernetes defaults (if available).




1. Overrides (for example `cdi.Spec.CloneStrategyOverride`)
2. Parameter defined on DataVolume
3. User provided parameters - defined on StorageProfile spec section.
4. Parameters provided by CDI.
5. Empty or kubernetes defaults (if available).

0 comments on commit d7ae7d4

Please sign in to comment.