Bug 1508006 - OpenStack provider removal do not clean related networks in the database
Summary: OpenStack provider removal do not clean related networks in the database
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: GA
: cfme-future
Assignee: Gilles Dubreuil
QA Contact: Ola Pavlenko
URL:
Whiteboard:
Depends On:
Blocks: 1468726
TreeView+ depends on / blocked
 
Reported: 2017-10-31 16:42 UTC by Andrea Perotti
Modified: 2021-03-11 16:09 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-24 01:57:53 UTC
Category: Bug
Cloudforms Team: Openstack
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Duplicate Network Screenshot (99.78 KB, image/jpeg)
2017-10-31 16:44 UTC, Andrea Perotti
no flags Details
PL/PGSQL Script example (1.85 KB, text/plain)
2017-11-20 03:44 UTC, Gilles Dubreuil
no flags Details

Description Andrea Perotti 2017-10-31 16:42:20 UTC
Description of problem:
After removing and reconecting an Openstack provider, all the networks are duplicated as the screenshot attached. is there a way to fix this behavior?

Version-Release number of selected component (if applicable):
5.8.1

Steps to Reproduce:
1. Connect OpenStack provider to CFME
2. See Cloud Networks and verify they are associated to a Network Provider
3. Remove the OpenStack provider
4. Reconnect the OpenStack provider
2. See Cloud Networks again

Actual results:
Cloud Networks are duplicated, one instance associated to a Network Provider and the other one with NO netword provider

Expected results:
Cloud Networks are present in single instance

Comment 2 Andrea Perotti 2017-10-31 16:44:35 UTC
Created attachment 1346006 [details]
Duplicate Network Screenshot

Comment 21 Gilles Dubreuil 2017-11-20 03:44:38 UTC
Created attachment 1355481 [details]
PL/PGSQL Script example

Although not recommended this is a script example to remove some 'ems_id' orphans.

Replace the 'ems_id value' then execute, from a pslq session:

$ psql -U username cfme
cfme=# \i cleanup.sql 
cfme=# select from cleanup_cfme();

Comment 22 Gilles Dubreuil 2018-01-24 01:57:53 UTC
Although this issue cannot be reproduced consistently the it's understood it  might happen in some scenario. 

The provided solution, which recommend to use backup instead of altering CloudForm database, is to mitigate the effects in case it happens again.

For the long term, upstream work has taken it in consideration to avoid it as much as possible.

If this issue is happening again please re-open the case or create a new case if experiencing it with a different version.


Note You need to log in before you can comment on or make changes to this bug.