Bug 1761752 - mgr/volumes: missing protection for `fs volume rm` command
Summary: mgr/volumes: missing protection for `fs volume rm` command
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat
Component: CephFS
Version: 4.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: 4.0
Assignee: Jos Collin
QA Contact: Hemanth Kumar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-15 09:45 UTC by Ram Raja
Modified: 2020-01-31 12:47 UTC (History)
7 users (show)

Fixed In Version: ceph-14.2.4-32.el8cp, ceph-14.2.4-2.el7cp
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-31 12:47:36 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 42149 0 None None None 2019-10-15 09:45:28 UTC
Red Hat Product Errata RHBA-2020:0312 0 None None None 2020-01-31 12:47:46 UTC

Internal Links: 1775266

Description Ram Raja 2019-10-15 09:45:29 UTC
Description of problem:
We can create a Ceph filesytem/volume using rook by issuing a mgr volume command,
`ceph fs volume create vol00`. We can then remove it using `ceph fs volume rm vol00`. Since removing a filesystem is a destructive operation (pools/data permanently destroyed), we need added an protection say `ceph fs volume rm vol00 --yes-i-really-mean-it`.



How reproducible: Always


Steps to Reproduce:
1. Setup rook as the Ceph's orchestrator
   https://docs.ceph.com/docs/master/mgr/orchestrator_cli/#configuration
   ```
   ceph mgr module enable rook
   ceph orchestrator set backend rook
   ```
2. Create a filesystem/volume as follows using a ceph client
   ```
   ceph fs volume create vol00
   ```
3. Try removing the volume,
   ```
   ceph fs volume rm vol00
   ```

Actual results:
Volume removal passes


Expected results:
Volume removal should fail. You should need an additional flag `--yes-i-really-mean-it` appended to the command to remove the volume.
```
ceph fs volume rm vol00 --yes-i-really-mean-it
```

Comment 6 Hemanth Kumar 2019-12-26 13:49:41 UTC
Verified in build : ceph version 14.2.4-91.el8cp (23607558df3b077b6190cdf96cd8d9043aa2a1c5) nautilus (stable)

Now we get a prompt with additional confirmation (--yes-i-really-mean-it) while deleting a volume 

[root@magna113 ~]# ceph fs volume rm vols
Error EPERM: WARNING: this will *PERMANENTLY DESTROY* all data stored in the filesystem 'vols'. If you are *ABSOLUTELY CERTAIN* that is what you want, re-issue the command followed by --yes-i-really-mean-it.

Moving to verified

Comment 8 errata-xmlrpc 2020-01-31 12:47:36 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, 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/RHBA-2020:0312


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