[libvirt-users] libvirt-guests and time sync on autostart vms

Gianluca Cecchi gianluca.cecchi at gmail.com
Tue Mar 21 13:12:25 UTC 2017

On Tue, Mar 21, 2017 at 1:37 AM, ıuoʎ <yonjah at gmail.com> wrote:

> On Mon, Mar 20, 2017 at 9:58 PM, Timo Juhani Lindfors
> <timo.lindfors at iki.fi> wrote:
> > ıuoʎ <yonjah at gmail.com> writes:
> >> I have a host running a few guests all configured to autostart.
> >> I'm also using libvirt-guests to suspend the guests when the host
> >> restarts or shuts down
> >
> > I have a similar setup. I solved it by writing a small daemon that syncs
> > system time from RTC time if the error is larger than 10 seconds. This
> > guarantees that my VM time will be in sync with the host very fast. If
> > I'd run ntpd it would take minutes for the resumed VM to notice that
> > something happened.
> Yea I created another systemd service that will sync the time of all
> running machines on host boot.
> I was just wondering if I was missing something with libvirt-guests
> and autostart.
> I haven't noticed any issues with the time discrepancies on running
> guests so I hope this will be enough.
Not tested myself, but in  /etc/sysconfig/libvirt-guests there is at the
end this:

# If non-zero, try to sync guest time on domain resume. Be aware, that
# this requires guest agent with support for time synchronization
# running in the guest. For instance, qemu-ga doesn't support guest time
# synchronization on Windows guests, but Linux ones. By default, this
# functionality is turned off.

>From the comment contents it seems the default is actually 0, so if you
have not already done it, you can put

This I think requires also to install inside the guest the qemu-guest-agent
package and enabling qemu-guest-agent service.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20170321/9351d59a/attachment.htm>

More information about the libvirt-users mailing list