Solved

KVM allocates entire storage on virtual disk

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

Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Remove a folder in Linux 9 91
What language/protocol is the Angular Chat? 2 58
linux installs 6 50
How to Remove files with a Date in the Filename with Linux Scripting 3 29
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

863 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

27 Experts available now in Live!

Get 1:1 Help Now