Bug 1434306

Summary: Can not remove Cinder provider even if the service is not available anymore.
Product: Red Hat Enterprise Virtualization Manager Reporter: Andreas Stolzenberger <astolzen>
Component: ovirt-engineAssignee: Daniel Erez <derez>
Status: CLOSED CURRENTRELEASE QA Contact: Natalie Gavrielov <ngavrilo>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.1.0CC: alex, amureini, astolzen, lsurette, mtessun, ratamir, rbalakri, Rhev-m-bugs, srevivo, ykaul, ylavi
Target Milestone: ovirt-4.2.0   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
A "Force Remove" button has been added to the Administration > Providers screen. Currently, it applies only to volume providers (Cinder). It removes the provider from the database, along with all related entities, such as storage domain, virtual machines, templates, and disks.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-22 13:09:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andreas Stolzenberger 2017-03-21 08:56:13 UTC
Description of problem:
Defined external provider (Cinder). Added Cinder Disk. Deinstalled Cinder.
-> Cannot remove the RHV config of the Cinder Disk or the Provider itself, after deleting the source

Version-Release number of selected component (if applicable):
4.x

How reproducible:
Always

Steps to Reproduce:
1. Add cinder provider, add cinder disk
2. delete cinder (the service, not the provider)
3. try to remove cinder ressources on RHV

Actual results:
fails to remove nonexisting provider (since a disk is still defined)
Disk can't be deleted (nonexistent) -> provider can't be deleted (Chicken? Egg?)

Expected results:
Option: Force remove Provider & Disk

Additional info:

Comment 1 Oved Ourfali 2017-03-22 06:19:02 UTC
This functionality should be provider specific. 
If needed, we can do the "wrapping" around the, but makes sense that the first use of that in the code will do it all. 

Allon, I'm moving to storage, but if you want us to add the infra for that and only you guys implement the provider specific part then let me know.

Comment 2 Andreas Stolzenberger 2017-08-07 08:09:38 UTC
>> This functionality should be provider specific.

This is not the first "undeletable" ressource inside Ovirt because of ressource dependencies -- and it probably won't be the last.
Why not implement a generic "Delete this ressource XXX -- I know what I'm doing"-Function for Storage, Networks, Providers, whatever ressource. Maybe implement an additionall "Are you really really sure" Question to that. But as an Ovirt Admin, I'd like to remove whatever I think needs to be removed, no matter what existing, damaged, currently unavailable or nonexisting dependencies are attached to that.

Otherwise, you'll fore Ovirt Admins to mess around with the postgress tables directly.

Comment 3 Yaniv Kaul 2017-08-07 09:23:16 UTC
(In reply to Andreas Stolzenberger from comment #2)
> >> This functionality should be provider specific.
> 
> This is not the first "undeletable" ressource inside Ovirt because of
> ressource dependencies -- and it probably won't be the last.
> Why not implement a generic "Delete this ressource XXX -- I know what I'm
> doing"-Function for Storage, Networks, Providers, whatever ressource. Maybe
> implement an additionall "Are you really really sure" Question to that. But
> as an Ovirt Admin, I'd like to remove whatever I think needs to be removed,
> no matter what existing, damaged, currently unavailable or nonexisting
> dependencies are attached to that.
> 
> Otherwise, you'll fore Ovirt Admins to mess around with the postgress tables
> directly.

Are you sure you cannot remove the disk? I believe we have force remove for such entities. If we don't, this is the bug.
Having 'force remove' without thinking of the consequences WILL cause dangling, zombie objects to remain in the database. This is sometimes worse.

Comment 4 Daniel Erez 2017-08-16 14:23:02 UTC
Force remove of disks should be available when the disk is in status Illegal. I.e. removal of a disk in status Illegal is merely a DB operation that deleted the disk from the database. For example, a disk is moved to an Illegal status upon a failure of a storage removal. Then, when trying to remove again, we skip to storage part and just remove it from the database.

However, other related entities (such as VMs and Templates) are still kept in the database, which prevent the removal of the provider. The suggested solution is to have a provider force removal which simply invokes the operation of force remove storage domain. I.e. an existing flow that is tested and should be safe.

Comment 5 Andreas Stolzenberger 2017-10-16 11:23:06 UTC
> Are you sure you cannot remove the disk?
Yes. 
> I believe we have force remove for
> such entities.
No.

Comment 6 rhev-integ 2017-11-02 13:38:47 UTC
INFO: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[No relevant external trackers attached]

For more info please contact: rhv-devops