Bug 1511097

Summary: Better error description for multliple attach
Product: OpenShift Container Platform Reporter: Jan Safranek <jsafrane>
Component: StorageAssignee: Jan Safranek <jsafrane>
Status: CLOSED ERRATA QA Contact: Jianwei Hou <jhou>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.7.0CC: aos-bugs, aos-storage-staff, bchilds, mjahangi
Target Milestone: ---   
Target Release: 3.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-28 14:11:22 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 Jan Safranek 2017-11-08 16:41:22 UTC
When user runs two pods that use the same PV we send this event:
Multi-Attach error for volume "pvc-61e094bc-b375-11e7-b95b-02d8407159d1" Volume is already exclusively attached to one node and can't be attached to another.

What we should do:

- check on what node is the volume attached
- check if there is a pod on the node that uses the volume
  - if so, send an event to user that explicitly mentions that pod XYZ already uses the volume and it must be killed first
  - if not, log an error that would say where the volume is attached and that there is no pod that uses it and something is badly broken. We should send an event somewhere, but not to user - he can't do anything with it.

Comment 1 Jan Safranek 2017-11-23 11:58:16 UTC
>   - if not, log an error that would say where the volume is attached and 
> that there is no pod that uses it and something is badly broken. We should 
> send an event somewhere, but not to user - he can't do anything with it.

Still, the user should see something so he knows what's going on and he can ask admin to fix it (or fill a bug and we'll see at least the faulty nodes).


Upstream PR: https://github.com/kubernetes/kubernetes/pull/56288
(sends both events to user)

Comment 2 Jan Safranek 2018-01-19 10:09:31 UTC
still pending upstream...

Comment 4 Jan Safranek 2018-01-25 14:45:13 UTC
Origin 3.9 PR: https://github.com/openshift/origin/pull/18290

Comment 5 Jan Safranek 2018-02-02 09:47:44 UTC
Merged today

Comment 7 Jianwei Hou 2018-02-22 04:57:27 UTC
Verified on v3.9.0-0.47.0

Steps
1. Create a PV with block volume, gluster-block for example
2. Create an RC with replicas=2
3. Verify the description for multi-attach:
```
  Warning  FailedAttachVolume     1h                attachdetach-controller             Multi-Attach error for volume "pvc-bb2d1def-177d-11e8-b77c-0050569f5abb" Volume is already used by pod(s) vpod-skhtb
```

Comment 10 errata-xmlrpc 2018-03-28 14:11:22 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-2018:0489