GNS3 / gns3-server

GNS3 server
GNU General Public License v3.0
768 stars 258 forks source link

GNS3server timeout when you create a disk with qcow2 preallocation different off #2313

Closed Mario156090 closed 8 months ago

Mario156090 commented 8 months ago

Hello dear GNS3 developer team, today I need to create a Qcow2 disk from GNS3 and when I create the disk in qemu VM and I add the VM to a project GNS3 is break. This happen with normal user and root user. This happen when we create a qcow2 disk with prealocate different off. So for fix this We need reinstall GNS3 because the config is break.

image

image

grossmj commented 8 months ago

Thanks for the report. I can reproduce the problem.

The problem is the GNS3 server calls qemu-img and a preallocation makes it slow to create the image and then the GUI timeouts.

For instance, it takes around 35s on my system to preallocate a 30 GB image: (default timeout is 30 seconds)

$ time qemu-img create -f qcow2 -o lazy_refcounts=off -o preallocation=full TEST2.qcow2 30000M
Formatting 'TEST2.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=full compression_type=zlib size=31457280000 lazy_refcounts=off refcount_bits=16

real    0m35.224s
user    0m0.041s
sys 0m13.527s
Mario156090 commented 8 months ago

Thanks for the report. I can reproduce the problem.

The problem is the GNS3 server calls qemu-img and a preallocation makes it slow to create the image and then the GUI timeouts.

For instance, it takes around 35s on my system to preallocate a 30 GB image: (default timeout is 30 seconds)

$ time qemu-img create -f qcow2 -o lazy_refcounts=off -o preallocation=full TEST2.qcow2 30000M
Formatting 'TEST2.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=full compression_type=zlib size=31457280000 lazy_refcounts=off refcount_bits=16

real  0m35.224s
user  0m0.041s
sys   0m13.527s

Oh, OK, so the option for preallocate should be deprecated? because some person as me can try to do pre allocate 150G hhaahaha.

grossmj commented 8 months ago

Oh, OK, so the option for preallocate should be deprecated? because some person as me can try to do pre allocate 150G hhaahaha.

I will keep the option, I just have to make it non-blocking on the server side and no timeout for the progress bar on the GUI side ;)