WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Why is xen allocating entire disk/file?

On Thu, Jan 29, 2009 at 12:20 PM, Charlie Reddington
<charlie.reddington@xxxxxxxxx> wrote:
> # df -h
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/sda1             446G   43G  381G  10% /
> tmpfs                 3.9G     0  3.9G   0% /dev/shm
>
> Right here alone, has me kind of sketcy. Total - 446G - 43G should = 403G

No comment on that one :)

>
> But in var/lib/xen/images.....
>
> # du -sh *
> 9.8G    ns1.img
> 9.8G    ns2..img
> 119M    shared01.img
> 20G             www.img
>
> Doing the command as you say.....
>
> 9.8G -rwxrwxr-x 1 root root 9.8G Jan 28 15:18 ns1.img
> 9.8G -rwxrwxr-x 1 root root 9.8G Jan 28 15:18 ns2.img
> 134M -rwxrwxr-x 1 root root  98G Jan 28 15:18 shared01.img
>  20G -rwxrwxr-x 1 root root  20G Jan 28 15:18 www.img
>

So it doesn't use 100G right away, right?
Both "du -sh" and "ls -lash" (leftmost column) shows space actually
used. It can be different from the right column if it's created as
sparse file (in your case, "not to allocate the entire disk yet").

> I'm just overall kind of confused how this is working.  I should in theory
> be able to over allocate a number of vm's, so that when I get close to
> running out, I can just add more disk space as cash allows.

Yes, it should work like that. Note however that using sparse file has
the downside of :
- lower I/O performance initially (i.e. only when it has to allocate
disk space previously used)
- there might be a condition when you run out of space (e.g. when all
domU unexpectedly needs more space) which can lead to unpredictable
result.

Regards,

Fajar

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users