Jump to content

Unraid | Ubuntu Server | Vdisk continues to grow until VM pauses. OS reports less usage on disk


Recommended Posts

my 1TB vdisk continues to grow even when the OS is reporting a much smaller size. 

 

disk 3 continues to grow while on my ubuntu VM the disk is a fraction of the size (36%)

image.png.6002d05e74345483bbea2fcecdb6471a.png

 

Ubuntu VM:

image.png.702fc44f98bdca74afec6f41ff4c80a0.png

 

This is the only file/vdisk on the disk

image.png.616be5033bff7e1a38990d7dad40b6a4.png

 

 

I thought originally maybe some snapshot feature was causing this, I uninstalled snapd from ubuntu but the issue persists. 

Link to comment

That's how sparse vdisks work, unless you configure both the host and guest to allow the space to be reclaimed. By default the guest treats the entire virtual capacity of the allocated image as writeable, and unless the host and guest can agree on what bits are no longer in use, the host has no choice but to keep every write the guest makes, even if the guest goes back and "deletes" the data.

 

Here is a post that describes the process for Windows based VM's, you should be able to adapt to linux based guests as well.

https://forums.unraid.net/topic/51703-vm-faq/?tab=comments#comment-557606

 

Link to comment

Sounds if the logical size of the vdisk is larger than the available space to store it?    If so the VM will pause when the physical space used by the vdisk file uses up all the free space on the drive where it is located.    It is not good practice to ‘over-commit’ the vdisk file although there are Use Cases where it can make sense.   Was it deliberate to put it on a drive that was smaller than the logical size of the drive?

  • Thanks 1
Link to comment

The over allocation shouldn't be the issue, the used capacity on the volume never gets that close. 

 

I tried the solution mentioned in the link provided by @jonathanm 

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback' discard='unmap'/>
      <source file='/mnt/user/domains/Ubuntu/vdisk2.img' index='1'/>
      <backingStore/>
      <target dev='hdd' bus='scsi'/>
      <alias name='scsi0-0-3'/>
      <address type='drive' controller='0' bus='0' target='0' unit='3'/>

This didnt seem to make a difference. 

 

I know this is probably not the best solution, but currently i am trying a cronjob that runs fstrim periodically. this appears to be working 

Link to comment
Just now, BirdUp said:

The over allocation shouldn't be the issue, the used capacity on the volume never gets that close. 

You missed the point. What the guest shows as used, vs. what the host sees as used are two different things unless you can get the two to communicate. The "unused" space inside the image still has data written, it's just that the guest has marked the files in those spaces as deleted and available for writing. The bits are still there, and allocated as far as the host is concerned.

 

Your guest shows an address space of 964G available for storage, and the host only actually has 932G available. When the guest tries to write to an address that can't be allocated, the host pauses it instead of crashing.

  • Thanks 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...