Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-95196

Persistent guests are set to auto-shutdown when setting auto_shutdown_try_shutdown to transient

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • libvirt-11.5.0-3.el10
    • No
    • Moderate
    • rhel-virt-core-libvirt-1
    • ssg_virtualization
    • 26
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      What were you trying to do that didn't work?

      Persistent guests are set to auto-shutdown when setting auto_shutdown_try_shutdown to transient. If I understand correctly, whether auto_shutdown_try_shutdown set to "transient" or "none", since from the doc:

      # The settings for auto shutdown actions accept one of
      # four possible options:
      #
      # * "none" - do not try to save any running VMs
      # * "persistent" - only try to save persistent running VMs
      # * "transient" - only try to save transient running VMs
      # * "all" - try to save all running VMs
      

      the bahavior of persistent guests should apply the same logic.

      # Whether VMs that are automatically powered off or saved during
      # host shutdown, should be set to restore on next boot
      #auto_shutdown_restore = 1
      

      I think the restore should only apply to the guests that are automatically powered off or saved.

      Please provide the package NVR for which the bug is seen:

      libvirt-11.3.0-1.el10.x86_64

      How reproducible is this bug?:

      100%

      Steps to reproduce

      1. Set the auto shutdown parameters

      # grep -v -e '^#' -e '^$' /etc/libvirt/qemu.conf
      auto_shutdown_try_shutdown = "transient"
      auto_shutdown_restore = 1
      

      2. Prepare a persistent guest and a transient guest

      # virsh list --all --persistent 
       Id   Name             State
      ---------------------------------
       3    avocado-vt-vm1   running
      
      # virsh list --all --transient 
       Id   Name             State
      --------------------------------
       1    avocado-vt-vm2   running
      

      3. Reboot the host

      4. Check the guest status

      # virsh list --all
       Id   Name             State
      ---------------------------------
       1    avocado-vt-vm1   running
      

      5. Check the log

      1. grep -rni virDomainDriverAutoShutdown /var/log/libvirt/virtqemud.log
        57671:2025-06-04 08:51:19.855+0000: 2750: debug : virDomainDriverAutoShutdown:741 : Run autoshutdown uri=qemu:///system trySave=none tryShutdown=transient poweroff=none waitShutdownSecs=0 saveBypassCache=0 autoRestore=1
        57727:2025-06-04 08:51:19.856+0000: 2750: debug : virDomainDriverAutoShutdown:789 :Auto shutdown with 2 running domains
        57736:2025-06-04 08:51:19.856+0000: 2750: debug : virDomainDriverAutoShutdown:798 : Cannot auto-restore transient VM avocado-vt-vm2
        57745:2025-06-04 08:51:19.856+0000: 2750: debug : virDomainDriverAutoShutdown:801 : Mark avocado-vt-vm1 for autostart on next boot
        57761:2025-06-04 08:51:19.857+0000: 2750: info : virDomainDriverAutoShutdown:872 : Shutting down 'avocado-vt-vm2'
        57858:2025-06-04 08:51:19.932+0000: 2750: info : virDomainDriverAutoShutdown:885 : Waiting 30 secs for VM shutdown completion
        58221:2025-06-04 08:51:24.069+0000: 2750: info : virDomainDriverAutoShutdown:938 : Processed 2 domains
        58222:2025-06-04 08:51:24.069+0000: 2750: warning : virDomainDriverAutoShutdown:951 : auto-shutdown: domain 'avocado-vt-vm1' not successfully shut off by any action

      Actual results

      Even I set the auto_shutdown_try_shutdown to "transient", persistent guests are still be marked as autostart once

      Additional info:

      1. If set the auto_shutdown_try_shutdown to none

      # grep -v -e '^#' -e '^$' /etc/libvirt/qemu.conf
      auto_shutdown_try_shutdown = "none"
      auto_shutdown_restore = 1
      

      2. Reboot the host

      3. Check the guest status

      # virsh list --all
       Id   Name             State
      ---------------------------------
       -    avocado-vt-vm1   shut off
      

      The guests are not autostarted.

              pkrempa@redhat.com Peter Krempa
              rhn-support-lizhu Lili Zhu
              Peter Krempa Peter Krempa
              Lili Zhu Lili Zhu
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated: