Bug 1434685

Summary: heketi delete device should not delete the device when the device is online
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: krishnaram Karthick <kramdoss>
Component: heketiAssignee: John Mulligan <jmulligan>
Status: CLOSED ERRATA QA Contact: bipin <bshetty>
Severity: high Docs Contact:
Priority: unspecified    
Version: cns-3.5CC: bshetty, hchiramm, jmulligan, kramdoss, madam, pprakash, rcyriac, rhs-bugs, rreddy, rtalur, storage-qa-internal, vinug
Target Milestone: ---Keywords: ZStream
Target Release: OCS 3.11.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: heketi-8.0.0-1.el7rhgs Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-07 03:41:00 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:
Bug Depends On:    
Bug Blocks: 1641915, 1644154    

Description krishnaram Karthick 2017-03-22 07:13:00 UTC
Description of problem:
'heketi delete device' deletes any device which doesn't have any bricks including the devices which are online.

'heketi delete device' should work only on either of 2 conditions.
1) device is offline
2) device is removed already - (Any device removed will already be in offline state)

heketi-cli device info 78a602555f5a232fb1e917be434e7813
Device Id: 78a602555f5a232fb1e917be434e7813
Name: /dev/sdd
State: online
Size (GiB): 99
Used (GiB): 0
Free (GiB): 99
Bricks:
[root@dhcp46-202 ~]# heketi-cli device delete 78a602555f5a232fb1e917be434e7813
Device 78a602555f5a232fb1e917be434e7813 deleted

This is to stay consistent with the remove device behavior. remove device works only when the device is offline. Similarly, delete device should work only when the device is in offline or removed state.

Version-Release number of selected component (if applicable):
heketi-client-4.0.0-3.el7rhgs.x86_64

How reproducible:
Always

No logs shall be attached, this issue is fairly straight forward to reproduce.

Comment 2 Raghavendra Talur 2017-03-22 07:17:20 UTC
delete device proceeds this way only when device is empty. When the device has bricks, it wouldn't allow the device to be deleted and the admin will have to follow procedure of disable,remove and then delete.

Comment 9 Humble Chirammal 2017-08-03 04:40:26 UTC
No objection to move this out of CNS 3.6 release. I am changing the flags accordingly.

Comment 20 errata-xmlrpc 2019-02-07 03:41:00 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/RHEA-2019:0286