Skip to content

Commit

Permalink
doc: design doc for stale volume cleanup
Browse files Browse the repository at this point in the history
this commit adds a design doc for including cleanup
of stale subvolumes.

Signed-off-by: yati1998 <ypadia@redhat.com>
  • Loading branch information
yati1998 committed Dec 11, 2023
1 parent 1193742 commit da11ed9
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions docs/subvolume.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Subvolume cleanup

The subvolume command is used to clean the stale subvolumes
which have no parent-pvc attached to them.
The command would list out all such subvolumes which needs to be removed.
This would consider all the cases where we can have stale subvolume
and delete them without impacting other resources and attached volumes.

The subvolume command will require the following sub commands:
* `ls` : [ls](#ls) lists all the subvolumes
* `--stale`: lists only stale subvolumes
* `delete <subvolumes> <filesystem> <subvolumegroup>`:
[delete](#delete) stale subvolumes as per user's input.
It will list and delete only the stale subvolumes to prevent any loss of data.
* subvolumes: comma-separated list of subvolumes of same filesystem and subvolumegroup.
* filesystem: filesystem name to which the subvolumes belong.
* subvolumegroup: subvolumegroup name to which the subvolumes belong.
## ls

```bash
kubectl rook-ceph subvolume ls

# Filesystem Subvolume SubvolumeGroup State
# ocs-storagecluster-cephfilesystem csi-vol-427774b4-340b-11ed-8d66-0242ac110004 csi in-use
# ocs-storagecluster-cephfilesystem csi-vol-427774b4-340b-11ed-8d66-0242ac110005 csi in-use
# ocs-storagecluster-cephfilesystem csi-vol-427774b4-340b-11ed-8d66-0242ac110006 csi in-use
# ocs-storagecluster-cephfilesystem csi-vol-427774b4-340b-11ed-8d66-0242ac110007 csi stale

```

```bash
kubectl rook-ceph subvolume ls --stale

# Filesystem Subvolume SubvolumeGroup state
# ocs-storagecluster-cephfilesystem csi-vol-427774b4-340b-11ed-8d66-0242ac110004 csi stale
# ocs-storagecluster-cephfilesystem csi-vol-427774b4-340b-11ed-8d66-0242ac110005 csi stale

```

## delete

```bash
kubectl rook-ceph subvolume delete csi-vol-427774b4-340b-11ed-8d66-0242ac110004 ocs-storagecluster csi

# Info: subvolume csi-vol-427774b4-340b-11ed-8d66-0242ac110004 deleted

```

```bash
kubectl rook-ceph subvolume delete csi-vol-427774b4-340b-11ed-8d66-0242ac110004,csi-vol-427774b4-340b-11ed-8d66-0242ac110005 ocs-storagecluster csi

# Info: subvolume csi-vol-427774b4-340b-11ed-8d66-0242ac110004 deleted
# Info: subvolume csi-vol-427774b4-340b-11ed-8d66-0242ac110004 deleted

```

0 comments on commit da11ed9

Please sign in to comment.