cloudfoundry / cloudfoundry/bosh

mount option for ephemeral disk (alternative to cron scheduling fstrim)

Open
#2,534 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.1k
Forks
662
Avg merge
5h 25m
Merged PRs (30d)
2

Description

Is your feature request related to a problem? Please describe.

As a bosh operator, in order to reclaim space on ephemeral thin-provisioned disk, I need bosh to support specifying the mount option to discard

https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vsan.doc/GUID-C75E80AE-2DA8-4314-98E5-B7F8CE98E1BF.html

Deleting or removing files frees space within the file system. This free space is mapped to a storage device until the file system releases or unmaps it. vSAN supports reclamation of free space, which is also called the unmap operation.
vSAN also supports the SCSI UNMAP commands issued directly from a guest operating system to reclaim storage space. vSAN supports offline unmaps and inline unmaps. On Linux OS, offline unmaps are performed with the fstrim(8) command, and inline unmaps are performed when the mount -o discard command is used.

Currently, bosh only supports controlling mount options on persistent disks:

https://bosh.io/docs/manifest-v2/#instance-groups

persistent_disk_mount_options [Array of strings, optional]: Mount options when mounting persistent disk. Example: ["noatime"].

whereas ephemeral disk mount points can not be changed:

# mount | grep /var/vcap/data
/dev/sdb1 on /var/vcap/data type ext4 (rw,relatime)

Describe the solution you'd like

A new property ephemeral_disk_mount_options which I can set to ['discard']

Describe alternatives you've considered

Scheduling a cron to periodically execute fstrim

Additional context
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how persistent_disk_mount_options is handled and how the /var/vcap/data ephemeral disk is mounted. Compare the existing persistent-disk path with ephemeral-disk setup and identify relevant tests before defining coverage for ephemeral_disk_mount_options. Done means the new property accepts discard and produces the requested mount behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
devops, infrastructure, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.