Bug 1251400

Summary: Storage path "/tmp/test-vm" isn't checked automatically when deleting guest.
Product: Red Hat Enterprise Linux 7 Reporter: XiaoQing <qxiao>
Component: virt-managerAssignee: Pavel Hrdina <phrdina>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: crobinso, juzhou, mzhan, tzheng, xiaodwan
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-10 22:50:00 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:

Description XiaoQing 2015-08-07 08:44:01 UTC
Description of problem:

Storage path "/tmp/test-vm" isn't checked automatically when deleting guest


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

libvirt-1.2.17-3.el7.x86_64
virt-install-1.2.1-2.el7.noarch
virt-manager-1.2.1-4.el7.noarch


How reproducible:

100%


Steps to Reproduce:
1. Open the terminal and login with normal user not root.
   
2. Launch the virt-manager

$ virt-manager --debug

Type the password of root for authentication.
        
3. Install the guest by virt-install:

$ virt-install --connect qemu:///system -n test-vm -r 1024 --disk path=/tmp/test-vm,size=8 -l http://download.englab.nay.redhat.com/pub/rhel/rel-eng/latest-RHEL-7/compose/Server/x86_64/os/

Starting install...
Retrieving file .treeinfo... | 918 B 00:00
...
Retrieving file vmlinuz... | 4.0 MB 00:00
...
Retrieving file initrd.img... | 22 MB 00:00
...
Allocating 'virtinst-vmlinuz.N2HggX' | 2.0 MB 00:00
Transferring virtinst-vmlinuz.N2HggX | 2.0 MB 00:00
Allocating 'virtinst-initrd.img.y5EgOO' | 11 MB 00:00
Transferring virtinst-initrd.img.y5EgOO | 11 MB 00:03
Creating storage file test-vm | 8.0 GB 00:00
Creating domain... | 0 B 00:00

4. Force off the guest by virt-manager.
        
5.On virt-manager, Right click the guest test-vm -> Delete-> check whether "Delete associated storage files"  and  Storage path "/tmp/test-vm" are checked automatically, then click "Cancel" button.

6. Quit the virt-manger and launch virt-manager again.

7. After authentication, Right click the guest test-vm -> Delete-> check whether "Delete associated storage files" and Storage path "/tmp/test-vm" are checked automatically.


Actual results:

After step5, Storage path "/tmp/test-vm" isn't checked
automatically when deleting the guest.

After step 7, Storage path "/tmp/test-vm" is checked automatically when
deleting the guest, and file can be deleted when click "Delete" button.

Expected results:

After step 5, Storage path "/tmp/test-vm" is checked automatically when deleting the guest.

Additional info:

I think virt-manager will scan all pools and do some special operations to get access privilege of images when it starts. But virt-manager  will not do the same thing after it has already launched for newly guest file which is installed by virt-install.

Comment 3 Pavel Hrdina 2015-11-09 12:50:20 UTC
Tested with virt-manager-1.2.1-4 and I was not able to reproduce this bug.

Comment 4 Xiaodai Wang 2015-11-10 03:23:20 UTC
Hi Pavel,

I can reproduce it with virt-manager-1.2.1-8.el7.noarch.

Please follow below steps to reproduce it:
1. Login with normal user.
2. Launch virt-manager.
3. Run virt-install and install a guest into qemu:///system.
$ virt-install --connect qemu:///system --name test --memory 1024 --disk /tmp/test.img,size=1 -l http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/6.7/Server/x86_64/os
4. Force off the guest and right click the mouse to delete it.

Result:
The Image file is not checked automatically.

Feel free to let me known if you have any problems about it. Thanks!

Best Regards
Xiaodwan

Comment 5 Cole Robinson 2015-11-10 22:50:00 UTC
I put some thoughts here:

https://www.redhat.com/archives/virt-tools-list/2015-November/msg00082.html

virt-manager doesn't notice these out-of-band storage changes, because there's no scalable way for us to detect them. We need libvirt event APIs for storage pools and volumes.

Since this reported issue is fairly minor in the scheme of things, I'm just duping this bug to the upstream virt-manager report tracking support for storage events

*** This bug has been marked as a duplicate of bug 1280093 ***