Bug 1314847 - Restore fails with ovirt-engine-dwh conf, though that was not on backup
Restore fails with ovirt-engine-dwh conf, though that was not on backup
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine
Classification: oVirt
Component: Backup-Restore.Engine (Show other bugs)
3.6.3.3
x86_64 Linux
high Severity medium (vote)
: ovirt-3.6.5
: 3.6.5
Assigned To: Yedidyah Bar David
Gonza
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-04 11:36 EST by Scott Nolin
Modified: 2016-04-21 10:39 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-04-21 10:39:07 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Integration
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑3.6.z+
ylavi: planning_ack+
sbonazzo: devel_ack+
pnovotny: testing_ack+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 54379 master MERGED packaging: engine-backup: recreate dwh conf only if found 2016-03-09 08:58 EST
oVirt gerrit 54552 ovirt-engine-3.6 MERGED packaging: engine-backup: recreate dwh conf only if found 2016-03-09 10:53 EST

  None (edit)
Description Scott Nolin 2016-03-04 11:36:09 EST
Description of problem:

When recovering a backup to a new machine the restore fails with

FATAL: Can not find /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf

However, the datawarehouse is not installed on the backed up host.

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

3.6.3.4-1

How reproducible:

Easily for my example systems, haven't tested other systems.

Steps to Reproduce:
1. Do the engine backup on machine A
2. Set up the empty database and do a recover with change-db-credentials on machine B

Actual results:

FATAL: Can not find /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf


Expected results:

Normal output of "you should now run engine-setup. Done"

Additional info:

Searched for some kind of flag to disable that particular database on the restore, but found nothing.

I managed to work around this by hacking the DWH- stuff out of engine-backup.sh - and everything restored just fine.
Comment 1 Scott Nolin 2016-03-04 11:38:01 EST
Original system (backed up) was ovirt-3.5, upgraded to ovirt-3.6 and in production for a while before the backup. Restore system was simply installed with 3.6.
Comment 2 Doron Fediuck 2016-03-08 02:21:32 EST
(In reply to Scott Nolin from comment #1)
> Original system (backed up) was ovirt-3.5, upgraded to ovirt-3.6 and in
> production for a while before the backup. Restore system was simply
> installed with 3.6.

Was the backup performed on the upgraded 3.6 engine of did you restore a 3.5
backup into the upgraded 3.6 engine?
Comment 3 Scott Nolin 2016-03-08 09:33:49 EST
(In reply to Doron Fediuck from comment #2)
> (In reply to Scott Nolin from comment #1)
> > Original system (backed up) was ovirt-3.5, upgraded to ovirt-3.6 and in
> > production for a while before the backup. Restore system was simply
> > installed with 3.6.
> 
> Was the backup performed on the upgraded 3.6 engine of did you restore a 3.5
> backup into the upgraded 3.6 engine?

Backup was performed on the upgraded 3.6 engine, so restoring 3.6 to 3.6

I did a few additional backup just to be certain after finding the problem.

Scott
Comment 4 Yedidyah Bar David 2016-03-09 09:13:37 EST
To reproduce/verify:

1. Install/Setup engine only (no dwh or reports)
2. backup and copy the backup somewhere
3. engine-cleanup, or create a new machine (or restore from snapshot)
4. restore with '--change-db-credentials' (and all required credentials)

On broken version will fail as in comment 0. On fixed version will succeed.

Note that it will not fail if you do not pass '--change-db-credentials', which usually should work immediately after 'engine-cleanup' (because the user/password are left as they were with it).

Workaround - simply create an empty file there:

1. mkdir -p /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d
2. touch /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf
3. chown ovirt:ovirt /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf
4. chmod 600 /etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf
5. Run restore. If you already did, it will tell you that 'engine db is not empty'. Run engine-cleanup, then try again.
Comment 5 Gonza 2016-04-06 06:07:52 EDT
Verified with:
rhevm-3.6.5-0.1.el6.noarch
rhevm-tools-backup-3.6.5-0.1.el6.noarch

# engine-backup --mode=restore --file=engine.bkp --log=restore.log --change-db-credentials --db-host=`hostname` --db-user=engine --db-password --db-name=engine --no-restore-permissions
Enter Engine database password: 
Preparing to restore:
- Setting credentials for Engine database 'engine'
- Unpacking file 'engine.bkp'
Restoring:
- Files
- Engine database 'engine'
  - Cleaning up temporary tables in engine database 'engine'
Rewriting /etc/ovirt-engine/engine.conf.d/10-setup-database.conf
You should now run engine-setup.
Done.

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