Bug 1300947 - engine-backup user experience need to be improved
engine-backup user experience need to be improved
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine
Classification: oVirt
Component: Backup-Restore.Engine (Show other bugs)
3.6.2.6
Unspecified Unspecified
low Severity medium (vote)
: ovirt-4.1.0-alpha
: 4.1.0.2
Assigned To: Yedidyah Bar David
Aleksei Slaikovskii
: Improvement
: 1340419 (view as bug list)
Depends On:
Blocks: 1329323
  Show dependency treegraph
 
Reported: 2016-01-22 02:51 EST by Sandro Bonazzola
Modified: 2017-02-01 09:44 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-02-01 09:44:49 EST
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‑4.1+
lsvaty: testing_plan_complete-
rule-engine: planning_ack+
sbonazzo: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 58219 master MERGED packaging: engine-backup: Fix usage text 2016-06-02 02:54 EDT

  None (edit)
Description Sandro Bonazzola 2016-01-22 02:51:03 EST
Description of problem:
engine-backup user experience need to be improved:
[root@ovirt ~]# engine-backup 
FATAL: --mode=<backup|restore> is missing
[root@ovirt ~]# engine-backup --mode=backup
FATAL: --file is missing
readlink: missing operand
Try 'readlink --help' for more information.
/usr/bin/engine-backup: line 1405: : No such file or directory
Notifying engine
/usr/bin/engine-backup: line 1472: : No such file or directory
/usr/bin/engine-backup: line 1405: : No such file or directory
FATAL: Failed notifying engine


I would expect to have the output of --help if any of the required options is missing.

Looking at engine-backup --help:

/usr/bin/engine-backup [--mode=MODE] [--scope=SCOPE] [--file=FILE] [--log=FILE]

looks like all the parameters are optional but all of them are required for engine-backup to work:


[root@ovirt ~]# engine-backup 
FATAL: --mode=<backup|restore> is missing

# engine-backup --mode=backup --scope=all
FATAL: --file is missing
readlink: missing operand
Try 'readlink --help' for more information.
/usr/bin/engine-backup: line 1405: : No such file or directory
Notifying engine
/usr/bin/engine-backup: line 1472: : No such file or directory
/usr/bin/engine-backup: line 1405: : No such file or directory
FATAL: Failed notifying engine


[root@ovirt ~]# engine-backup --mode=backup --scope=all --file=backup
FATAL: --log is missing
readlink: missing operand
Try 'readlink --help' for more information.
/usr/bin/engine-backup: line 1405: : No such file or directory
Notifying engine
/usr/bin/engine-backup: line 1472: : No such file or directory
/usr/bin/engine-backup: line 1405: : No such file or directory
FATAL: Failed notifying engine


[root@ovirt ~]# engine-backup --mode=backup --scope=all --file=backup --log=log
Backing up:
Notifying engine
- Files
- Engine database 'engine'
Packing into file 'backup'
Notifying engine
Done.
Comment 1 Yedidyah Bar David 2016-01-24 02:06:00 EST
Much of the noise is already fixed by bug 1296520.

Not sure I agree with showing --help on errors. It's very long, and distracts from the actual error. Perhaps add 'Please see --help' or something.

It might make sense to have more options, or even all of them, have defaults. Say,

--file /var/lib/ovirt-engine/engine-backup/engine-backup-TIMESTAMP.RANDOM.bck
(or maintain a list of file extension per --archive-compressor and use .tar.EXT instead of .bck)

--log /var/log/ovirt-engine/engine-backup/engine-backup-TIMESTAMP.RANDOM.log

--mode backup?
not sure about that one. Most similar programs require passing such an option (either as an option (tar) or as part of the name (zip/unzip)).

IIRC this was discussed in the past, not sure about the outcome.

Also, this is the behavior since the first version (in 3.3), not sure what's urgent to include it in 3.6. If we do want to, consider also bug 1296520 (which is for 4.0 currently).
Comment 2 Yedidyah Bar David 2016-01-24 04:20:18 EST
(In reply to Yedidyah Bar David from comment #1)
> --mode backup?
> not sure about that one. Most similar programs require passing such an
> option (either as an option (tar) or as part of the name (zip/unzip)).

We can also add a wrapper engine-restore that runs engine-backup --mode=restore.
If we go that route (of requiring as few options as possible).
Comment 3 Sandro Bonazzola 2016-02-05 01:36:42 EST
I'm fine with just telling to look at --help instead of printing it. 
Ok to re-target to 4.0 not being urgent.
It make sense to use a default for --log making it optional.
Everything else may stay as it is right now, just making clear in the --help what's not optional, changing
/usr/bin/engine-backup [--mode=MODE] [--scope=SCOPE] [--file=FILE] [--log=FILE]
to
/usr/bin/engine-backup --mode=MODE --scope=SCOPE --file=FILE [--log=FILE]

(see https://en.wikipedia.org/wiki/Usage_message#Examples on optional and required arguments)
Comment 4 Sandro Bonazzola 2016-04-27 03:52:16 EDT
*** Bug 1329383 has been marked as a duplicate of this bug. ***
Comment 5 Yedidyah Bar David 2016-05-29 09:01:02 EDT
*** Bug 1340419 has been marked as a duplicate of this bug. ***
Comment 6 Yedidyah Bar David 2016-05-29 09:04:24 EDT
Decided to just fix the usage text for now.

As mentioned, most noise was already fixed by bug 1296520.

While I would personally prefer to have defaults for most everything, I can anticipate endless arguments/bugs/reports for whatever choice we make (hard-coded directories, current directory, etc), so would ignore this for now.
Comment 7 Sandro Bonazzola 2016-12-12 09:03:21 EST
The fix for this issue should be included in oVirt 4.1.0 beta 1 released on December 1st. If not included please move back to modified.
Comment 8 Aleksei Slaikovskii 2016-12-16 05:51:11 EST
This wont be automated, basic sanity will be sufficient for verification process.

$ engine-backup --help
engine-backup: back up and restore ovirt-engine environment
USAGE:
    /usr/bin/engine-backup --mode=MODE --scope=SCOPE --file=FILE --log=FILE [options]
...

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