You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/persistent-storage-local-removing-devices.adoc
+64-18Lines changed: 64 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -6,16 +6,11 @@
6
6
[id="local-removing-device_{context}"]
7
7
= Removing a local volume or local volume set
8
8
9
-
Occasionally, local volumes and local volume sets must be deleted. While removing the entry in the resource and deleting the persistent volume is typically enough, if you want to reuse the same device path or have it managed by a different storage class, then additional steps are needed.
10
-
11
-
[NOTE]
12
-
====
13
-
The following procedure outlines an example for removing a local volume. The same procedure can also be used to remove symlinks for a local volume set custom resource.
14
-
====
9
+
Occasionally, you need to delete local volumes (LVs) and local volume sets (LVSs).
15
10
16
11
.Prerequisites
17
12
18
-
* The persistent volume must be in a `Released` or `Available` state.
13
+
* The persistent volume (PV) must be in a `Released` or `Available` state.
19
14
+
20
15
[WARNING]
21
16
====
@@ -24,33 +19,84 @@ Deleting a persistent volume that is still in use can result in data loss or cor
24
19
25
20
.Procedure
26
21
27
-
. Edit the previously created local volume to remove any unwanted disks.
22
+
To delete LVs or LVSs, complete the following steps:
23
+
24
+
. If there are any bound PVs owned by the LV or LVS that is being deleted, delete the corresponding persistent volume claims (PVCs) to release the PVs:
28
25
29
-
.. Edit the cluster resource:
26
+
.. To find bound PVs owned by a particular LV or LVS, run the following command:
30
27
+
28
+
[source, terminal]
29
+
----
30
+
$ oc get pv --selector storage.openshift.com/owner-name=<LV_LVS_name> <1>
Bound PVs have a status of `Bound` and their corresponding PVCs appear in the `CLAIM` column. In the preceding example, PV `local-pv-1cec77cf` is bound, and its PVC is `openshift/storage`.
35
43
36
-
.. Navigate to the lines under `devicePaths`, and delete any representing unwanted disks.
44
+
.. Delete corresponding PVCs of bound PVs owned by the LV or LVS being deleted by running the following command:
45
+
+
46
+
[source, terminal]
47
+
----
48
+
$ oc delete pvc <name>
49
+
----
50
+
+
51
+
In this example, you would delete PVC `openshift/storage`.
37
52
38
-
. Delete any persistent volumes created.
53
+
. Delete the LVs or LVSs by running the applicable following command:
54
+
+
55
+
.Command for deleting LV
39
56
+
40
57
[source,terminal]
41
58
----
42
-
$ oc delete pv <pv-name>
59
+
$ oc delete lv <name>
60
+
----
61
+
+
62
+
or
63
+
+
64
+
.Command for deleting LVS
65
+
[source,terminal]
66
+
----
67
+
$ oc delete lvs <name>
43
68
----
44
69
45
-
. Delete directory and included symlinks on the node.
70
+
. If any PV owned by the LV or LVS has a `Retain` reclaim policy, back up any important data, and then delete the PV:
46
71
+
47
-
[WARNING]
72
+
[NOTE]
48
73
====
49
-
The following step involves accessing a node as the root user. Modifying the state of the node beyond the steps in this procedure could result in cluster instability.
74
+
PVs with a `Delete` policy are automatically deleted when you delete the LVs or LVS.
50
75
====
51
76
+
77
+
.. To find PVs with `Retain` reclaim policy, run the following command:
0 commit comments