Bug 505263

Summary: virtual machine installation very slow if "allocate entire virtual disk" not checked
Product: Red Hat Enterprise Linux 5 Reporter: Simon Xu <hxunix>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.3CC: clalance, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-06-11 09:08:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Simon Xu 2009-06-11 09:01:58 UTC
Description of problem:

In virtual machine manager, during the creating a new virtual machine, if "Allocate entire virtual disk now?" is not checked, creating the image file dynamically will be very slow, and installation will also be very slow.


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

RHEL5.3 (no update package installed) i686


How reproducible:

Always


Steps to Reproduce:

boot to xen kernel (2.6.18-128.el5)
# /etc/init.d/xend restart
# /etc/init.d/libvirtd restart
# virt-manager

* select para-virt, configure the number of memory: 1G, the number of CPU: 2 logical CPU
* start installing guest os, after configuring the guest os (do not check "allocate entire virtual disk now?", it will goes to "format filesystem" interface, and then

Actual results:
during "write super block", it is extremely slow (more than 20 minutes), and during "install package", there is no response.

Expected results:
Formatting filesystem and installation should be very fast.
it should format filesystem correctly and finish installion.


Additional info:

Comment 1 Chris Lalancette 2009-06-11 09:08:09 UTC
In point of fact, this is why we have the "Allocate entire disk now" checked by default.  The problem is that when you uncheck this box, a sparse file is created.  Any data that needs to be written to the device needs to do a full metadata update, which makes formatting and other operations extremely slow.  Switching to another filesystem like ext4 *may* improve the situation, but the basic recommendation is always to use non-sparse files.

I'm going to close this as NOTABUG, since it's a known performance problem with sparse files.

Chris Lalancette

Comment 2 Simon Xu 2009-06-11 09:17:12 UTC
But on x86_64 RHEL5.3, checking "Allocate entire disk now" or not does not make a difference, it is very fast in both ways.

Comment 3 Chris Lalancette 2009-06-11 09:25:21 UTC
(In reply to comment #2)
> But on x86_64 RHEL5.3, checking "Allocate entire disk now" or not does not make
> a difference, it is very fast in both ways.  

Is this on the same hardware?  I've found that the choice of hardware can affect sparse file performance.  However, if it's on exactly the same hardware, then that would be interesting to know.

Chris Lalancette

Comment 4 Stephen Tweedie 2009-06-11 19:37:45 UTC
Other factors that will impact the performance are reuse of an existing file for a new installation, or use of a block device or LVM volume instead of a file.

If the performance is markedly different between 32- and 64-bit in like-for-like testing --- installing to a brand new file on the same filesystem --- then that is definitely something we need to investigate.

Comment 5 Simon Xu 2009-06-18 04:10:08 UTC
I have found that, on two x86_64 machines, both 32- and 64-bit RHEL5.3 (2.6.18-128.el5) have the problem, i.e. it'll be very very slow during "write super block" if "allocate entire virtual disk now?" not checked, and during "install package", there is no response.