Hello, i am creating my XEN VM with virt-install (see below). When I create new images i do first an "df -h" to see if there is still enough space left on the drive. Are the XEN images pre allocated or does XEN only use that space that really is used by the VM inside the image? I know have the Problem that an "du -h" inside my /VM folder gives me nearly a higher number that the harddisk has on size. [root@x1blade3:~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 106G 102G 0 100% / /dev/sda1 99M 24M 71M 25% /boot tmpfs 3.9G 0 3.9G 0% /dev/shm [root@x1blade3:~]# ls -lah /VM total 101G thats only the VM folder. this is how I create my VM. virt-install \ --name=translator-vm1 \ --ram=1000 \ --file=/VM/translator-vm1.img \ --file-size=10 \ --vcpus=2 \ --os-variant=centos5 \ --nographics \ --location ftp://wftp.tu-chemnitz.de/pub/linux/centos/5.2/os/x86_64/ \ thx _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Heiko wrote on Thu, 15 Jan 2009 12:37:58 +0100:> Are the XEN images pre allocated or does XEN only use that space that > really is used by the VM inside the image?If I remember correctly virt-install does *not* create sparse files. This is a not a matter of Xen, but simply how the image file gets created. You can create it before use by virt-install for instance.> I know have the Problem that an "du -h" inside my /VM folder gives me > nearly a higher number that the harddisk has on size.well, du is missing from your quotes now ;-)> /dev/sda3 106G 102G 0 100% /your root system is full. Independant of the question whether your VMs are using sparse files or not ;-)> [root@x1blade3:~]# ls -lah /VM > total 101Gls gives you the amount that is reserved for the file in the directory list, it doesn''t give you the real size of the file. The real size is shown by du -s. Run a "du -s *" in that folder and it will list real sizes for each file and folder in there (or a "du -s /VM" to get the complete value for that directory). Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Jan 15, 2009 at 2:23 PM, Kai Schaetzl <maillists@conactive.com> wrote:> Heiko wrote on Thu, 15 Jan 2009 12:37:58 +0100: > >> Are the XEN images pre allocated or does XEN only use that space that >> really is used by the VM inside the image? > > If I remember correctly virt-install does *not* create sparse files. This > is a not a matter of Xen, but simply how the image file gets created. You > can create it before use by virt-install for instance. >Hello, in the future we will create the file with dd before installing,seems to be better.>> I know have the Problem that an "du -h" inside my /VM folder gives me >> nearly a higher number that the harddisk has on size. > > well, du is missing from your quotes now ;-) > >> /dev/sda3 106G 102G 0 100% / > > your root system is full. Independant of the question whether your VMs are > using sparse files or not ;-) > >> [root@x1blade3:~]# ls -lah /VM >> total 101G > > ls gives you the amount that is reserved for the file in the directory > list, it doesn't give you the real size of the file. The real size is > shown by du -s. Run a "du -s *" in that folder and it will list real sizes > for each file and folder in there (or a "du -s /VM" to get the complete > value for that directory). >mmh,i get the same number with both commands when i sum up all the imagesizes below I get 100GB, but df says I still have 34GB free and df that are only 50GB in use. So for planning new VM i should always count on the imagesize and not what df/du are telling me? [root@x1blade1:/VM]# ls -lah total 50G drwxr-xr-x 2 root root 4.0K Jan 15 11:24 . drwxr-xr-x 25 root root 4.0K Mar 10 2008 .. 2.0G May 5 2008 auto-input_swapfile.img 31G Jan 15 13:36 auto-input-vm1.img 2.0G Mar 13 2008 distribution_swap.img 11G Jan 15 13:36 distribution-vm1.img 26G Jan 15 13:36 monitoring-1.img 2.0G Mar 19 2008 monitoring-1_swapfile.img 2.0G Jan 7 08:26 translator_swap.img 11G Jan 15 13:36 translator-vm1.img 11G Jan 15 13:36 uat-vm1.img 2.0G Mar 26 2008 uat-vm1_swapfile.img [root@x1blade1:/VM]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 106G 67G 34G 67% / /dev/sda1 99M 24M 71M 25% /boot tmpfs 3.9G 0 3.9G 0% /dev/shm greetings Heiko> Kai > > -- > Kai Schätzl, Berlin, Germany > Get your web at Conactive Internet Services: http://www.conactive.com > > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Heiko wrote on Thu, 15 Jan 2009 14:42:46 +0100: I think you are confusing df/du/ls soemtimes. You give figures that you say are from df, but later it turns out they are from ls etc. Try to be more precise in what you tell and what you do.> [root@x1blade1:/VM]# df -hthe df in your first mail was from a different host. Just confusing you *and* me.> [root@x1blade1:/VM]# ls -lah > total 50G > drwxr-xr-x 2 root root 4.0K Jan 15 11:24 . > drwxr-xr-x 25 root root 4.0K Mar 10 2008 .. > 2.0G May 5 2008 auto-input_swapfile.img > 31G Jan 15 13:36 auto-input-vm1.img > 2.0G Mar 13 2008 distribution_swap.img > 11G Jan 15 13:36 distribution-vm1.img > 26G Jan 15 13:36 monitoring-1.img > 2.0G Mar 19 2008 monitoring-1_swapfile.img > 2.0G Jan 7 08:26 translator_swap.img > 11G Jan 15 13:36 translator-vm1.img > 11G Jan 15 13:36 uat-vm1.img > 2.0G Mar 26 2008 uat-vm1_swapfile.imgI told you to use "du -s *" in that directory, I don''t think you did that. If you would you would get figures from the individual files that are *not* the same as above! (Or if you want human-readable format, use "du -sh *".) Obviously the file sizes above add up to more than 50 GB. Which means there *are* sparse files in use. (*) I don''t know where "ls" gets the "total" from, but that''s obviously the actually committed total in reserved blocks = the size that is actually in use. The size for the individual files is *not* the size in use, but what is stored somewhere (inode, whereever, I''m not an fs expert) as the given size at creation time. If it is a sparse file this shows the size value it can grow to. It does not show the actual size on the file system (that is what du is for, and df != du) (*)Overcommitting in such a way is actually dangerous. I think that should be obvious. Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Jan 15, 2009 at 3:31 PM, Kai Schaetzl <maillists@conactive.com> wrote:> Heiko wrote on Thu, 15 Jan 2009 14:42:46 +0100: > > I think you are confusing df/du/ls soemtimes. You give figures that you say > are from df, but later it turns out they are from ls etc. Try to be more > precise in what you tell and what you do. > >> [root@x1blade1:/VM]# df -h > > the df in your first mail was from a different host. Just confusing you *and* > me.true, sorry. but I found this to be a better example.> >> [root@x1blade1:/VM]# ls -lah >> total 50G >> drwxr-xr-x 2 root root 4.0K Jan 15 11:24 . >> drwxr-xr-x 25 root root 4.0K Mar 10 2008 .. >> 2.0G May 5 2008 auto-input_swapfile.img >> 31G Jan 15 13:36 auto-input-vm1.img >> 2.0G Mar 13 2008 distribution_swap.img >> 11G Jan 15 13:36 distribution-vm1.img >> 26G Jan 15 13:36 monitoring-1.img >> 2.0G Mar 19 2008 monitoring-1_swapfile.img >> 2.0G Jan 7 08:26 translator_swap.img >> 11G Jan 15 13:36 translator-vm1.img >> 11G Jan 15 13:36 uat-vm1.img >> 2.0G Mar 26 2008 uat-vm1_swapfile.img > > I told you to use "du -s *" in that directory, I don't think you did that. If > you would you would get figures from the individual files that are *not* the > same as above! (Or if you want human-readable format, use "du -sh *".) >[root@x1blade1:/VM]# du -s 52085392 I just pasted the above lines to show what I mean by difference between the two statements.> Obviously the file sizes above add up to more than 50 GB. Which means there > *are* sparse files in use. (*) I don't know where "ls" gets the "total" from, > but that's obviously the actually committed total in reserved blocks = the > size that is actually in use. The size for the individual files is *not* the > size in use, but what is stored somewhere (inode, whereever, I'm not an fs> expert) as the given size at creation time. If it is a sparse file this shows > the size value it can grow to. It does not show the actual size on the file > system (that is what du is for, and df != du) >thats the thing i wanted to find out> (*)Overcommitting in such a way is actually dangerous. I think that should be > obvious. >of course. leaves me with some missing space, where to put the VM that are to much now. Thx for the info and sorry for any confussion.> Kai > > -- > Kai Schätzl, Berlin, Germany > Get your web at Conactive Internet Services: http://www.conactive.com > > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Heiko wrote on Thu, 15 Jan 2009 15:55:58 +0100:> [root@x1blade1:/VM]# du -sThis is not what I told you to do !!! "du -s *" Do you see the difference? The asterisk is important! Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users