#10181 QCOW images in recent Fedora-Cloud-Base-Vagrant libvirt boxes for Rawhide are not sparse
Closed: Invalid 2 years ago by mrc0mmand. Opened 2 years ago by mrc0mmand.

Hello,

First of all I apologize if I managed to misfile this issue, I honestly have no idea where else to report it.

As for the issue - in the past ~week I noticed that our CI jobs (which are using Rawhide Vagrant libvirt boxes from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Cloud/x86_64/images/) take an unusually long time (the difference is 30 - 60 minutes). Upon closer inspection it's apparent the images take a really long time to get processed by Vagrant and then by libvirt:

02:50:06 ==> rawhide_selinux: Adding box 'fedora-rawhide-cloud' (v0) for provider: libvirt
02:50:06     rawhide_selinux: Downloading: https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Cloud/x86_64/images/Fedora-Cloud-Base-Vagrant-Rawhide-20210623.n.0.x86_64.vagrant-libvirt.box
02:50:19 
03:00:14 ==> rawhide_selinux: Successfully added box 'fedora-rawhide-cloud' (v0) for 'libvirt'!
03:00:14 ==> rawhide_selinux: Uploading base box image as volume into Libvirt storage...
03:22:05 ==> rawhide_selinux: Creating image (snapshot of base box volume).

The download itself takes a couple of seconds, but the bsdtar, which Vagrant calls afterwards, takes the remaining ~10 minutes in this case:

# time /opt/vagrant/embedded/bin/bsdtar --no-same-owner --no-same-permissions -v -x -m  -f Fedora-Cloud-Base-Vagrant-Rawhide-20210626.n.0.x86_64.vagrant-libvirt.box 
x box.img
x Vagrantfile
x metadata.json

real    9m28.711s
user    1m32.817s
sys 0m6.098s

Also, after unpacking, the image is clearly not sparse:

# file box.img 
box.img: QEMU QCOW Image (v2), 42949672960 bytes
# ll -h box.img 
-rwxr-xr-x. 1 root root 38G Jun 26 19:55 box.img

This explains why it takes so long for the image to get imported into the libvirt storage (22 minutes in this very case).

This has to change quite recently. Just to confirm, here's a F34 Vagrant-libvirt image:

# wget https://dl.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-Vagrant-34-1.2.x86_64.vagrant-libvirt.box
...
# time /opt/vagrant/embedded/bin/bsdtar --no-same-owner --no-same-permissions -v -x -m  -f Fedora-Cloud-Base-Vagrant-34-1.2.x86_64.vagrant-libvirt.box 
x box.img
x Vagrantfile
x metadata.json

real    0m29.522s
user    0m6.796s
sys 0m0.310s

# file box.img 
box.img: QEMU QCOW Image (v2), 42949672960 bytes
# ll -h box.img 
-rwxr-xr-x. 1 root root 1.8G Jun 26 19:56 box.img

Is this a feature or a bug? I suspect the latter.


This should be reported to the Fedora Cloud WG: https://pagure.io/cloud-sig

Hah, thank you, will do!

Metadata Update from @mrc0mmand:
- Issue close_status updated to: Invalid
- Issue status updated to: Closed (was: Open)

2 years ago

Login to comment on this ticket.

Metadata