Skip to main content

Linux disk fill

Linux disk fill fills up the available disk space at a given system path for a specific duration.

Linux disk fill

Use cases

Linux disk fill:

  • Induces heavy disk usage scenario on the target Linux machines.
  • Simulates a lack of storage space for the underlying applications in the system.
  • Validates application failover and data resiliency in the scenario of low disk space.
note
  • This fault can be executed on Ubuntu 16 or higher, Debian 10 or higher, CentOS 7 or higher, RHEL 7 or higher, Fedora 30 or higher, and openSUSE LEAP 15.4 or higher.
  • The linux-chaos-infrastructure systemd service should be in an active state, and the infrastructure should be in CONNECTED state.

Fault permissions

The fault uses the root Linux user and root user group.

Optional tunables

Tunable Description Notes
fillPath System path to fill. Path to a valid directory.
fillStorage Amount of storage to be filled. Can be specified in bytes (b/B), kilobytes (k/K), megabytes (m/M), gigabytes (g/G), or percentage (%) of available storage. If no unit is provided, the value is assumed to be in bytes. Example values: 30m, 1G, 35%, etc. Default: 50%.
dataBlockSize Size of each data block used to fill up the disk. Can be specified in bytes (b/B), kilobytes (k/K), megabytes (m/M), or gigabytes (g/G). If no unit is provided, the value is assumed to be in bytes. Example values: 30m, 500k, 1G, etc. Default: 256 KB.
duration Duration through which chaos is injected into the target resource. Should be provided in [numeric-hours]h[numeric-minutes]m[numeric-seconds]s format. Default: 30s. Examples: 1m25s, 1h3m2s, 1h3s
rampTime Period to wait before and after injecting chaos. Should be provided in [numeric-hours]h[numeric-minutes]m[numeric-seconds]s format. Default: 0s. Examples: 1m25s, 1h3m2s, 1h3s

Fill path

The fillPath input variable determines the system path to be filled up.

The following YAML snippet illustrates the use of this input variable:

# specify the fill path
apiVersion: litmuchaos.io/v1alpha1
kind: LinuxFault
metadata:
name: linux-disk-fill
labels:
name: disk-fill
spec:
diskFillChaos/inputs:
fillPath: "/"
duration: 30s

Fill storage

The fillStorage input variable determines the amount of storage space to be filled up at the fillPath path.

The following YAML snippet illustrates the use of this input variable:

# specify the storage to be filled
apiVersion: litmuchaos.io/v1alpha1
kind: LinuxFault
metadata:
name: linux-disk-fill
labels:
name: disk-fill
spec:
diskFillChaos/inputs:
fillPath: "/"
fillStorage: 72%
duration: 30s

Data block size

The dataBlockSize input variable determines the size of a single block of data, that is used to fill up the disk. A larger block size results in quick completion of the disk fill operation and vice-versa.

The following YAML snippet illustrates the use of this input variable:

# specify the data block size
apiVersion: litmuchaos.io/v1alpha1
kind: LinuxFault
metadata:
name: linux-disk-fill
labels:
name: disk-fill
spec:
diskFillChaos/inputs:
fillPath: "/"
fillStorage: 80%
dataBlockSize: 400k
duration: 30s