Bug 1431122

Summary: Remove device operation should be allowed only for devices in offline state
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Prasanth <pprakash>
Component: heketiAssignee: Raghavendra Talur <rtalur>
Status: CLOSED ERRATA QA Contact: Prasanth <pprakash>
Severity: high Docs Contact:
Priority: unspecified    
Version: cns-3.4CC: hchiramm, mliyazud, pprakash, rhs-bugs, storage-qa-internal, vinug
Target Milestone: ---   
Target Release: CNS 3.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: heketi-4.0.0-2.el7rhgs Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-20 18:38:15 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: 1415600    

Description Prasanth 2017-03-10 12:33:37 UTC
Description of problem:

Remove device operation should be allowed only for disabled/offline devices. Currently it allows any device to be removed which are in online state and there is no check as such for this maintenance operation. So we should introduce a check to have this operation permitted ONLY on disabled/offline devices.

Version-Release number of selected component (if applicable):
heketi-cli 4.0.0

Comment 1 Raghavendra Talur 2017-03-13 08:33:38 UTC
patch in review. https://github.com/heketi/heketi/pull/710

Comment 5 Prasanth 2017-04-03 07:29:47 UTC
Verified as fixed.

#############
# heketi-cli device info 112158d6c384f01b7785446e84d66b6e
Device Id: 112158d6c384f01b7785446e84d66b6e
Name: /dev/sdf
State: online
Size (GiB): 15359
Used (GiB): 1
Free (GiB): 15358
Bricks:
Id:c7cdf3886cb3db988438779e4ff6540e   Size (GiB):1       Path: /var/lib/heketi/mounts/vg_112158d6c384f01b7785446e84d66b6e/brick_c7cdf3886cb3db988438779e4ff6540e/brick


# heketi-cli device remove 112158d6c384f01b7785446e84d66b6e
Error: Device must be offline before remove operation is performed, device:112158d6c384f01b7785446e84d66b6e
#############

Comment 7 errata-xmlrpc 2017-04-20 18:38:15 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-2017:1111