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 When the host comes back up I see a bunch of log messages - Resuming guest vm01 already active Resuming guest vm02 already active I guess this is because libvirt autostarts the guests when it starts and before libvirt-guests has a chance to start them. I didn't think this is an issue until I noticed the time on the guests is totally out of sync. SYNC_TIME=1 is enabled in the conf file but this doesn't seem to work I can see from the code at libvirt-guests.sh that the time sync function will only run if the guest is started by libvirt-guests ans will be skipped for guests that are already running So I'm not sure if this is a bug in libvirt-guests.sh or if I'm doing something wrong by using both libvirt-guests and autostart. I assume libvirt-guests will always resume guests on proper reboot but I'm think if there is any unexpected failure where guests weren't properly suspended before boot I still want them to come backup when the server boots Regards, Yoni
Timo Juhani Lindfors
2017-Mar-20 13:58 UTC
Re: [libvirt-users] libvirt-guests and time sync on autostart vms
ıuoʎ <yonjah@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 downI 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.
ıuoʎ
2017-Mar-21 00:37 UTC
Re: [libvirt-users] libvirt-guests and time sync on autostart vms
On Mon, Mar 20, 2017 at 9:58 PM, Timo Juhani Lindfors <timo.lindfors@iki.fi> wrote:> ıuoʎ <yonjah@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.
Seemingly Similar Threads
- Re: libvirt-guests and time sync on autostart vms
- Re: libvirt-guests and time sync on autostart vms
- libvirt-guests and time sync on autostart vms
- virsh autostart: cannot set autostart for transient domain
- After restart, user's gnome autostart seems broken