Solved

KVM allocates entire storage on virtual disk

Posted on 2010-09-17
4
445 Views
Last Modified: 2013-11-15
Hi, I create a virtual machine originally though PXE, and for some reason the virtual disk size becomes the full size. That is, when I do a df inside the virtual machine it shows only 1.2gb used; however, on the host machine it shows the file size as 8gb. Why is that? How do I force the size of the image on the host machine to be the size actually used on the guest

Thanks
0
Comment
Question by:BrianGEFF719
  • 2
  • 2
4 Comments
 
LVL 35

Assisted Solution

by:torimar
torimar earned 500 total points
ID: 33705836
Could it be the virtual disk was created as "dynamically expanding"?
In that case, the complete maximum size of space may be reserved on the host, but the actual size that the guest uses and sees is only as much disk space as is actually claimed by the virtual machine. In time, this will grow up to the maximum 8 GB.

I'm not sure about KVM, but other virtualization technologies offer this dynamical storage option.
0
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 0 total points
ID: 33705998
So, I resolved the problem. As it turns out I was using a raw image format instead of a "copy on write," or QCOW as it's called in KVM. So that forced the fulled allocation. Creating a new image as qcow2 now only uses on the host exactly what the VM is using.
0
 
LVL 35

Expert Comment

by:torimar
ID: 33706216
Congratulations.

However, there is no reason to delete a question just because it has been solved. This is even counter-productive to the idea of an EE solution database. Just select your own answer as the solution, and request a closure.

Also, QCOW is kind of a "disk space on demand" technique, which is not unrelated to the concept of dynamically allocated storage. Can you exclude that it may have been my comment which pointed you to right direction for solving the issue? If you can't, it would only be fair (and standard procedure on EE) to grant me some assist points.
0
 
LVL 19

Author Comment

by:BrianGEFF719
ID: 33706791
Request my own comment.
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question