Page MenuHomeMiraheze

Enable discard on VM virtual disks
Closed, ResolvedPublic

Description

In theory, enabling this setting will ensure that unused space in the virtual disk is reclaimed by the hardware.

The goal of this task is primarily to reduce the disk usage for the hdd storage on cloud12. It is currently creeping towards exhaustion (again) in the next few weeks.

I want to see if this option will reduce the on-disk size of gluster122 which is being reported as ~590GB (larger than the allocated 550GB!), while the filesystem is only using ~430GB.

It is possible that this will additionally require setting issue_discards=1 in /etc/lvm/lvm.conf, however I am unable to confirm this requirement.

Setting this option will also require restarting the host. I recommend testing it out on gluster122 first to make sure it performs as expected before setting it on other parts of infrastructure.

Event Timeline

Void triaged this task as High priority.Oct 18 2022, 01:33
Void created this task.
Herald added subscribers: Unknown Object (User), Unknown Object (User), Reception123. · View Herald TranscriptOct 18 2022, 01:33

A quick search suggests issue_discard isn’t recommended with PVE where SSDs are in use.

As we are phasing out HDDs, this would seem like it would risk an increase in potential data corruption than resolve a problem.

In T9841#198935, @John wrote:

A quick search suggests issue_discard isn’t recommended with PVE where SSDs are in use.

All right, thanks for the clarification, I remember the information I found was a bit conflicting over whether or not it would be necessary. Does the rest of the task make sense? If not, we may have to figure out some other measure to ensure hdd storage space on cloud12 does not exhaust until T9708 can be done.

@Paladox is this worth doing for Gluster still given the move planned, what's the progress on a swift switch currently looking like? If you think it is still worth doing, can you black out some maintenance time for get this applied potentially?

I'm thinking we should move off LVM Thinpool moving forward - I setup cloud14's new SSD pool not using thinpools for the reason of ensuring data is always allocated and not dynamically allocated for this problem specifically.

I have enabled discard on gluster*.