Bug 1389818

Summary: engine-cleanup should clean rhv environment with any version
Product: Red Hat Enterprise Virtualization Manager Reporter: Marina Kalinin <mkalinin>
Component: ovirt-engineAssignee: Yedidyah Bar David <didi>
Status: CLOSED WONTFIX QA Contact: meital avital <mavital>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.0.3CC: didi, djasa, gklein, lsurette, mkalinin, oourfali, pstehlik, rbalakri, Rhev-m-bugs, srevivo, ykaul, ylavi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-07 09:14:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Marina Kalinin 2016-10-28 18:35:02 UTC
Description of problem:
If migration process from 3.6 to 4.0 fails, engine-cleanup should be able cleaning it, to revert the environment back to clean state after failed restore of 3.6 backup.

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

How reproducible:


Steps to Reproduce:
1) a full backup of a 3.6 setup (make sure there is a DC or a cluster in 3.6 with CL 3.4)
2) installation RHEL 7 with RHV packages
3) import of the backup with 'engine-backup --mode=restore'
4) run engine-setup, that will fail with:

2016-10-21 11:23:03 DEBUG otopi.ovirt_engine_setup.engine_common.database database.execute:222 Result: [{'compatibility_version': '3.6'}, {'compatibility_version': '3.4'}]

5) boot back to 6.8/3.6, fix the environment to have all dc and clusters on 3.6 CL and create a new backup
6) the import of fresh backup failed because db was already initialized:

Provisioning PostgreSQL users/databases:
- user 'engine', database 'engine'
FATAL: Existing database 'engine' or user 'engine' found and temporary ones created - Please clean up everything and try again


Actual results:
7) engine cleanup fails:

[ ERROR ] Cleanup utility and installed version mismatch
          Please use a version of cleanup utility that matches the engine installed version (now engine-cleanup 4.0.4.4, engine 3.6.9.2)
[ ERROR ] Failed to execute stage 'Environment setup': Cleanup utility version mismatch


Expected results:
Clean up should clean the environment from both 3.6 and 4.0.

Additional info:
To clean the environment, follow this solution: https://access.redhat.com/solutions/2733871
~~~
# service ovirt-engine stop
# service postgresql stop
# rm -rf /var/lib/pgsql/data
~~~

Comment 2 Yedidyah Bar David 2016-10-31 11:08:35 UTC
(In reply to Marina from comment #0)
> Description of problem:
> If migration process from 3.6 to 4.0 fails, engine-cleanup should be able
> cleaning it, to revert the environment back to clean state after failed
> restore of 3.6 backup.
> 
> Version-Release number of selected component (if applicable):
> 4.0.4
> 
> How reproducible:
> 
> 
> Steps to Reproduce:
> 1) a full backup of a 3.6 setup (make sure there is a DC or a cluster in 3.6
> with CL 3.4)
> 2) installation RHEL 7 with RHV packages
> 3) import of the backup with 'engine-backup --mode=restore'
> 4) run engine-setup, that will fail with:
> 
> 2016-10-21 11:23:03 DEBUG otopi.ovirt_engine_setup.engine_common.database
> database.execute:222 Result: [{'compatibility_version': '3.6'},
> {'compatibility_version': '3.4'}]
> 
> 5) boot back to 6.8/3.6, fix the environment to have all dc and clusters on
> 3.6 CL and create a new backup
> 6) the import of fresh backup failed because db was already initialized:
> 
> Provisioning PostgreSQL users/databases:
> - user 'engine', database 'engine'
> FATAL: Existing database 'engine' or user 'engine' found and temporary ones
> created - Please clean up everything and try again
> 

If this is a clean machine, and you do not need anything from postgresql there, you can use this as a workaround:

# service postgresql stop
# rm -rf /var/lib/pgsql/data

Then try again 'engine-backup --mode=restore' and 'engine-setup'.

I suggest closing this bug and writing the above in a KB article.

Doing a general "fix" is imo too delicate and risky - we might get a wrong picture of the state of the system and remove things where we actually should have prompted the user.

Comment 13 Yedidyah Bar David 2017-03-12 06:18:09 UTC
*** Bug 1431079 has been marked as a duplicate of this bug. ***