Currently running Clear Linux 39920.
Seems like somethings happened to virtual machine autostart? Worked in previous 38xxx version.
I tried disabling and removing files from /etc/libvirt/qemu/autostart but have had no luck? anyone able to test this see if they get the same result. I have two systems running this version with the same problem. Rebooting server does not bring the VMs back online.
Been reading through many forums & posts without much luck but I’ve tracked it down to an error with Openvswitch. Seems like the bridge is not available at the time of boot.
Oct 28 20:45:14 dkvm03 libvirtd[451]: internal error: Failed to autostart VM 'gns3': Cannot get interface MTU on 'ovs-br0': No such device
The bridge is definitely there and working, as the vm runs if manually started. I could not find a way to delay the VM autostart which is weird for a hypervisor.
5: ovs-br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 38:14:28:31:a6:be brd ff:ff:ff:ff:ff:ff
Still seeing if there is a resolution - any ideas would be welcome!
root@dkvm03/ # virsh edit gns3
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Element domain has extra content: bootdelay
I do know there is a daemon called libvirt-guests.service that helps suspend and startup VMs on host shutdown… but I’ve never needed to use this before to get autostart to work? If I try enable it on ClearLinux the service just fails - maybe because it can’t locate the configuration.
libvirt-guests.service config is located on some systems under /etc/sysconfig/libvirt-guests but under ClearLinux I have no idea where it would look to check the config.
I used to do this for lxc without any configuration files
if you’re looking for default configs, you can try looking under /usr/share/defaults/etc/
but any of the files there are overridden if you introduce a config to /etc/
Hi Kingfisher,
when I check the libvirt-guest service status I get the following error.
Oct 30 13:12:07 clrkvm01 systemd[1]: Starting libvirt-guests.service...
Oct 30 13:12:07 clrkvm01 libvirt-guests.sh[22299]: touch: cannot touch '/var/lock/subsys/libvirt-guests': No such file or directory
Oct 30 13:12:07 clrkvm01 systemd[1]: Finished libvirt-guests.service.
Oct 30 14:29:50 clrkvm01 systemd-machined[400]: New machine qemu-1-gns3.
░░ The virtual machine qemu-1-gns3 with its leader PID 1352 has been
Oct 30 14:29:50 clrkvm01 systemd[1]: Started machine-qemu\x2d1\x2dgns3.scope.
░░ Subject: A start job for unit machine-qemu\x2d1\x2dgns3.scope has finished successfully
░░ A start job for unit machine-qemu\x2d1\x2dgns3.scope has finished successfully.
Oct 30 14:30:40 clrkvm01 libvirt-guests.sh[1565]: gns3
Oct 30 14:30:40 clrkvm01 libvirt-guests.sh[1565]: Suspending gns3: ...
Oct 30 14:30:42 clrkvm01 systemd[1]: machine-qemu\x2d1\x2dgns3.scope: Deactivated successfully.
░░ The unit machine-qemu\x2d1\x2dgns3.scope has successfully entered the 'dead' state.
Oct 30 14:30:42 clrkvm01 systemd[1]: Stopped machine-qemu\x2d1\x2dgns3.scope.
░░ Subject: A stop job for unit machine-qemu\x2d1\x2dgns3.scope has finished
░░ A stop job for unit machine-qemu\x2d1\x2dgns3.scope has finished.
Oct 30 14:30:42 clrkvm01 systemd[1]: machine-qemu\x2d1\x2dgns3.scope: Consumed 14.743s CPU time.
░░ The unit machine-qemu\x2d1\x2dgns3.scope completed and consumed the indicated resources.
Oct 30 14:31:00 clrkvm01 libvirtd[435]: Unable to restore from managed state /var/lib/libvirt/qemu/save/gns3.save. Maybe the file is corrupted?
Oct 30 14:31:00 clrkvm01 libvirt-guests.sh[660]: Resuming guest gns3:
Oct 30 14:31:00 clrkvm01 libvirt-guests.sh[665]: error: Failed to start domain 'gns3'
I have no idea why, but somehow I have it working, yet I still have errors!!
So I created the folder /etc/sysconfig and create file libvirt-guests with the following configuration
I uncommented START_DELAY=20 and SHUTDOWN_TIMEOUT=300 which is default.
# Customizations for the libvirt-guests.service systemd unit
# URIs to check for running guests
# example: URIS='default xen:///system vbox+tcp://host/system lxc:///system'
#URIS=default
# action taken on host boot
# - start all guests which were running on shutdown are started on boot
# regardless on their autostart settings
# - ignore libvirt-guests init script won't start any guest on boot, however,
# guests marked as autostart will still be automatically started by
# libvirtd
#ON_BOOT=ignore
# Number of seconds to wait between each guest start. Set to 0 to allow
# parallel startup.
START_DELAY=20
# action taken on host shutdown
# - suspend all running guests are suspended using virsh managedsave
# - shutdown all running guests are asked to shutdown. Please be careful with
# this settings since there is no way to distinguish between a
# guest which is stuck or ignores shutdown requests and a guest
# which just needs a long time to shutdown. When setting
# ON_SHUTDOWN=shutdown, you must also set SHUTDOWN_TIMEOUT to a
# value suitable for your guests.
#ON_SHUTDOWN=shutdown
# Number of guests will be shutdown concurrently, taking effect when
# "ON_SHUTDOWN" is set to "shutdown". If Set to 0, guests will be shutdown one
# after another. Number of guests on shutdown at any time will not exceed number
# set in this variable.
#PARALLEL_SHUTDOWN=0
# Number of seconds we're willing to wait for a guest to shut down. If parallel
# shutdown is enabled, this timeout applies as a timeout for shutting down all
# guests on a single URI defined in the variable URIS. If this is 0, then there
# is no time out (use with caution, as guests might not respond to a shutdown
# request). The default value is 300 seconds (5 minutes).
SHUTDOWN_TIMEOUT=300
# If non-zero, try to bypass the file system cache when saving and
# restoring guests, even though this may give slower operation for
# some file systems.
#BYPASS_CACHE=0
# 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. By default, this functionality is turned off.
#SYNC_TIME=1
Somehow my VM is now starting after a reboot, which is great, but I still have weird errors about corrupt save file, tainted CPU, and missing openvswitch bridge?
Oct 30 16:57:29 clrkvm01 libvirt-guests.sh[1518]: gns3
Oct 30 16:57:29 clrkvm01 libvirt-guests.sh[1518]: Suspending gns3: ...
Oct 30 16:57:31 clrkvm01 systemd[1]: machine-qemu\x2d2\x2dgns3.scope: Deactivated successfully.
░░ The unit machine-qemu\x2d2\x2dgns3.scope has successfully entered the 'dead' state.
Oct 30 16:57:31 clrkvm01 systemd[1]: Stopped machine-qemu\x2d2\x2dgns3.scope.
░░ Subject: A stop job for unit machine-qemu\x2d2\x2dgns3.scope has finished
░░ A stop job for unit machine-qemu\x2d2\x2dgns3.scope has finished.
Oct 30 16:57:31 clrkvm01 systemd[1]: machine-qemu\x2d2\x2dgns3.scope: Consumed 19.475s CPU time.
░░ The unit machine-qemu\x2d2\x2dgns3.scope completed and consumed the indicated resources.
Oct 30 16:57:47 clrkvm01 libvirtd[484]: Unable to restore from managed state /var/lib/libvirt/qemu/save/gns3.save. Maybe the file is corrupted?
Oct 30 16:57:47 clrkvm01 libvirtd[484]: internal error: Failed to autostart VM 'gns3': Cannot get interface MTU on 'ovs-br0': No such device
Oct 30 16:57:47 clrkvm01 libvirtd[484]: Domain id=2 name='gns3' uuid=647bb888-2786-4ae6-a031-ad8c3bf624af is tainted: host-cpu
Oct 30 16:57:47 clrkvm01 systemd-machined[400]: New machine qemu-2-gns3.
░░ The virtual machine qemu-2-gns3 with its leader PID 789 has been
Oct 30 16:57:47 clrkvm01 systemd[1]: Started machine-qemu\x2d2\x2dgns3.scope.
░░ Subject: A start job for unit machine-qemu\x2d2\x2dgns3.scope has finished successfully
░░ A start job for unit machine-qemu\x2d2\x2dgns3.scope has finished successfully.
Oct 30 16:57:49 clrkvm01 libvirt-guests.sh[749]: Resuming guest gns3:
Well I think I solved my issue - for me anyway… not sure about saving and resuming VMs but all I need is for the VM to start. I got rid of the errors by disabling vm saving.