Description of problem: Using cockpit to create a new VM on a remote machine, I aborted the installation of a VM. The 'Install' button no longer appears and there are no options to reset the state or re-try the install
Version-Release number of selected component (if applicable): RHEL 8 beta
How reproducible: 100% of the time, every time
Steps to Reproduce:
1. Create a VM using cockpit
2. Click the 'Install' button
3. Abort the installer
4. There is no way to install or reset the state using the cockpit UI, the VM must be deleted.
Actual results: Install can only be attempted once
Expected results: Install can be re-attempted
This is a hard problem to solve. In order to give user option to re-try the installation, we need to know if the installation finished successfully or not.
As far as I know, there is no way to know if the installation finished successfully from outside (e.g. by asking libvirt).
There are few option how to figure it out from inside the guest:
guestfs could help a bit, it could tell in some cases that the installation went wrong, but it doesn't cover all cases so it would give us a lot of false positives about successful installation. So the prediction would be inaccurate.
Anaconda probably has some way to determine successful installation. But that approach would work only for distros supported by anaconda, and we would have to come up with a lot of different approaches for different distros. But I personally think this goes beyond cockpit's responsibility.
> guestfs could help a bit, it could tell in some cases that the installation went wrong
I disagree. The notion of "successful installation" is impossible to pin down on arbitrary images, it would need assumptions about particular installers (anaconda, ubiquity, debian-installer, cloud-init, ignition, and a gazillion others) -- this is the path to the dark side. Even within one installer, it's not clearly defined what "successful" means, other than perhaps "the VM boots without the installer medium up until a point where it responds to ping" (but even that might not always be true).
So this "successful?" decision is best left to the user. Right now it should be possible to reattempt the install by just switching the boot device to the ISO or PXE again, or by just deleting the VM and recreating it.
Adding a "reinstall" button in the UI for this corner case may do more harm than good at first sight: Aside from being clutter in most cases, the XML would also need to store the installation source indefinitely, URLs/local files change, etc.
So IMHO we should leave this alone, there are enough buttons in the UI already to redo a failed install.