Bug 1503148

Summary: [RFE] translate between basic ntp configurations and chrony configurations
Product: Red Hat Enterprise Virtualization Manager Reporter: Ryan Barry <rbarry>
Component: rhev-hypervisor-ngAssignee: Ryan Barry <rbarry>
Status: CLOSED ERRATA QA Contact: Yihui Zhao <yzhao>
Severity: medium Docs Contact:
Priority: low    
Version: 4.2.0CC: bburmest, cshao, dfediuck, huzhao, mgoldboi, qiyuan, rbarry, sbonazzo, yaniwang, ycui, yzhao
Target Milestone: ovirt-4.2.0Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: imgbased-1.0.5 Doc Type: Enhancement
Doc Text:
NTP is deprecated in favor of chrony in RHV 4.2. The updated default configuration allows users upgrading to RHV 4.2 from RHV-H to seamlessly transition from NTP to chrony without intervention.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-15 17:57:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Node RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ryan Barry 2017-10-17 13:05:27 UTC
Description of problem:
RHVH 4.0 and 4.1 ships with ntp for time synchronization, along with chrony.

Chrony is the preferred time synchronization system for RHV, and ntp will be removed in 4.2. It would be ideal for imgbased to know how to convert between trivial ntpd/chrony configs.

Imgbased should:

check whether ntpd is running and configured
If it is, enable chrony and do our best to migrate the ntp config

Comment 6 Yihui Zhao 2017-12-12 10:34:29 UTC
Test version:
rhvh-4.1-0.20171207.0   
--- imgbased-0.9.51-0.1.el7ev.noarch
--- ntp-4.2.6p5-25.el7_3.2.x86_64
--- chrony-3.1-2.el7.x86_64

rhvh-4.2.0.5-0.20171207.0 
--- imgbased-1.0.4-0.1.el7ev.noarch
--- ntp-4.2.6p5-25.el7_3.2.x86_64
--- chrony-3.1-2.el7.x86_64


[root@dhcp-8-176 etc]# imgbase layout
rhvh-4.1-0.20171207.0
 +- rhvh-4.1-0.20171207.0+1
rhvh-4.2.0.5-0.20171207.0
 +- rhvh-4.2.0.5-0.20171207.0+1

Test steps:
1. Install rhvh-4.1-0.20171207.0   
2. Modify the /etc/ntp.conf and /etc/chronyd.conf
3. Upgrade to rhvh-4.2.0.5-0.20171207.0 
4. Check the /etc/ntp.conf and /etc/chronyd.conf

Results:
1. Before upgrade:
#Add the "server 0.rhel.pool.ntp.org iburst" line

[root@dhcp-8-111 opt]# cat ntp.conf |grep -v "^#"|grep -v "^$"
server clock01.util.phx2.redhat.com iburst
server clock02.util.phx2.redhat.com iburst
server 0.rhel.pool.ntp.org iburst
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1 
restrict ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
server 10.5.26.10   # added by /sbin/dhclient-script
server 10.5.27.10   # added by /sbin/dhclient-script


#Add the "server 1.rhel.pool.ntp.org iburst" line 

[root@dhcp-8-111 opt]# cat chrony.conf |grep -v "^$" |grep -v "^#"
server clock01.util.phx2.redhat.com iburst
server clock02.util.phx2.redhat.com iburst
server 1.rhel.pool.ntp.org iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
logdir /var/log/chrony

2. After upgrade:

[root@dhcp-8-176 etc]# cat ntp.conf |grep -v "^$" |grep -v "^#"
server clock01.util.phx2.redhat.com iburst
server clock02.util.phx2.redhat.com iburst
server 0.rhel.pool.ntp.org iburst
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1 
restrict ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
server 10.5.26.10   # added by /sbin/dhclient-script
server 10.5.27.10   # added by /sbin/dhclient-script

[root@dhcp-8-176 etc]# cat chrony.conf 
# This file has been migrated or modified by imgbased

makestep 1.0 3
rtcsync
logdir /var/log/chrony
driftfile /var/lib/chrony/drift
server clock01.util.phx2.redhat.com iburst
server clock02.util.phx2.redhat.com iburst
server 1.rhel.pool.ntp.org iburst


From the test result, the 4.2 chrony.conf don't translate from the 4.1 ntp.conf.

Comment 9 Yihui Zhao 2017-12-21 05:53:39 UTC
Please ignore the comment 8

Test version:
rhvh-4.1-0.20171207.0   
--- imgbased-0.9.51-0.1.el7ev.noarch
--- ntp-4.2.6p5-25.el7_3.2.x86_64
--- chrony-3.1-2.el7.x86_64

rhvh-4.2.0.5-0.20171218.1 
--- imgbased-1.0.5-0.1.el7ev.noarch
--- ntp-4.2.6p5-25.el7_3.2.x86_64
--- chrony-3.1-2.el7.x86_64


[root@dhcp-8-176 ~]# imgbase layout
rhvh-4.1-0.20171207.0
 +- rhvh-4.1-0.20171207.0+1
rhvh-4.2.0.6-0.20171218.0
 +- rhvh-4.2.0.6-0.20171218.0+1

Test steps:
1. Install rhvh-4.1-0.20171207.0   
2. Modify the /etc/ntp.conf and /etc/chronyd.conf
3. Upgrade to rhvh-4.2.0.5-0.20171218.1 
4. Check the /etc/ntp.conf and /etc/chronyd.conf

Results:
1. Before upgrade:
#Add the "server 0.rhel.pool.ntp.org iburst" line

[root@dhcp-8-176 opt]# cat /etc/ntp.conf |grep -v "^#"|grep -v "^$"
server clock01.util.phx2.redhat.com iburst
server clock02.util.phx2.redhat.com iburst
server 0.rhel.pool.ntp.org iburst
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1 
restrict ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
server 10.5.26.10   # added by /sbin/dhclient-script
server 10.5.27.10   # added by /sbin/dhclient-script


#Add the "server 1.rhel.pool.ntp.org iburst" line 

[root@dhcp-8-176 opt]# cat /etc/chrony.conf |grep -v "^$" |grep -v "^#"
server clock01.util.phx2.redhat.com iburst
server clock02.util.phx2.redhat.com iburst
server 1.rhel.pool.ntp.org iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
logdir /var/log/chrony

2. After upgrade:
[root@dhcp-8-176 ~]# cat /etc/chrony.conf |grep -v "^$" |grep -v "^#"
makestep 1.0 3
rtcsync
logdir /var/log/chrony
driftfile /var/lib/chrony/drift
server clock01.util.phx2.redhat.com iburst
server clock02.util.phx2.redhat.com iburst
server 0.rhel.pool.ntp.org iburst
server 10.5.26.10
server 10.5.27.10
[root@dhcp-8-176 ~]# cat /etc/ntp.conf |grep -v "^$" |grep -v "^#"
server clock01.util.phx2.redhat.com iburst
server clock02.util.phx2.redhat.com iburst
server 0.rhel.pool.ntp.org iburst
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1 
restrict ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
server 10.5.26.10   # added by /sbin/dhclient-script
server 10.5.27.10   # added by /sbin/dhclient-script

[root@dhcp-8-176 ~]# service chronyd status
Redirecting to /bin/systemctl status chronyd.service
● chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2017-12-21 13:31:43 CST; 7min ago
     Docs: man:chronyd(8)
           man:chrony.conf(5)
  Process: 1248 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
  Process: 1214 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 1226 (chronyd)
   CGroup: /system.slice/chronyd.service
           └─1226 /usr/sbin/chronyd

Dec 21 13:31:41 localhost.localdomain systemd[1]: Starting NTP client/server...
Dec 21 13:31:41 localhost.localdomain chronyd[1226]: chronyd version 3.1 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SECHASH +SIGND +ASYNCDNS +IPV6 +DEBUG)
Dec 21 13:31:41 localhost.localdomain chronyd[1226]: Frequency -0.390 +/- 1.868 ppm read from /var/lib/chrony/drift
Dec 21 13:31:43 localhost.localdomain systemd[1]: Started NTP client/server.
Dec 21 13:34:23 dhcp-8-176.nay.redhat.com chronyd[1226]: Source 203.135.184.123 replaced with 202.118.1.81
Dec 21 13:34:57 dhcp-8-176.nay.redhat.com chronyd[1226]: Selected source 10.5.27.10
Dec 21 13:36:01 dhcp-8-176.nay.redhat.com chronyd[1226]: Selected source 10.5.26.10


From the test result, the 4.2 chrony.conf  translate from the 4.1 ntp.conf.

So change the bug's status to verified!

Comment 11 Yihui Zhao 2018-04-24 03:39:06 UTC
According to the Comment 9, moving to verified.

Comment 14 errata-xmlrpc 2018-05-15 17:57:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHSA-2018:1524

Comment 15 Franta Kust 2019-05-16 13:04:25 UTC
BZ<2>Jira Resync