Description

  • KVM HyperVisor (Host OS) time is set to the current time.
  • vSRX admin changes the time to a future date.
  • vSRX Admin reboots the vSRX.
  • vSRX time reverts to the HyperVisor Time.

Symptoms

Custom time defined on vSRX is not retained after reboot and it reverts/syncs to the HyperVisor time.

Solution

The time revert is happening due to the KVM HyperVisor Clock module Driver change.

The old Driver preserves the time where in the new Driver forces the time sync of the Host OS.

The kvmclock.ko will keep the date setting after reboot.

 

  • On KVM Shell:

 

root@:~ # kldstat | grep kvm

29 1 0xffffffff83561000 1130 kvmclock.ko << Old Driver

 

  • But kvm_clock.ko will rollback the date setting to the current time after reboot.

root@:~ # kldstat | grep kvm

30 1 0xffffffff83564000 21a0 kvm_clock.ko << New Driver

 

  • For a hint regarding the time sync with HyperVisor, we can boot the vSRX in BootVerbose mode, and the following lines will be printed in the boot log:

kvmclock0: registered as a time-of-day clock, resolution 0.000001s

kvmclock0: providing initial system time <<< shows that the HyperVisor is providing time to the Guest OS.

 

NOTE: The newer kvmclock driver is based on a paravirtualized clock that provides both a precise timekeeping counter for the kernel, and also support for being a wall clock source as well. It is capable of providing a wall clock get time via a mapped location that is a shared page with the hypervisor.

Modification History

2025-07-31 : Article Created