Bug 1761752

Summary: mgr/volumes: missing protection for `fs volume rm` command
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Ram Raja <rraja>
Component: CephFSAssignee: Jos Collin <jcollin>
Status: CLOSED ERRATA QA Contact: Hemanth Kumar <hyelloji>
Severity: low Docs Contact:
Priority: medium    
Version: 4.0CC: ceph-eng-bugs, ceph-qe-bugs, hyelloji, pdonnell, sweil, tchandra, tserlin
Target Milestone: rc   
Target Release: 4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-31 12:47:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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