why does self-created images use the whole disk?

I just noticed when I created an image from an existing VPS, that it used the while 30GB that was assigned to this VPS’s disk. Yet the actual data usage on this VPS is:

Filesystem space used 4.73 GB used out of 29.54 GB

So, shouldn’t the image rather be created from the 5GB actual data usage, instead of the whole disk image? Surely that will create a much smaller disk image instead of the 1.82 GB that it’s currently consuming.

Here’s the info of the image.

ID code xen-64-centos5.4-cPanel-11.25 Description Image version 1.0 Operating system For system type Xen Current status Local image Compressed size 1.82 GB Size on host system 30 GB Component files xen-64-centos5.4-cPanel-11.25.ext3.gz Image storage location /var/webmin/server-manager on Cloudmin master Used to create systems No systems Expected MD5 checksum 743fd1b32232cf7b4fc46d2040153512

I’m guessing what it’s doing in this case is using the actual disk image to create the new image.

Xen probably allocates all 30GB at once – so when Virtualmin creates a new image using the existing one, it’s just exactly copying that existing image, which is a 30GB file on the filesystem.

That’s not to say there isn’t a way to handle your request, but it might be an involved feature :slight_smile:

If you’d like to explore that, my recommendation would be to file a support request using the Support link above.


the behaviour you want it to have is called Dynamically expandable storage. What Cloudmin does is creating a Fixed-size storage.
I dont know if the first is possible with Xen and the way cloudmin handles VPS’s, I’d also be carefull with the first option. When the client claims diskspace you may run out of physical space in some cases.

On the other hand, having multiple options may be a positive factor.

Pls correct me if Im wrong.

The problem with this image, is that I need to assign a minimum of 30GB to all new instances that I want this image to use:

Failed to create system : Disk space must be at least 30 GB, which is the size of the selected image

Sure, I understand what you’re saying, but the VPS is being shutdown, so regardless of whether it’s LVM or image based shouldn’t make a difference.

Ideally it should do something like this:

mount -o loop /dev/dev-mapper/serv01-cpanel_root /mnt/cloudmin tar zcvf /tmp/ xen-64-centos5.4-cPanel-11.25.ext3.gz /mnt/cloudmin/.