Skip to content

Commit 40a721e

Browse files
Merge pull request #62557 from ShaunaDiaz/OSDOCS-6534
OSDOCS-6534: adding CSI snapshotting
2 parents d41e075 + 172ea7f commit 40a721e

20 files changed

+601
-5
lines changed

_topic_maps/_topic_map_ms.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ Topics:
142142
File: expanding-persistent-volumes-microshift
143143
- Name: Dynamic storage using the LVMS plugin
144144
File: microshift-storage-plugin-overview
145+
- Name: Working with volume snapshots
146+
File: volume-snapshots-microshift
145147
---
146148
Name: Running applications
147149
Dir: microshift_running_apps

microshift_storage/microshift-storage-plugin-overview.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ include::modules/microshift-lvmd-yaml-creating.adoc[leveloffset=+1]
1818

1919
include::modules/microshift-lvms-config-example-basic.adoc[leveloffset=+1]
2020

21-
include::modules/microshift-lvms-using.adoc[leveloffset=+1]
21+
include::modules/microshift-lvms-using.adoc[leveloffset=+1]
22+
23+
include::modules/microshift-storage-device-classes.adoc[leveloffset=+2]
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
:_content-type: ASSEMBLY
2+
[id="working-with-volume-snapshots-microshift"]
3+
= Working with volume snapshots
4+
include::_attributes/attributes-microshift.adoc[]
5+
:context: volume-snapshots-microshift
6+
7+
toc::[]
8+
9+
Cluster administrators can use volume snapshots to help protect against data loss by using the supported {product-title} logical volume manager storage (LVMS) Container Storage Interface (CSI) provider. Familiarity with xref:../microshift_storage/understanding-persistent-storage-microshift.adoc#persistent-volumes_understanding-persistent-storage-microshift[persistent volumes] is required.
10+
11+
A snapshot represents the state of the storage volume in a cluster at a particular point in time. Volume snapshots can also be used to provision new volumes. Snapshots are created as read-only logical volumes (LVs) located on the same device as the original data.
12+
13+
A cluster administrator can complete the following tasks using CSI volume snapshots:
14+
15+
* Create a snapshot of an existing persistent volume claim (PVC).
16+
* Back up a volume snapshot to a secure location.
17+
* Restore a volume snapshot as a different PVC.
18+
* Delete an existing volume snapshot.
19+
20+
[IMPORTANT]
21+
====
22+
Only the logical volume manager storage (LVMS) plugin CSI driver is supported by {product-title}.
23+
====
24+
25+
//additional resources for assembly intro; trailing because 1) relevant here, 2) TOC levels, and 2) last called module has addt'l resources
26+
[role="_additional-resources"]
27+
.Additional resources
28+
29+
* xref:../microshift_storage/understanding-persistent-storage-microshift.adoc#persistent-volumes_understanding-persistent-storage-microshift[Understanding persistent volumes]
30+
31+
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/{op-system-version-major}/html/configuring_and_managing_logical_volumes/creating-and-managing-thin-provisioned-volumes_configuring-and-managing-logical-volumes[Configuring and managing logical volumes]
32+
33+
* link:https://access.redhat.com/documentation/en-us/openshift_container_platform/{ocp-version}/html/storage/using-container-storage-interface-csi#persistent-storage-csi-snapshots[CSI snapshots: `VolumeSnapshot` APIs]
34+
35+
* link:https://docs.openshift.com/container-platform/{ocp-version}/rest_api/storage_apis/volumesnapshot-snapshot-storage-k8s-io-v1.html[VolumeSnapshot API specification]
36+
37+
include::modules/microshift-lvm-thin-volumes.adoc[leveloffset=+1]
38+
39+
//additional resources for thin volumes module
40+
[role="_additional-resources"]
41+
.Additional resources
42+
43+
* To create a thin pool on the host, see link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/{op-system-version-major}/html/configuring_and_managing_logical_volumes/creating-and-managing-thin-provisioned-volumes_configuring-and-managing-logical-volumes[Creating and managing thin provisioned volumes]
44+
45+
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/{op-system-version-major}/html/configuring_and_managing_logical_volumes/creating-and-managing-thin-provisioned-volumes_configuring-and-managing-logical-volumes#creating-thinly-provisioned-logical-volumes_creating-and-managing-thin-provisioned-volumes[Creating thinly provisioned logical volumes]
46+
47+
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/{op-system-version-major}/html/configuring_and_managing_logical_volumes/creating-and-managing-thin-provisioned-volumes_configuring-and-managing-logical-volumes[Configuring and managing thin provisioned volumes]
48+
49+
* xref:../microshift_storage/volume-snapshots-microshift.adoc#microshift-storage-classes_volume-snapshots-microshift[Storage classes]
50+
51+
* xref:../microshift_storage/microshift-storage-plugin-overview.adoc#microshift-storage-device-classes_microshift-storage-plugin-overview[Storage device classes]
52+
53+
include::modules/microshift-storage-classes.adoc[leveloffset=+2]
54+
55+
//additional resources for storage classes module
56+
[role="_additional-resources"]
57+
.Additional resources
58+
59+
* link:https://access.redhat.com/documentation/en-us/openshift_container_platform/{ocp-version}/html/storage/dynamic-provisioning#defining-storage-classes_dynamic-provisioning[Defining storage classes]
60+
61+
* xref:../microshift_storage/microshift-storage-plugin-overview.adoc#microshift-storage-device-classes_microshift-storage-plugin-overview[Storage device classes]
62+
63+
include::modules/microshift-storage-vol-snapshot-class.adoc[leveloffset=+1]
64+
65+
//additional resources for volume snapshot classes module
66+
[role="_additional-resources"]
67+
.Additional resources
68+
69+
* link:https://docs.openshift.com/container-platform/{ocp-version}/storage/container_storage_interface/persistent-storage-csi-snapshots.html#volume-snapshot-crds[OpenShift CSI volume snapshots]
70+
71+
include::modules/microshift-storage-about-vol-snapshots.adoc[leveloffset=+1]
72+
73+
include::modules/microshift-storage-creating-vol-snapshot.adoc[leveloffset=+2]
74+
75+
include::modules/microshift-storage-backup-volume-snapshots.adoc[leveloffset=+2]
76+
77+
include::modules/microshift-storage-vol-snapshot-restore.adoc[leveloffset=+2]
78+
79+
//additional resources for volume snapshot restore module
80+
[role="_additional-resources"]
81+
.Additional resources
82+
83+
* link:https://access.redhat.com/documentation/en-us/openshift_container_platform/{ocp-version}/html/storage/using-container-storage-interface-csi#persistent-storage-csi-snapshots-provision_persistent-storage-csi-snapshots[Restoring a volume snapshot]
84+
85+
//this module is reused from OCP; take care in editing for MicroShift
86+
include::modules/persistent-storage-csi-snapshots-delete.adoc[leveloffset=+2]
87+
88+
include::modules/microshift-storage-volume-cloning.adoc[leveloffset=+1]
89+
90+
//additional resources for volume cloning module
91+
[role="_additional-resources"]
92+
.Additional resources
93+
94+
* link:https://docs.openshift.com/container-platform/{ocp-version}/storage/container_storage_interface/persistent-storage-csi-cloning.html[CSI volume cloning]
95+
96+
* link:https://access.redhat.com/documentation/en-us/openshift_container_platform/{ocp-version}/html/storage/configuring-persistent-storage#lvms-creating-volume-clones-in-single-node-openshift_logical-volume-manager-storage[LVMS volume cloning for Single-Node OpenShift]
97+
98+
* To configure the host to enable cloning, see xref:../microshift_storage/volume-snapshots-microshift.adoc#microshift-lvm-thin-volumes_volume-snapshots-microshift[About LVM thin volumes]
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift_storage/volume-snapshots-microshift.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="microshift-lvm-thin-volumes_{context}"]
7+
= About LVM thin volumes
8+
9+
To use advanced storage features such as creating volume snapshots or volume cloning, you must perform the following actions:
10+
11+
* Configure both the logical volume manager storage (LVMS) provider and the cluster.
12+
* Provision a logical volume manager (LVM) thin-pool on the {op-system-ostree} host.
13+
* Attach LVM thin-pools to a volume group.
14+
15+
[IMPORTANT]
16+
====
17+
To create Container Storage Interface (CSI) snapshots, you must configure thin volumes on the {op-system-ostree} host. The CSI does not support volume shrinking.
18+
====
19+
20+
For LVMS to manage thin logical volumes (LVs), a thin-pool `device-class` array must be specified in the `etc/lvmd.yaml` configuration file. Multiple thin-pool device classes are permitted.
21+
22+
If additional storage pools are configured with device classes, then additional storage classes must also exist to expose the storage pools to users and workloads. To enable dynamic provisioning on a thin-pool, a `StorageClass` resource must be present on the cluster. The `StorageClass` resource specifies the source `device-class` array in the `topolvm.io/device-class` parameter.
23+
24+
.Example `lvmd.yaml` file that specifies a single device class for a thin-pool
25+
26+
[source, yaml]
27+
----
28+
socket-name: <1>
29+
device-classes: <2>
30+
- name: thin <3>
31+
default: true
32+
spare-gb: 0 <4>
33+
thin-pool:
34+
name: thin
35+
overprovision-ratio: 10 <5>
36+
type: thin <6>
37+
volume-group: ssd <7>
38+
----
39+
[.small]
40+
<1> String. The UNIX domain socket endpoint of gRPC. Defaults to `/run/lvmd/lvmd.socket`.
41+
<2> A list of maps for the settings for each `device-class`.
42+
<3> String. The unique name of the `device-class`.
43+
<4> Unsigned 64-bit integer. Storage capacity in GB to be left unallocated in the volume group. Defaults to `0`.
44+
<5> If you have multiple thin-provisioned devices that share the same pool, then these devices can be over-provisioned. Over-provisioning requires a float value of 1 or greater.
45+
<6> Thin provisioning is required to create volume snapshots.
46+
<7> String. The group where the `device-class` creates the logical volumes.
47+
48+
[IMPORTANT]
49+
====
50+
When multiple PVCs are created simultaneously, a race condition prevents LVMS from accurately tracking the allocated space and preserving the storage capacity for a device class. Use separate volume groups and device classes to protect the storage of highly dynamic workloads from each other.
51+
====

modules/microshift-lvms-config-example-basic.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
{product-title} supports passing through your LVM configuration and allows you to specify custom volume groups, thin volume provisioning parameters, and reserved unallocated volume group space. You can edit the LVMS configuration file you created at any time. You must restart {product-title} to deploy configuration changes after editing the file.
1010

11+
[NOTE]
12+
====
13+
If you need to take volume snapshots, you must use thin provisioning in your `lvmd.conf` file. If you do not need to take volume snapshots, you can use thick volumes.
14+
====
15+
1116
The following `lvmd.yaml` example file shows a basic LVMS configuration:
1217

1318
.LVMS configuration example
@@ -25,7 +30,7 @@ device-classes: <2>
2530
<2> A list of maps for the settings for each `device-class`.
2631
<3> String. The name of the `device-class`.
2732
<4> String. The group where the `device-class` creates the logical volumes.
28-
<5> Unsigned 64-bit integer. Storage capacity in GiB to be left unallocated in the volume group. Defaults to `0`.
33+
<5> Unsigned 64-bit integer. Storage capacity in GB to be left unallocated in the volume group. Defaults to `0`.
2934
<6> Boolean. Indicates that the `device-class` is used by default. Defaults to `false`. At least one value must be entered in the YAML file values when this is set to `true`.
3035

3136
[IMPORTANT]

0 commit comments

Comments
 (0)