Bug 1036603

Summary: 'dir' type pool always autostart
Product: Red Hat Enterprise Linux 7 Reporter: yanbing du <ydu>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, berrange, dyuan, mzhan, zhwang, zpeng, zsong
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virsh cmd
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1037456 (view as bug list) Environment:
Last Closed: 2013-12-03 09:18:35 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:
Bug Depends On:    
Bug Blocks: 1037456    

Description yanbing du 2013-12-02 10:44:07 UTC
Description of problem:
Disabel autostart of a pool, then restart libvirtd, dir' type pool always autostart.

Version-Release number of selected component (if applicable):
libvirt-1.1.1-13.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.# virsh pool-list --all
Name                 State      Autostart 
-----------------------------------------
default              inactive   no
#

# service libvirtd restart
Redirecting to /bin/systemctl restart  libvirtd.service
 
# virsh pool-list --all
Name                 State      Autostart 
----------------------------------------- 
default              active     no   

# virsh pool-autostart default --disable
Pool default unmarked as autostarted

# virsh pool-destroy default
Pool default destroyed
      

# service libvirtd restart
Redirecting to /bin/systemctl restart  libvirtd.service
 
# virsh pool-list --all
Name                 State      Autostart 
----------------------------------------- 
default              active     no   

If define a 'netfs' type pool and disable autostart, it will not start when restart libvritd.

2.
3.

Actual results:
dir' type pool always autostart when restart libvirtd

Expected results:
dir' type pool not autostart if disable autostart.

Additional info:

Comment 2 Daniel Berrangé 2013-12-03 09:18:35 UTC
When libvirtd starts up it probes all storage pools to identify if they are already active on the host. If the filesystem that the directory is located on is mounted, then the directory based pool is trivially active. This is unrelated to autostart, which aims to start pools from scratch.

Comment 3 yanbing du 2013-12-03 09:28:07 UTC
(In reply to Daniel Berrange from comment #2)
> When libvirtd starts up it probes all storage pools to identify if they are
> already active on the host. If the filesystem that the directory is located
> on is mounted, then the directory based pool is trivially active. This is
> unrelated to autostart, which aims to start pools from scratch.

So the 'pool-autostart --disable' command will not effect for this kind of pool, no matter the pool marked autostart or not, restart libvritd always start the poo? Is this make sense?

Comment 4 Daniel Berrangé 2013-12-03 09:45:18 UTC
As I said, if the filesystem containing the directory is mountd, then the directory will show as running.

Comment 5 yanbing du 2013-12-03 10:34:33 UTC
(In reply to Daniel Berrange from comment #4)
> As I said, if the filesystem containing the directory is mountd, then the
> directory will show as running.

Thanks, i got your meaning. What i'm considering is if user use the directory in local filesystem, the pool may mark as "Autostart: no", but this property will make the user very confused.
Maybe there's some way to fix this or document it somewhere, what do you think?

Comment 6 zhenfeng wang 2015-07-02 05:21:03 UTC
hi
The dir pool will always autostart while restart libvirtd, even we disable the autostart flag for the dir pool,  however,the dir pool without autostart flag won't autostart any more while restart libvirtd after libvirt-1.2.15-1.el7.x86_64,
anything change for this part? can you help check it , thanks.

Comment 7 Daniel Berrangé 2015-07-02 08:31:58 UTC
As mentioned, the dir pools should always autostart, if the directory actually exists when libvirtd starts. If this isn't happening anymore it is a regression and you should file a new bug for that.