Bug 1821018 - [RFE] Use only "engine-backup --mode=restore" for restoration of every possible databases by default instead of "--provision-all-databases"
Summary: [RFE] Use only "engine-backup --mode=restore" for restoration of every possib...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backup-Restore.Engine
Version: 4.4.0
Hardware: Unspecified
OS: Unspecified
medium
low with 1 vote
Target Milestone: ovirt-4.5.0-1
: 4.5.0
Assignee: Yedidyah Bar David
QA Contact: Guilherme Santos
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-05 12:36 UTC by Shir Fishbain
Modified: 2022-05-30 08:29 UTC (History)
3 users (show)

Fixed In Version: ovirt-engine-4.5.0
Doc Type: Enhancement
Doc Text:
If this bug requires documentation, please select an appropriate Doc Type value.
Clone Of:
Environment:
Last Closed: 2022-05-30 08:29:19 UTC
oVirt Team: Integration
Embargoed:
sbonazzo: ovirt-4.5?
pm-rhel: planning_ack?
pm-rhel: devel_ack+
gdeolive: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 118248 0 master MERGED packaging: engine-backup: Automatically provision 2022-01-17 15:41:31 UTC

Description Shir Fishbain 2020-04-05 12:36:36 UTC
Description of problem:
Using only "engine-backup --mode=restore" for restoring all possible databases from the backup archive by default.

Version-Release number of selected component (if applicable):
ovirt-engine-4.4.0-0.29.master.el8ev.noarch

Expected results:
Restore should be performed as in the example with "engine-backup --mode=restore" by default instead of using specific "--provision-all-databases"

For example:
storage-ge-09 ~]# engine-backup --mode=restore --file=/root/cinderlib_from_old_engine --log=/root/log_cinderlib_from_old_engine --provision-all-databases --restore-permissions
Start of engine-backup with mode 'restore'

Comment 1 Yedidyah Bar David 2020-09-03 07:28:27 UTC
Thanks for opening this RFE. I have been thinking about opening it myself for some time now, see also bug 1530031 comment 1 (and 3 and 6), but eventually didn't handle it then. Partially copying it here. Logic should be, more-or-less:

If not "--change-*db-credentials"
    and mode=restore
    and db host = 'localhost'
    and db port = 5432 (default)
    and not secured connection
    and not secured host validation
    and user=default ('engine' for engine, 'ovirt_engine_history' for dwh)
    and db=default
    and password is not empty
    and postgresql is stopped
    and perhaps pg's data directory is empty or does not exist
then:
    provision all databases

Comment 2 Yedidyah Bar David 2022-01-17 12:20:53 UTC
The condition for automatically provisioning databases is:
- No '--change*credentials' options passed
- All databases are on 'localhost'
- An attempt to connect to the databases fails

Some relevant flows:

I.
1. Install, setup and backup an engine.
2. Reinstall the machine, install but do not setup an engine
3. Restore with 'engine-backup --mode=restore'

II.
1. Install, setup and backup an engine.
2. engine-cleanup
3. Restore
This will not auto-provision, because it's still possible to
connect to the databases (cleanup does not drop them), and will
fail, saying you must pass one of --*restore-permissions.

II.
1. Install, setup and backup an engine.
2. engine-cleanup
3. systemctl stop postgresql.service
4. rm -rf /var/lib/pgsql/data/*
5. Restore
This should work.


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