Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1530031

Summary: [RFE] engine-backup should have defaults for most options
Product: [oVirt] ovirt-engine Reporter: Yedidyah Bar David <didi>
Component: Backup-Restore.EngineAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: medium Docs Contact:
Priority: low    
Version: 4.2.0CC: bugs, didi, lsvaty, pmatyas, sgoodman
Target Milestone: ovirt-4.3.0Keywords: FutureFeature
Target Release: 4.3.0Flags: rule-engine: ovirt-4.3?
dnecpal: testing_plan_complete-
rule-engine: planning_ack?
sbonazzo: devel_ack+
lsvaty: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.3.0_alpha Doc Type: Enhancement
Doc Text:
The 'engine-backup' script now has default values for several options, so you do not need to supply values for these options. To see the default values, run 'engine-backup --help'.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-13 16:37:48 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:
Embargoed:

Description Yedidyah Bar David 2018-01-01 10:50:27 UTC
Description of problem:

engine-backup currently requires several options that can safely (imo) be made optional:

--log=

We can default to e.g. /var/log/ovirt-engine-backup/ovirt-engine-backup.log or
ovirt-engine-$MODE-$DATE-$RANDOM.log (in same dir)

--file=

We can probably default to /var/lib/ovirt-engine-backup/ovirt-engine-backup-$DATE-$RANDOM.backup

--mode=

It might even be safe to assume that we can default to mode=backup

--restore-permissions or --no-restore-permissions

It's probably safe to default to '--restore-permissions' if provisioning databases. In that case, extra users (if being granted in the dump) will be created with random passwords, and the admin will have to change the passwords if these users are used for anything.

Comment 1 Yedidyah Bar David 2018-10-15 06:20:14 UTC
Patch 89572 by Ariel O. Barria was merged to master, fulfilling everything in comment 0. Thanks for the patch!

I wonder if we might want to also provision databases by default, if relevant. Something like:

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 Steve Goodman 2019-02-24 14:10:48 UTC
Didi,

For doc_text, how's this:

"The 'engine-backup' script now has default values for several options, so you do not need to supplied values for these options."

Which options now have defaults? The above sentence leaves a lot to the imagination.

Your original doc_text said: "...so they do not need to be supplied *usually*."

What do you mean by usually? When do you need to specify a value and when do you not?


> TODO update with the new defaults once we decide what these are.

The user should know these values, correct? Where can these values be seen? Do we need to enumerate them here in the doc_text? Or are they in a file we can refer the user to?

Comment 3 Yedidyah Bar David 2019-02-25 07:21:33 UTC
(In reply to Steve Goodman from comment #2)
> Didi,
> 
> For doc_text, how's this:
> 
> "The 'engine-backup' script now has default values for several options, so
> you do not need to supplied values for these options."
> 
> Which options now have defaults? The above sentence leaves a lot to the
> imagination.

If you check the bug history, you see that I wrote the doc text when it
was on POST, before the patch was merged - so could not be fully certain
about its contents. Also, other than comment 0, which I wrote myself, no-
one else provided any input, other than the contributor that supplied the
patch (and worked with me on refining it). So the result is just a summary
of the opinions of the two of us...

> 
> Your original doc_text said: "...so they do not need to be supplied
> *usually*."
> 
> What do you mean by usually? When do you need to specify a value and when do
> you not?

See below.

You need to specify values if you want something different from the default :-)

> 
> 
> > TODO update with the new defaults once we decide what these are.
> 
> The user should know these values, correct? Where can these values be seen?
> Do we need to enumerate them here in the doc_text? Or are they in a file we
> can refer the user to?

It's best to run 'engine-backup --help', we did update that in the patch.
We also updated the man page.

Summary of the changes is:
==========================

--mode defaults to 'backup'

--log defaults to /var/log/ovirt-engine-backup/ovirt-engine-<MODE>-YmdHMS.log

If mode is backup, --file defaults to /var/lib/ovirt-engine-backup/ovirt-engine-backup-YmdHMS.backup

If mode is restore and we provision databases, we default to --restore-permissions

Also, when engine-backup starts, it now emits to the user's terminal:

Start of engine-backup with mode 'backup'
scope: all
archive file: /var/lib/ovirt-engine-backup/ovirt-engine-backup-20181014145119.backup
log file: /var/log/ovirt-engine-backup/ovirt-engine-backup-20181014145119.log

So:
===
For running a backup, the absolute minimum is:

engine-backup

For running a restore, if the backup was done on an engine with automatically-provisioned databases (which is the default) and we want to also automatically provision them on restore, the absolute minimum is:

engine-backup --mode=restore --file=backup-file

Feel free to update the doc text accordingly, or just mention there '--help'.

Also, we should update the documentation accordingly. Please open a bug to track that, if needed. Thanks.

Comment 4 Petr Matyáš 2019-03-07 15:21:44 UTC
Verified on ovirt-engine-4.3.2-0.1.el7.noarch

Comment 5 Sandro Bonazzola 2019-03-13 16:37:48 UTC
This bugzilla is included in oVirt 4.3.0 release, published on February 4th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.0 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.

Comment 6 Yedidyah Bar David 2019-11-13 07:29:01 UTC
A short note: comment 3 is wrong, because I didn't eventually handle comment 1 at all. Copying the relevant part from there, corrected:

For running a restore, if the backup was done on an engine with automatically-provisioned databases (which is the default) and we want to also automatically provision them on restore, the absolute minimum is:

engine-backup --mode=restore --file=backup-file --provision-all-databases