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

Bug 1422980

Summary: [RFE] add /etc/chrony.conf and/or /etc/ntp.conf to engine-backup
Product: Red Hat Enterprise Virtualization Manager Reporter: François Cami <fcami>
Component: DocumentationAssignee: Steve Goodman <sgoodman>
Status: CLOSED CURRENTRELEASE QA Contact: Richard Hoch <rhoch>
Severity: low Docs Contact:
Priority: medium    
Version: 4.0.6CC: ctomasko, didi, lleistne, lsurette, mtessun, pelauter, pmatyas, rhoch, sgoodman, srevivo
Target Milestone: ovirt-4.4.7Keywords: Documentation, EasyFix, FutureFeature, NoDocsQEReview
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-28 12:29:44 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 François Cami 2017-02-16 17:34:44 UTC
Description of problem:
/etc/chrony.conf is not backuped using engine-backup leading to situations where the manager has no NTP sources after upgrade or backup/restore

Version-Release number of selected component (if applicable):
ovirt-engine-tools-backup-4.0.6.3-0.1.el7ev

NB: reported against ovirt-engine as ovirt-engine-tools-backup is not in the drop-down list.


How reproducible:
Always


Steps to Reproduce:
1. Install self-hosted RHEV 3.6
2. Upgrade to RHV 4.0

Actual results:
chronyd not configured
ntpd not configured

Expected results:
either chronyd configured or ntpd configured

Comment 1 Yaniv Kaul 2017-02-16 18:09:33 UTC
It doesn't have many other /etc configuration files backed up as well, we are only backing up oVirt/RHV items. 

Can you clarify why is this file and not others under /etc? 

What if I'm using ntpd?

Comment 2 Yaniv Kaul 2017-02-16 18:25:36 UTC
*** Bug 1422978 has been marked as a duplicate of this bug. ***

Comment 3 François Cami 2017-02-19 16:27:29 UTC
> Can you clarify why is this file and not others under /etc? 

Because oVirt/RHEV will be more reliable if the engine clock is kept in sync due to our wide usage of SSL.
Because we support GSSAPI and clock skew will break that functionality.

> What if I'm using ntpd?

Let's say both chrony.conf and ntp.conf should be in the backup archive if present. 

"As a RHV administrator, I need ntp or chrony-based timekeeping to be restored when I restore the engine from backup".

Comment 4 Yaniv Kaul 2017-02-19 19:09:58 UTC
(In reply to François Cami from comment #3)
> > Can you clarify why is this file and not others under /etc? 
> 
> Because oVirt/RHEV will be more reliable if the engine clock is kept in sync
> due to our wide usage of SSL.
> Because we support GSSAPI and clock skew will break that functionality.

So nothing for Kerberos?

> 
> > What if I'm using ntpd?
> 
> Let's say both chrony.conf and ntp.conf should be in the backup archive if
> present. 
> 
> "As a RHV administrator, I need ntp or chrony-based timekeeping to be
> restored when I restore the engine from backup".

Comment 5 François Cami 2017-02-22 16:48:04 UTC
> So nothing for Kerberos?

If I'm not mistaken this should be the subject of another RFE.

As it stands restoring chrony or ntp functionality from the backup would result in a more reliable engine - less prone to time drift.

Comment 6 François Cami 2017-02-22 16:51:05 UTC
I'd rather not backup and restore /etc completely because as we rebase the hosted-engine image from different RHEL versions this will not work.

I'd rather pick up the pieces that we really need:
* timekeeping => chrony.conf & ntp.conf
* hosts file

Comment 8 Sandro Bonazzola 2019-01-28 09:40:49 UTC
This bug has not been marked as blocker for oVirt 4.3.0.
Since we are releasing it tomorrow, January 29th, this bug has been re-targeted to 4.3.1.

Comment 10 Yedidyah Bar David 2019-06-05 08:50:41 UTC
As the current maintainer of engine-backup, and a previously-long-time-sysadmin, I tend to disagree with current bug's request.

I think now and here would be a very good time to discuss criteria for inclusion of configuration files in engine-backup.

Until very recently, although such a discussion was never held AFAIK, these were, more-or-less:

1. All of /etc/*ovirt*, as applicable. These are "obviously" owned by us, should hopefully not raise questions.

2. Everything that might be automatically changed by engine-setup, depending on the answers provided for the questions it asks. This includes e.g. configuration for httpd.

Broadly, the following two flows should have resulted in semi-identical machines:

I.
Install OS+engine
engine-setup
engine-backup to file F1

II.
Install OS+engine
engine-backup restore from F1
engine-setup

Then, we reluctantly changed this recently, in bug 1693816, to include:

3. Everything that might be changed manually by the user when following the documentation. Ideally, this should not be needed - such pieces of documentation should also include instructions to add the files they suggest to create to the list of files backed up and restored by engine-backup. But doing this seemed too difficult at the time (see that bug), so we decided it's enough to add to the built-in list *and* mention that in the documentation, see doc bug 1700655.

As an admin, I think that if I know that I need some custom configuration/stuff in the engine (or any other) machine for installation, and engine-backup is strictly presented as a tool to backup the engine, I would expect to be able to, and have to, do these custom stuff during restore as well.

For standalone engines, I think this is obvious, and does not require that much more discussion.

For hosted-engine, either during restore from backup, or during (now obsolete, original reason for current bug, might be relevant again soon in the upgrade to RHEL8) migration to a newer OS, we'll soon prompt the admin to continue, thus letting them do whatever they need, see bug 1686575, and specifically https://gerrit.ovirt.org/100269 .

Thus, I propose CLOSE NOTABUG.

Comment 11 François Cami 2019-06-05 08:59:19 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=1422980#c3

You can decide to close NOTABUG but it would be better than to display a warning if no working ntpd/chronyd configuration is detected post-restore then.
This will happen after any migration done in environments without Internet access.

Comment 13 Yedidyah Bar David 2019-06-05 09:21:36 UTC
(In reply to François Cami from comment #11)
> See https://bugzilla.redhat.com/show_bug.cgi?id=1422980#c3

Yes, I did read all of current bug before writing comment 10. But, as kaul wrote two years ago, where do you stop? kerberos? ldap? custom networking configuration? What about custom backup/monitoring agents etc. - these will quite likely break as well if you do not backup/restore their configuration, right? That's why I do not want to discuss NTP, but to get an agreement about what this tool (engine-backup) is actually supposed to do, and what it's not supposed to do but leave to others.

> 
> You can decide to close NOTABUG but it would be better than to display a
> warning if no working ntpd/chronyd configuration is detected post-restore
> then.

Warning at which point? If restore is called from within hosted-engine, the user will never see it.

> This will happen after any migration done in environments without Internet
> access.

Comment 15 Yedidyah Bar David 2019-06-13 08:48:10 UTC
An update: I now verified that you can actually do configure engine-backup to backup whatever you want, and that it always restores everything that it backed up. See bug 1715767 comment 3. For current bug, this should be something like:

# mkdir -p /etc/ovirt-engine-backup/engine-backup-config.d

# cat << __EOF__ >> /etc/ovirt-engine-backup/engine-backup-config.d/ntp-chrony.sh
BACKUP_PATHS="\${BACKUP_PATHS}
/etc/chrony.conf
/etc/ntp.conf
/etc/ovirt-engine-backup"
__EOF__

This can be added to docs etc. as an example/appendix/whatever. Makes sense?

Comment 16 François Cami 2019-06-13 11:25:48 UTC
> where do you stop? kerberos? ldap? custom networking configuration?

I'm not sure there is a good answer to that!
However kerberos/ldap are related to being able to log in to the engine while a broken ntp/chrony configuration will result in the engine not being able to manage the hosts (IIRC). So ntp.conf/chrony.conf and ldap/kerberos configs are not directly related.

> I now verified that you can actually do configure engine-backup to backup whatever you want, and that it always restores everything that it backed up.

https://bugzilla.redhat.com/show_bug.cgi?id=1715767#c3 && /etc/ovirt-engine-backup/engine-backup-config.d/ is an excellent idea esp. if an example is added to the official docs.

This is a very good solution, thank you!

Comment 17 Asaf Rachmani 2019-06-16 17:07:00 UTC
Moving to ON_QA for testing.

Testing flow:
1. Install and setup an engine
2. Configure and run engine-backup to backup /etc/chrony.conf, /etc/ntp.conf, /etc/hosts (see comment 15)
3. Reinstall the machine / use a different one
4. Restore the backup
5. Run engine-setup
6. Check that the relevant files were restored.

Once approved by QE can be moved to doc team.

Comment 18 Petr Matyáš 2019-11-25 15:49:33 UTC
Tested on ovirt-engine-4.4.0-0.5.master.el7.noarch

I don't see any of the files mentioned in backup archive.
Also the patch linked to this bug is abandoned.

Comment 19 Yedidyah Bar David 2019-11-26 07:05:15 UTC
(In reply to Petr Matyáš from comment #18)
> Tested on ovirt-engine-4.4.0-0.5.master.el7.noarch
> 
> I don't see any of the files mentioned in backup archive.

Please see comment 17 and comment 15.

> Also the patch linked to this bug is abandoned.

Indeed. It's a TestOnly bug intended to be handed over to doc team.

Comment 20 Yedidyah Bar David 2019-11-26 09:28:32 UTC
Moving to doc team.

Comment 21 Petr Matyáš 2019-11-28 14:00:04 UTC
With added configuration from comment#15 everything specified there is backed up and can be restored.

Comment 22 Sandro Bonazzola 2020-02-05 08:16:38 UTC
let's document comment #15 as example for adding to backup/restore any file admin wants to be backed up and restored.

Comment 23 Steve Goodman 2021-04-08 07:17:10 UTC
I'll add a topic to the Admin Guide section on "Adding configuration files to the backup" with the content in comment 15 as an example.

Comment 24 Steve Goodman 2021-04-22 14:48:39 UTC
I added an example to the existing topic on using `engine-backup`. Please review. Keep in mind this is low priority.

https://gitlab.cee.redhat.com/rhci-documentation/docs-Red_Hat_Enterprise_Virtualization/-/merge_requests/1956

The name of the topic is: 

Creating a backup with the engine-backup command

Comment 25 Steve Goodman 2021-04-25 09:42:28 UTC
Gitlab comment from Didi:

> Looks good to me.

Comment 26 Steve Goodman 2021-04-25 09:45:35 UTC
Richard, could you please do a peer review of this topic?

Comment 27 Richard Hoch 2021-04-26 08:57:20 UTC
(In reply to Steve Goodman from comment #26)
> Richard, could you please do a peer review of this topic?

Made a couple comments; overall, looks good.

Comment 28 Steve Goodman 2021-06-21 16:38:41 UTC
Merged.