Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2129524

Summary: [Machines]Unable to remove detached virtual disk files
Product: Red Hat Enterprise Linux 9 Reporter: g.danti
Component: cockpit-machinesAssignee: Nobody <nobody>
Status: CLOSED ERRATA QA Contact: Xianghua Chen <xchen>
Severity: low Docs Contact:
Priority: unspecified    
Version: 9.0CC: g.danti, kkoukiou, mmarusak, mpitt, redhat-bugzilla, wshi, xchen, ymao, yunyang
Target Milestone: rcKeywords: Triaged
Target Release: 9.3Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: cockpit-machines-288-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:24:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
VM removal dialog none

Description g.danti 2022-09-24 12:28:30 UTC
Created attachment 1914006 [details]
VM removal dialog

Description of problem:
Detaching a vdisk from a virtual machine does not remove the physical file. While this is the right thing to do, no other method exists to remove the vdisk file other than opening a shell and execute the corresponding "rm" or "virsh" command.

virt-manager cope with the same issue by giving the user a view of the files stored on pools, from where the user can delete the detached files.

cockpit-machines lacks such pool-wide file selection and removal capability. A quick solution would be to ask the user if he want to remove the vdev file upon detaching it, similarly on what happens when an user delete an entire virtual machine (see screenshot for an example).

Version-Release number of selected component (if applicable):
cockpit-machines 263

How reproducible:
Always

Steps to Reproduce:
1. create and attach a new vdisk to an existing virtual machine
2. detach the newly created disk
3. user is forced to open a shell to remove the just-detached file

Actual results:
User is forced to open a shell to remove the just-detached file

Expected results:
User should be able to remove an unused vdisk file.

Additional info:
See screenshot

Comment 1 Simon Kobyda 2022-11-15 16:54:50 UTC
Upstream PR: https://bugzilla.redhat.com/show_bug.cgi?id=2129524

Comment 2 Simon Kobyda 2022-11-15 16:55:44 UTC
ahh, wrong link, Upstream PR is here: https://github.com/cockpit-project/cockpit-machines/pull/857

Comment 9 Xianghua Chen 2023-02-06 06:19:27 UTC
Hi Katerina, will we have this fix downstream this release? If yes, could you set the DTM&ITM so that it can get release+ flag for this bug?

Comment 10 Martin Pitt 2023-02-08 06:41:44 UTC
This is still in the works upstream, so at the moment I don't want to commit to an ITM just yet. I asked Simon in the upstream PR about an estimate.

Comment 11 Martin Pitt 2023-04-13 14:09:39 UTC
The upstream PR is close to landing, so we can commit to 9.3 now.

Comment 14 Xianghua Chen 2023-04-27 02:36:33 UTC
Verified with packages:
cockpit-machines-288-1.el9.noarch
cockpit-290-1.el9.x86_64
libvirt-daemon-9.0.0-10.el9_2.x86_64
libvirt-dbus-1.4.1-5.el9.x86_64

Steps:
1 Prepare a cirros image
2 Enter vm details page, click "Add disk", choose "Create new" input a "Name" and click add.
3 Click remove for the new added disk , there will be a dialog appears:
Remove disk from VM?
This disk will be removed from cirros:
Target  vdb
Pool   images
Volume   disk3

4. Click "Remove and delete file"
The disk is removed, and check the original file is deleted as expected.

So verified.

Comment 17 errata-xmlrpc 2023-11-07 08:24:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (cockpit-machines bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6336