KVM Guest fails to autostart on Red Hat Enterprise Linux (RHEL) host after a reboot.

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL)

Issue

  • KVM Guest fails to autostart after the host was rebooted.

  • The following error is logged on the host in the /var/log/messages:

Aug 30 15:38:16 kvm0 journal: Failed to autostart VM 'TEST': internal error: Device alias was not set for PCI controller with index 1 required for device at address 0000:01:01.
  • The VM can be started without any errors using the virsh create <options> command.

Resolution

  • The virsh create <options> command just creates and starts a transient guest, but doesn't store any persistent definition for it.
  • The virsh define <path_to_vm.xml> command needs to be issued to make the guest configuration persistent and be written to /etc/libvirt/qemu directory for where it will be read to start the guest.
  • Then the guest can be started with virsh start <Name of KVM>. After that, you can set it as an autostart domain with virsh autostart <Name of KVM>.

  • Also it suggested to activate the libvirt-guests services to automatically suspended the guest when you reboot, rather than abrupt reboot.

Root Cause

The virsh define <path_to_vm.xml> command wasn't issued to make the guest configuration persistent.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments