Bug 1968510 - OCS uninstall should check for Volumesnapshots before proceeding with graceful Uninstall
Summary: OCS uninstall should check for Volumesnapshots before proceeding with gracefu...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenShift Data Foundation
Classification: Red Hat Storage
Component: rook
Version: 4.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ODF 4.9.0
Assignee: yati padia
QA Contact: Anna Sandler
URL:
Whiteboard:
: 1893747 (view as bug list)
Depends On: 1893747
Blocks: 1882359
TreeView+ depends on / blocked
 
Reported: 2021-06-07 13:19 UTC by Mudit Agarwal
Modified: 2023-08-09 17:03 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1893747
Environment:
Last Closed: 2021-12-13 17:44:30 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:5086 0 None None None 2021-12-13 17:44:43 UTC

Comment 2 Mudit Agarwal 2021-06-07 13:22:11 UTC
Have opened this BZ to do the rook changes required for this issue.

Comment 3 Travis Nielsen 2021-07-26 15:59:09 UTC
@Yati Is this planned for 4.9?

Comment 4 yati padia 2021-07-26 16:38:47 UTC
Yes. Will be working on this soon.

Comment 5 Blaine Gardner 2021-08-16 16:21:16 UTC
@ypadia please be aware that there is now a design document in upstream Rook related to blocking uninstall/deletion when other resources exist (link below). When working on this, be sure to add this to the design as a first step so that we can evaluate how best to implement the feature in Rook.

https://github.com/rook/rook/blob/master/design/ceph/resource-dependencies.md

Comment 6 yati padia 2021-08-17 03:28:26 UTC
Thanks, @brgardne.Will add the details to the design doc.

Comment 7 yati padia 2021-09-01 14:13:35 UTC
As per the current changes in rook, it is required to delete the pool, before deleting the cluster and the pool deletion requires that there are no images/snapshots in the cluster.
Hence, I don't see any need to add the check for the presence of the PV or snapshot in the cluster. Even the PV check present in rook is not required. To my knowledge, this feature has been introduced
in 4.9 and hence this bug no more exists. 
@mrajanna do comment if I am missing anything.
@brgardne and @tnielsen would like to get a review from your end too.

Comment 8 Blaine Gardner 2021-09-01 15:32:52 UTC
That's good to hear, Yati. I think we might want to mention in Rook upstream docs that the forceful uninstall option will also continue with uninstall if volume snapshots exist. I'm not sure if we should update our downstream OCS/ODF docs as well, as I'm not as familiar with those docs.

Comment 9 Mudit Agarwal 2021-09-01 15:40:44 UTC
If we don't require a change here, this bug can be moved to ON_QA for the verification.

We can mention this in the uninstall documentation for Downstream.
Neha, who can help Yati with the documentation?

Comment 10 yati padia 2021-09-01 15:46:43 UTC
@muagarwa and @brgardne for upstream I have checked it. But would like to try the same with OCS4.9 before moving it on QA. Will update the bug tomorrow.

Comment 11 Mudit Agarwal 2021-09-08 14:05:17 UTC
Moving to ON_QA after discussing with Yati

Comment 14 Anna Sandler 2021-09-24 07:45:51 UTC
Created two PVCS
---------------------------------------------------------------------------------------
$ oc get pvc -A | grep test
default                    cephfs-test-pvc                             Bound    pvc-d631136d-2997-4682-ad61-898d917c3e3d   1Gi        RWO            ocs-storagecluster-cephfs     63s
default                    rbd-test-pvc                                Bound    pvc-96f47692-1e7a-439c-9714-22816bc76497   1Gi        RWO            ocs-storagecluster-ceph-rbd   119s


Created VS for each PVC
-------------------------------------------------------------------------------------
$ oc get volumesnapshot -A
NAMESPACE   NAME                       READYTOUSE   SOURCEPVC         SOURCESNAPSHOTCONTENT   RESTORESIZE   SNAPSHOTCLASS                               SNAPSHOTCONTENT                                    CREATIONTIME   AGE
default     cephfs-test-pvc-snapshot   true         cephfs-test-pvc                           1Gi           ocs-storagecluster-cephfsplugin-snapclass   snapcontent-3c30adc7-f3f2-4bb0-91fe-934a08d885eb   2m32s          2m32s
default     rbd-test-pvc-snapshot      true         rbd-test-pvc                              1Gi           ocs-storagecluster-rbdplugin-snapclass      snapcontent-f741536f-9439-452d-a641-a4d0688a94a4   3m2s           3m3s


Deleted the PVCs
--------------------------------------------------------------------------------
[asandler@fedora ~]$ oc delete pvc cephfs-test-pvc
persistentvolumeclaim "cephfs-test-pvc" deleted
[asandler@fedora ~]$ oc delete pvc rbd-test-pvc
persistentvolumeclaim "rbd-test-pvc" deleted


Deleted the storage cluster 
--------------------------------------------------------------------------------------
$ oc delete -n openshift-storage storagecluster --all --wait=true

And it got stuck on deleting :
$ oc get storagecluster -A
NAMESPACE           NAME                 AGE   PHASE      EXTERNAL   CREATED AT             VERSION
openshift-storage   ocs-storagecluster   59m   Deleting              2021-09-24T06:34:45Z   4.9.0



Deleted the volumesnapshots
------------------------------------------------------------------
$ oc get volumesnapshot -A
NAMESPACE   NAME                       READYTOUSE   SOURCEPVC         SOURCESNAPSHOTCONTENT   RESTORESIZE   SNAPSHOTCLASS                               SNAPSHOTCONTENT                                    CREATIONTIME   AGE
default     cephfs-test-pvc-snapshot   true         cephfs-test-pvc                           1Gi           ocs-storagecluster-cephfsplugin-snapclass   snapcontent-3c30adc7-f3f2-4bb0-91fe-934a08d885eb   16m            16m
default     rbd-test-pvc-snapshot      true         rbd-test-pvc                              1Gi           ocs-storagecluster-rbdplugin-snapclass      snapcontent-f741536f-9439-452d-a641-a4d0688a94a4   17m            17m
[asandler@fedora ~]$ oc delete volumesnapshot cephfs-test-pvc-snapshot
volumesnapshot.snapshot.storage.k8s.io "cephfs-test-pvc-snapshot" deleted
[asandler@fedora ~]$ oc delete volumesnapshot rbd-test-pvc-snapshot
volumesnapshot.snapshot.storage.k8s.io "rbd-test-pvc-snapshot" deleted
[asandler@fedora ~]$ oc get volumesnapshot -A
No resources found


And storagecluster deletion completed
-------------------------------------------------------------
$ oc get storagecluster -A
No resources found


moving to verified

Comment 15 Mudit Agarwal 2021-09-24 16:25:49 UTC
*** Bug 1893747 has been marked as a duplicate of this bug. ***

Comment 21 errata-xmlrpc 2021-12-13 17:44:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Red Hat OpenShift Data Foundation 4.9.0 enhancement, security, and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:5086


Note You need to log in before you can comment on or make changes to this bug.