steve1977 Posted June 29, 2019 Share Posted June 29, 2019 This is really odd. I have a 1TB unassigned drive for VM and docker. I have two VMs (together 810G). I have quite some dockers, but surprised that they now fill up the remaining 190G. Something seems to be wrong. I used to have 100G empty space on this drive. Haven't installed any docker and don't think any of the dockers expanded significantly. What changed though is that I started to fill up the VMs. Are vdisks dynamic and could this be the reason (i.e., dockers may have always taken 190G, but it showed 100G free as the VMs gave some dynamic free space to the drive?). The disk now is literally full-full (just a few kbs left), so this is worrisome and for sure will lead to major issues if I don't solve this quickly. Any thoughts how to trouble-shoot? Link to comment
JonathanM Posted June 29, 2019 Share Posted June 29, 2019 12 minutes ago, steve1977 said: Are vdisks dynamic and could this be the reason (i.e., dockers may have always taken 190G, but it showed 100G free as the VMs gave some dynamic free space to the drive?). Yes, by default VM vdisks are created as sparse files, which only consume what is actually in use, but show the total defined size to the guest OS. The biggest issue with sparse vdisks is that they don't automatically shrink their allocation when you delete files in the VM. Link to comment
steve1977 Posted June 29, 2019 Author Share Posted June 29, 2019 So, I am basically screwed now? Is there any way that I can compress them again manually (without shrinking the allocated vdisk size)? Link to comment
testdasi Posted June 29, 2019 Share Posted June 29, 2019 It depends on what you meant by screwed. Do you have another disk with enough spare capacity? Link to comment
steve1977 Posted June 29, 2019 Author Share Posted June 29, 2019 Not really... That's what I meant. And moving dockers have proven very challenging for me in the past. Link to comment
JonathanM Posted June 29, 2019 Share Posted June 29, 2019 If you copy them using a method that understands sparse files you can "resparsify" them when you copy them back to the cache. So, the procedure will look like this. 1. Copy to alternate location, probably an array disk. Verify copy, delete source on cache. 2. Copy back to cache, be sure to specify sparse copy. Verify copy, delete temporary version on array. BTW, simply deleting files in the VM will not free up the space, you have to tell the VM to write zeroes to the "empty" space. Link to comment
JonathanM Posted June 29, 2019 Share Posted June 29, 2019 You may be able to reclaim the space by deleting and wiping some files in the VM's, then shutting the VM down and running fallocate on the vdisk image file. I've never tried that, I don't have first hand experience doing it. Link to comment
Squid Posted June 29, 2019 Share Posted June 29, 2019 https://forums.unraid.net/topic/51703-vm-faq/#comment-557606 (Assuming they are Windows VMs) Link to comment
testdasi Posted June 29, 2019 Share Posted June 29, 2019 Your problem is why I use qcow2 instead of raw. I can then qemu-img convert and the copy is automatically sparsed. The benefit is you can tell exactly how much space the image occupies instead of the max size. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.