Bug 2059466

Summary: skip in-use loop devices during vgcreate/vgextend
Product: [Red Hat Storage] Red Hat OpenShift Data Foundation Reporter: Leela Venkaiah Gangavarapu <lgangava>
Component: lvm-operatorAssignee: Leela Venkaiah Gangavarapu <lgangava>
Status: CLOSED CURRENTRELEASE QA Contact: Aviad Polak <apolak>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.10CC: ebenahar, ikave, jolmomar, lgangava, mmuench, muagarwa, nibalach, ocs-bugs, odf-bz-bot, sapillai, srozen
Target Milestone: ---Keywords: AutomationBackLog
Target Release: ODF 4.10.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 4.10.0-175 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-21 09:12:50 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 Leela Venkaiah Gangavarapu 2022-03-01 06:02:56 UTC
Description of problem (please be detailed as possible and provide log
snippests):
- When PVCs with `volumeMode: Block` are created by Topolvm, if vg-manager pod restarts/reconciles then it's adding new created in-use block PVCs to the Volume Group

Version of all relevant components (if applicable):
- 4.10

Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)?
- Yes
- If app pods start consuming the block PVC and there'll be potential clash b/n data in Logical Volume and another new LV using the same underlying Physical Volume
- Basically, an unwanted cyclic dependency is created

Is there any workaround available to the best of your knowledge?
No

Rate from 1 - 5 the complexity of the scenario you performed that caused this
bug (1 - very simple, 5 - very complex)?
- 2

Can this issue reproducible?
- 100%

Can this issue reproduce from the UI?
- No

If this is a regression, please provide more details to justify this:
- No

Steps to Reproduce:
1. Deploy LVMO and create a `volumeMode: Block` PVC
2. Restart `vg-manager` pod and observe back-end loop devices which is backing the PVC created in step 1 incorrectly detected by vg-manager as usable device and existing volume group is extended

Actual results:
- Cyclic usage of block devices

Expected results:
- When a loop device is being used by k8s internally to support `volumeDevices` for a workload those devices should be skipped as not usable by vg-manager

Additional info:
-- Dev note:
- Loop devices created from truncated files which doesn't contain the string "plugins/kubernetes.io" in the backing file path can still be used for extending volume groups
- Fix exists in upstream main https://github.com/red-hat-storage/lvm-operator/pull/113

Comment 4 Aviad Polak 2022-04-10 15:20:07 UTC
looks good at 4.10:217