cockpit-project / cockpit-machines

Cockpit UI for virtual machines
GNU Lesser General Public License v2.1
292 stars 74 forks source link

There will be a shutoff VM left, after clicking "Install" button and deleting the VM #659

Open yunmingyang opened 2 years ago

yunmingyang commented 2 years ago

Description of problem: Create a VM, with "Download OS" and without "immediately start VM", then click "Install" of the VM. After VM state is running, delete the VM, there will be a shutoff VM left

Version-Release number of selected components (if applicable): cockpit-254-1.fc35.x86_64 cockpit-machines-265.6.gae6a8aa8-1.fc34.noarch libvirt-dbus-1.4.0-4.fc35.x86_64

How reproducible: 100%

Steps to Reproduce: 1 Create a VM, with "Download OS" and without "immediately start VM" 2 Click "Install" of the VM 3 Wait untill the VM state is running, then delete the VM

Actual results: 1 After step 3, there will be a shutoff VM left

Expected results: 1 After step 3, there will be no VM left

Additional info:

garrett commented 2 years ago

I was able to reproduce this here too, even with the (upcoming) new Create VM dialog, with "create and edit" (as it's basically the same workflow).

I deleted it from the list, as mentioned above.

Screenshot 2022-04-11 at 17-39-49 Virtual Machines - garrett@Bolt

Eventually, there was an error notification too.

Screenshot 2022-04-11 at 17-39-44 Virtual Machines - garrett@Bolt

Deleting an installing VM after choosing "create and run" works without a residual VM in the UI. However, I do get the same error.:

Screenshot 2022-04-11 at 17-43-20 Virtual Machines - garrett@Bolt

(I chose CentOS Stream here and Alma above to make sure it's clear which is which.)

KKoukiou commented 1 year ago

So the current implementation just redefines the VM in case installation failed. This will allow the user to make some changes and re-attempt installation, without taking the whole way of creating the VM. I think this behavior should be mantained. However, this scenario becomes problematic, as indeed, deletion of the VM during installation cannot be distinguished from a plain installation failure.