Description of problem: Create a shutoff VM and run it. Then click "Shut down" button immediately(The VM is not completely started).The "Shut down" button will be always grey until refreshing or switching to another page and switching back Version-Release number of selected components (if applicable): cockpit-234-1.el8.x86_64 cockpit-machines-235-1.el8.noarch libvirt-dbus-1.3.0-2.module+el8.3.0+6423+e4cb6418.x86_64 How reproducible: 100% Steps to Reproduce: 1 Create a shutoff VM 2 Click "Run" 3 Click "Shut down" immediately after step 2 Actual results: 1 The "Shut down" button will be always grey until refreshing or switching to another page and switching back Expected results: 1 Maybe we can add timeout error, which is like "timeout when getting result from libvirt, please check whether the operation is taking effect" Additional info:
Quoting the RHEL Virtualization docs: `... executing a virsh shutdown command causes a power button ACPI event to be sent, thus copying the same action as when someone presses a power button on a physical machine. Within every physical machine, it is up to the OS to handle this event.` So in order for the shutdown command to work,the operating system has to be responsive. If you click 'Shut down' immediately after 'Run' as you specify in the steps, you are probably clicking while the grub boot loader dialog is still active. At that point, the signal will be sent, the button will be disabled and the spinner shown. The UI will wait for a VM state change, which will never happen. As you mention we can add a timeout for this specific or generally all lifecycle operations.
I'm thinking that adding a general timeout is good idea. Since this kind of situation can happen also when VM is frozen, which in that case that would be a bug to just show button spinning indefinitely
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.