Configure KVM Virtual PTP Driver

The KVM virtual PTP driver allows guests to sync the VM reference clock to the host’s high precision PTP clock reference.

Prerequisites

PTP must be enabled on StarlingX in order to use the KVM virtual PTP driver in guest VMs.

To leverage PTP in a VM and sync the VM reference clock with the hosting compute or AIO-controller node, do the following in the VM:

Procedure

  1. Load the KVM PTP driver:

    ~(keystone_admin)$ modprobe kvm_ptp
    
  2. Update the reference clock in the chrony config file (/etc/chrony.conf):

    ~(keystone_admin)$ refclock PHC /dev/ptp0 poll 3 dpoll -2 offset 0
    
  3. Restart the chronyd service:

    ~(keystone_admin)$ systemctl restart chronyd.service
    
  4. Confirm that the PTP device is in the list of time sources:

    ~(keystone_admin)$ systemctl restart chronyd.service