Bug 1867400 - [OCs 4.5]UI should not allow creation of second storagecluster of different mode in a single OCS
Summary: [OCs 4.5]UI should not allow creation of second storagecluster of different m...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Console Storage Plugin
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.7.0
Assignee: Afreen
QA Contact: Neha Berry
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-09 16:21 UTC by Neha Berry
Modified: 2021-02-24 15:15 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:15:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
screencast of the new alert window (1.30 MB, video/webm)
2021-02-08 07:49 UTC, Neha Berry
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 7829 0 None closed Bug 1867400: Not allow creation of second storagecluster 2021-02-18 15:37:10 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:15:56 UTC

Description Neha Berry 2020-08-09 16:21:32 UTC
Description of problem (please be detailed as possible and provide log
snippests):
----------------------------------------------------------------------
UI allows creation of a second StorageCluster of a different mode which should be blocked. The 2nd Storagecluster is in IGNORED state but with no suitable message for the same. This can be confusing to the users

Either we should completely block a new storagecluster creation in case one already exists or we should have a proper reasoning for the IGNORED state of the 2nd SCluster. Otherwise, users might not undertsand the reason of the newly created Scluster to be in IGNORED state

Not sure if this is a bug in ocs-operator or management-console, hence raising it in management-console for the start

>> These are the various observations from multiple scenarios


>> 1. Storagecluster1 : Mode = Internal , Storagecluster2: Mode= External 

   1a) Storagecluster2 Creation succeeds and is not blocked from UI. But the Storagecluster is in Ignored state

>> 2. Storagecluster1 : Mode = external , Storagecluster2: Mode= Internal

   1a) Storagecluster2 Creation succeeds and is not blocked from UI. But, as expected, the Storagecluster is in Ignored state


>> 3. Try creating a second Storagecluster of same mode type: (This is rejected in UI itself)

   1a) If Storagecluster1:Mode = Internal, Creating 2nd storagecluster with same mode throws error due [storageclusters.ocs.openshift.io "ocs-storagecluster" already exists]
   1b) If Storagecluster1:Mode = external, Creating storagecluster2 with same mode throws error due to [secret "rook-ceph-external-cluster-details" already exists]

   1c) try creating from CLI with a different name, Storagecluster creation succeeds but enters "Ignored" state

Snip of the outputs
======================

for #1
$ oc get storagecluster
NAME                          AGE    PHASE     EXTERNAL   CREATED AT             VERSION
ocs-external-storagecluster   46h    Ignored   true       2020-08-07T18:01:58Z   
ocs-storagecluster            3d2h   Ready                2020-08-06T13:45:06Z   4.5.0

$ oc describe storagecluster ocs-external-storagecluster

Status:
  Phase:  Ignored
Events:   <none>


Version of all relevant components (if applicable):
----------------------------------------------------------------------
OCP  = 4.5.0-0.nightly-2020-08-07-024812

OCS = ocs-operator.v4.5.0-515.ci

Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)?
----------------------------------------------------------------------
No

Is there any workaround available to the best of your knowledge?
----------------------------------------------------------------------
No. The UI doesnt reject the 2nd storagecluster creation


Rate from 1 - 5 the complexity of the scenario you performed that caused this
bug (1 - very simple, 5 - very complex)?
----------------------------------------------------------------------
2

Can this issue reproducible?
----------------------------------------------------------------------
Yes

Can this issue reproduce from the UI?
----------------------------------------------------------------------
Yes

If this is a regression, please provide more details to justify this:
----------------------------------------------------------------------
No. But new modes(Internal & external) are introduced from current OCS 4.5 release onwards

Steps to Reproduce:
----------------------------------------------------------------------
1. Create an OCS cluster with any appropriate mode ,  e.g. Internal
2. Try to create a second Storagecluster with another mode, e.g. external
 Installed Operators-> OCS Operator->Storage Cluster-> Create New Storage Cluster Service-> Select a different Mode than existing Storagecluster

Actual results:
----------------------------------------------------------------------
UI doesn't block creation of the 2nd storagecluster, even though ultimately PHASE= IGNORED


Expected results:
----------------------------------------------------------------------
UI should block creation of 2nd storagecluster. and if that cannot be achieved, atleast proper UI message(this cluster will be in IGNORED state) and description should be added for "Ignored" state

Additional info:
----------------------------------------------------------------------


$ oc describe storagecluster ocs-external-storagecluster
Name:         ocs-external-storagecluster
Namespace:    openshift-storage
Labels:       <none>
Annotations:  <none>
API Version:  ocs.openshift.io/v1
Kind:         StorageCluster
Metadata:
  Creation Timestamp:  2020-08-07T18:01:58Z
  Generation:          1
  Managed Fields:
    API Version:  ocs.openshift.io/v1
    Fields Type:  FieldsV1
    fieldsV1:
      f:spec:
        .:
        f:externalStorage:
          .:
          f:enable:
        f:labelSelector:
    Manager:      Mozilla
    Operation:    Update
    Time:         2020-08-07T18:01:58Z
    API Version:  ocs.openshift.io/v1
    Fields Type:  FieldsV1
    fieldsV1:
      f:spec:
        f:version:
      f:status:
        .:
        f:phase:
    Manager:         ocs-operator
    Operation:       Update
    Time:            2020-08-07T18:01:58Z
  Resource Version:  958967
  Self Link:         /apis/ocs.openshift.io/v1/namespaces/openshift-storage/storageclusters/ocs-external-storagecluster
  UID:               56dacde5-b94c-4b6d-a9ac-855b85dc8094
Spec:
  External Storage:
    Enable:  true
  Label Selector:
    Match Expressions:
Status:
  Phase:  Ignored
Events:   <none>

Comment 3 Bipul Adhikari 2020-08-21 06:19:41 UTC
Need UX Input on where and what message to show.

Comment 4 Shiri mordechay 2020-08-23 08:05:23 UTC
Is it possible to turn this CR to [Internal] after one storage cluster is created for this use case? 
It will be a temporary solution until the creation of storage cluster will be a part of the operator installation flow (which is planned for 4.7/4.8). In that flow we will not have this CR after the installation is completed.

Comment 5 Ankush Behl 2020-09-14 17:30:31 UTC
>> Is it possible to turn this CR to [Internal] after one storage cluster is created for this use case? 

@shiri, We can't edit the CSV itself to make it internal not a right approch. We just need a proper message to be displayed to used the blocking from UI is already happening. 

Let do a proper fix for 4.7/4.8.

Comment 6 Shiri mordechay 2020-10-21 12:41:42 UTC
This will be solved as part of the Wizard changes: https://marvelapp.com/prototype/12i47i8j/screen/73606066
@afrahman

Comment 7 Jeff Brown 2020-11-30 15:50:18 UTC
Yuval, are you taking this as Shiri is leaving?  Do you have any updates?

Comment 8 Yuval 2020-12-16 11:47:03 UTC
we already shared a UI suggestion of how to solve this issue, see design: https://marvelapp.com/prototype/12i47i8j/screen/73606066

Comment 9 Filip Balák 2021-02-05 09:07:07 UTC
(In reply to Yuval from comment #8)
> we already shared a UI suggestion of how to solve this issue, see design:
> https://marvelapp.com/prototype/12i47i8j/screen/73606066

I suggest to disable Create button after one StorageCluster is created so that user can not access installation wizard at all when StorageCluster is installed. There can be a tooltip on the disabled button with note why it is disabled.

Comment 12 Neha Berry 2021-02-08 07:49:38 UTC
Created attachment 1755647 [details]
screencast of the new alert window

Verified the fix on a Vmware based internal mode cluster:

OCP = 4.7.0-0.nightly-2021-02-06-084550
OCS = ocs-operator.v4.7.0-254.ci


Steps Performed:
=====================
1. Install OCP 4.7 latest nightly
2. Install latest OCS 4.7 nightly accepted build
3. Navigate to Installed Operators->Operator details->Storagecluster tab
4. Click on Create Storage Cluster button

Observation:
=================
A warning alert window appears

A warning Alert window with two clickable options appears on the screen,  (even before we can select any different/same mode) which informs that "Storage Cluster exists"

Storage Cluster exists
A storage cluster ocs-storagecluster is already created.
You cannot create another storage cluster.

P.S: but the CLose (X) button on the new window does not work, hence raised a new bug to track the fix for this issue : Bug 1926072

Based on the fact that UI now blocks users to create a 2nd storagecluster if one already exists, moving this BZ to verified state.

Though, IMHO, there is a scope to make a slight change in the content of the Alert window(to be tracked in the same new bug 1926072#c2)

Comment 17 errata-xmlrpc 2021-02-24 15:15:27 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: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement 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-2020:5633


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