Azure / WALinuxAgent

Microsoft Azure Linux Guest Agent
http://azure.microsoft.com/
Apache License 2.0
534 stars 371 forks source link

[RHEL8] chrony service fails to start at boot on Azure VMs if udev has not finished creating /dev/ptp_hyperv symbolic link #3038

Open yuxisun1217 opened 7 months ago

yuxisun1217 commented 7 months ago

Description of problem: On Azure VMs with systemd systemd-239-53.el8 or later(BZ#1991834) chronyd will fail to start at system boot if udev has not completed the creation of the /dev/ptp_hyperv symbolic link. We want to add this solution(udev rule and chrony conf file) into the WALinuxAgent-udev package:

$ cat /etc/udev/rules.d/99-ptp.rules
SUBSYSTEM=="ptp", TAG+="systemd"
$ cat /etc/systemd/system/chronyd.service.d/override.conf
[Unit]
BindsTo=dev-ptp_hyperv.device
After=dev-ptp_hyperv.device

Version-Release number of selected component (if applicable):

How reproducible: Sporadic occurrences.

Steps to Reproduce

  1. Deploy Azure VM at RHEL 8.6 or later for systemd-239-53.el8 or greater.
  2. Configure refclock in /etc/chrony.conf to reference /dev/ refclock PHC /dev/ptp_hyperv poll 3 dpoll -2 offset 0
  3. Reboot system.
narrieta commented 7 months ago

@anhvoms could you take a look?

jepio commented 5 months ago

@yuxisun1217: the udev rule is part of systemd upstream https://github.com/systemd/systemd/pull/28973/files since v255. Maybe backport that change?

The chronyd.service.d/override.conf can only safely be applied when chrony.conf contains the entry you specified (refclock PHC /dev/ptp_hyperv poll 3 dpoll -2 offset 0). Which package installs your chrony.conf?

yuxisun1217 commented 4 months ago

Hi @jepio ,

Sorry I just saw your message. I think this chrony.conf comes from the Microsoft document: https://learn.microsoft.com/en-us/azure/virtual-machines/linux/time-sync#chrony

Thanks!