Skip to content

Commit 7d900de

Browse files
Merge pull request #253186 from mabicca/patch-7
Update time-sync.md
2 parents 631d428 + 46e4608 commit 7d900de

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

articles/virtual-machines/linux/time-sync.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,24 @@ This should return `hyperv`, meaning the Azure host.
102102

103103
In some Linux VMs you may see multiple PTP devices listed. One example is for Accelerated Networking the Mellanox mlx5 driver also creates a /dev/ptp device. Because the initialization order can be different each time Linux boots, the PTP device corresponding to the Azure host might be `/dev/ptp0` or it might be `/dev/ptp1`, which makes it difficult to configure `chronyd` with the correct clock source. To solve this problem, the most recent Linux images have a `udev` rule that creates the symlink `/dev/ptp_hyperv` to whichever `/dev/ptp` entry corresponds to the Azure host. Chrony should always be configured to use the `/dev/ptp_hyperv` symlink instead of `/dev/ptp0` or `/dev/ptp1`.
104104

105+
If you are having issues with the `/dev/ptp_hyperv` device not being created, you can use the `udev` rule and steps below to configure it:
106+
107+
NOTE: Most Linux distributions should not need this udev rule as it has been implemented in newer versions of [systemd](https://github.com/systemd/systemd/commit/32e868f058da8b90add00b2958c516241c532b70)
108+
109+
Create the `udev` rules file:
110+
````bash
111+
$ sudo cat > /etc/udev/rules.d/99-ptp_hyperv.rules << EOF
112+
ACTION!="add", GOTO="ptp_hyperv"
113+
SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK += "ptp_hyperv"
114+
LABEL="ptp_hyperv"
115+
EOF
116+
````
117+
Reboot the Virtual Machine OR reload the `udev` rules with:
118+
````bash
119+
$ sudo udevadm control --reload
120+
$ sudo udevadm trigger --subsystem-match=ptp --action=add
121+
````
122+
105123
### chrony
106124

107125
On Ubuntu 19.10 and later versions, Red Hat Enterprise Linux, and CentOS 8.x, [chrony](https://chrony.tuxfamily.org/) is configured to use a PTP source clock. Instead of chrony, older Linux releases use the Network Time Protocol daemon (ntpd), which doesn't support PTP sources. To enable PTP in those releases, chrony must be manually installed and configured (in chrony.conf) by using the following statement:

0 commit comments

Comments
 (0)