Solved

KVM allocates entire storage on virtual disk

Posted on 2010-09-17
4
439 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to clone Linux server? 15 65
Android Security Model 3 72
oracle query help 36 67
Help needed with BIND9 DNS on Ubuntu. 22 68
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now