[Bug 1847105] [NEW] very slow disk creation, snapshotting

2019-10-07 Thread Andreas Hasenack
Public bug reported:

This is a regression in eoan for me. I use virt-manager to create vms,
and I noticed that creating one now takes more than a minute.

Looking at the process listing while the backing disk is being created, I see 
this qemu-img command line:
15658 ?Ssl0:00 /usr/sbin/libvirtd
23726 ?Sl 0:04  \_ /usr/bin/qemu-img create -f qcow2 -o 
preallocation=falloc,compat=1.1,lazy_refcounts 
/var/lib/libvirt/images/live-server.qcow2 41943040K

If I run qemu-img with that preallocation parameter set, even on bionic,
then it also takes a very long time.

On eoan, for comparison:
andreas@nsn7:~$ time qemu-img create -f qcow2 no-prealloc-image.qcow2 40G
Formatting 'no-prealloc-image.qcow2', fmt=qcow2 size=42949672960 
cluster_size=65536 lazy_refcounts=off refcount_bits=16

real0m0,016s
user0m0,010s
sys 0m0,006s
andreas@nsn7:~$ qemu-img info no-prealloc-image.qcow2 
image: no-prealloc-image.qcow2
file format: qcow2
virtual size: 40G (42949672960 bytes)
disk size: 17K
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
andreas@nsn7:~$ du -hs no-prealloc-image.qcow2 
17K no-prealloc-image.qcow2
andreas@nsn7:~$ 


and now with preallocation=falloc:
andreas@nsn7:~$ time qemu-img create -f qcow2 -o preallocation=falloc 
with-prealloc-image.qcow2 40G
Formatting 'with-prealloc-image.qcow2', fmt=qcow2 size=42949672960 
cluster_size=65536 preallocation=falloc lazy_refcounts=off refcount_bits=16

real1m43,196s
user0m3,564s
sys 1m26,720s
andreas@nsn7:~$ qemu-img info with-prealloc-image.qcow2 
image: with-prealloc-image.qcow2
file format: qcow2
virtual size: 40G (42949672960 bytes)
disk size: 2.7M
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
andreas@nsn7:~$ du -hs with-prealloc-image.qcow2 
2,8Mwith-prealloc-image.qcow2
andreas@nsn7:~$

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: libvirt-daemon 5.4.0-0ubuntu5
ProcVersionSignature: Ubuntu 5.3.0-13.14-generic 5.3.0
Uname: Linux 5.3.0-13-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu7
Architecture: amd64
Date: Mon Oct  7 11:36:03 2019
InstallationDate: Installed on 2019-10-07 (0 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Beta amd64 (20191006)
SourcePackage: libvirt
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.libvirt.nwfilter.allow-arp.xml: [inaccessible: [Errno 
13] Permission denied: '/etc/libvirt/nwfilter/allow-arp.xml']
modified.conffile..etc.libvirt.nwfilter.allow-dhcp-server.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/allow-dhcp-server.xml']
modified.conffile..etc.libvirt.nwfilter.allow-dhcp.xml: [inaccessible: [Errno 
13] Permission denied: '/etc/libvirt/nwfilter/allow-dhcp.xml']
modified.conffile..etc.libvirt.nwfilter.allow-incoming-ipv4.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/allow-incoming-ipv4.xml']
modified.conffile..etc.libvirt.nwfilter.allow-ipv4.xml: [inaccessible: [Errno 
13] Permission denied: '/etc/libvirt/nwfilter/allow-ipv4.xml']
modified.conffile..etc.libvirt.nwfilter.clean-traffic-gateway.xml: 
[inaccessible: [Errno 13] Permission denied: 
'/etc/libvirt/nwfilter/clean-traffic-gateway.xml']
modified.conffile..etc.libvirt.nwfilter.clean-traffic.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/clean-traffic.xml']
modified.conffile..etc.libvirt.nwfilter.no-arp-ip-spoofing.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-arp-ip-spoofing.xml']
modified.conffile..etc.libvirt.nwfilter.no-arp-mac-spoofing.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-arp-mac-spoofing.xml']
modified.conffile..etc.libvirt.nwfilter.no-arp-spoofing.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-arp-spoofing.xml']
modified.conffile..etc.libvirt.nwfilter.no-ip-multicast.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-ip-multicast.xml']
modified.conffile..etc.libvirt.nwfilter.no-ip-spoofing.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-ip-spoofing.xml']
modified.conffile..etc.libvirt.nwfilter.no-mac-broadcast.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-mac-broadcast.xml']
modified.conffile..etc.libvirt.nwfilter.no-mac-spoofing.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-mac-spoofing.xml']
modified.conffile..etc.libvirt.nwfilter.no-other-l2-traffic.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-other-l2-traffic.xml']
modified.conffile..etc.libvirt.nwfilter.no-other-rarp-traffic.xml: 
[inaccessible: [Errno 13] Permission denied: 
'/etc/libvirt/nwfilter/no-other-rarp-traffic.xml']

[Bug 1847105] [NEW] very slow disk creation, snapshotting

2019-10-07 Thread Andreas Hasenack
Public bug reported:

This is a regression in eoan for me. I use virt-manager to create vms,
and I noticed that creating one now takes more than a minute.

Looking at the process listing while the backing disk is being created, I see 
this qemu-img command line:
15658 ?Ssl0:00 /usr/sbin/libvirtd
23726 ?Sl 0:04  \_ /usr/bin/qemu-img create -f qcow2 -o 
preallocation=falloc,compat=1.1,lazy_refcounts 
/var/lib/libvirt/images/live-server.qcow2 41943040K

If I run qemu-img with that preallocation parameter set, even on bionic,
then it also takes a very long time.

On eoan, for comparison:
andreas@nsn7:~$ time qemu-img create -f qcow2 no-prealloc-image.qcow2 40G
Formatting 'no-prealloc-image.qcow2', fmt=qcow2 size=42949672960 
cluster_size=65536 lazy_refcounts=off refcount_bits=16

real0m0,016s
user0m0,010s
sys 0m0,006s
andreas@nsn7:~$ qemu-img info no-prealloc-image.qcow2 
image: no-prealloc-image.qcow2
file format: qcow2
virtual size: 40G (42949672960 bytes)
disk size: 17K
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
andreas@nsn7:~$ du -hs no-prealloc-image.qcow2 
17K no-prealloc-image.qcow2
andreas@nsn7:~$ 


and now with preallocation=falloc:
andreas@nsn7:~$ time qemu-img create -f qcow2 -o preallocation=falloc 
with-prealloc-image.qcow2 40G
Formatting 'with-prealloc-image.qcow2', fmt=qcow2 size=42949672960 
cluster_size=65536 preallocation=falloc lazy_refcounts=off refcount_bits=16

real1m43,196s
user0m3,564s
sys 1m26,720s
andreas@nsn7:~$ qemu-img info with-prealloc-image.qcow2 
image: with-prealloc-image.qcow2
file format: qcow2
virtual size: 40G (42949672960 bytes)
disk size: 2.7M
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
andreas@nsn7:~$ du -hs with-prealloc-image.qcow2 
2,8Mwith-prealloc-image.qcow2
andreas@nsn7:~$

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: libvirt-daemon 5.4.0-0ubuntu5
ProcVersionSignature: Ubuntu 5.3.0-13.14-generic 5.3.0
Uname: Linux 5.3.0-13-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu7
Architecture: amd64
Date: Mon Oct  7 11:36:03 2019
InstallationDate: Installed on 2019-10-07 (0 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Beta amd64 (20191006)
SourcePackage: libvirt
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.libvirt.nwfilter.allow-arp.xml: [inaccessible: [Errno 
13] Permission denied: '/etc/libvirt/nwfilter/allow-arp.xml']
modified.conffile..etc.libvirt.nwfilter.allow-dhcp-server.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/allow-dhcp-server.xml']
modified.conffile..etc.libvirt.nwfilter.allow-dhcp.xml: [inaccessible: [Errno 
13] Permission denied: '/etc/libvirt/nwfilter/allow-dhcp.xml']
modified.conffile..etc.libvirt.nwfilter.allow-incoming-ipv4.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/allow-incoming-ipv4.xml']
modified.conffile..etc.libvirt.nwfilter.allow-ipv4.xml: [inaccessible: [Errno 
13] Permission denied: '/etc/libvirt/nwfilter/allow-ipv4.xml']
modified.conffile..etc.libvirt.nwfilter.clean-traffic-gateway.xml: 
[inaccessible: [Errno 13] Permission denied: 
'/etc/libvirt/nwfilter/clean-traffic-gateway.xml']
modified.conffile..etc.libvirt.nwfilter.clean-traffic.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/clean-traffic.xml']
modified.conffile..etc.libvirt.nwfilter.no-arp-ip-spoofing.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-arp-ip-spoofing.xml']
modified.conffile..etc.libvirt.nwfilter.no-arp-mac-spoofing.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-arp-mac-spoofing.xml']
modified.conffile..etc.libvirt.nwfilter.no-arp-spoofing.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-arp-spoofing.xml']
modified.conffile..etc.libvirt.nwfilter.no-ip-multicast.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-ip-multicast.xml']
modified.conffile..etc.libvirt.nwfilter.no-ip-spoofing.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-ip-spoofing.xml']
modified.conffile..etc.libvirt.nwfilter.no-mac-broadcast.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-mac-broadcast.xml']
modified.conffile..etc.libvirt.nwfilter.no-mac-spoofing.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-mac-spoofing.xml']
modified.conffile..etc.libvirt.nwfilter.no-other-l2-traffic.xml: [inaccessible: 
[Errno 13] Permission denied: '/etc/libvirt/nwfilter/no-other-l2-traffic.xml']
modified.conffile..etc.libvirt.nwfilter.no-other-rarp-traffic.xml: 
[inaccessible: [Errno 13] Permission denied: 
'/etc/libvirt/nwfilter/no-other-rarp-traffic.xml']