Disk Space Management

Running out of disk space can have a severe impact on the SUSE Multi-Linux Manager database and file structure which, in some cases, is not recoverable.

SUSE Multi-Linux Manager monitors some directories for free disk space. You can modify which directories are monitored, and the warnings that are created using environment variables in systemd service override files.

When the available space in one of the monitored directories falls below a warning threshold, a message is sent to the configured email address and a notification is shown at the top of the sign-in page.

1. Monitored Directories

By default, the SUSE Multi-Linux Manager Server container monitors these directories:

  • /var/spacewalk

  • /var/cache

  • /srv

You can change which directories are monitored by setting the DISKCHECKDIRS environment variable in the server container systemd service. You can specify multiple directories by separating them with a space.

The DISKCHECKDIRS environment variable applies only to the server container. The database container always monitors /var/lib/pgsql/data and this cannot be overridden.

Procedure: Configuring Monitored Directories
  1. Create a systemd override directory for the server service:

    mkdir -p /etc/systemd/system/uyuni-server.service.d/
  2. Create a configuration file with the custom directories:

    cat > /etc/systemd/system/uyuni-server.service.d/diskcheck.conf << 'EOF'
    [Service]
    Environment="DISKCHECKDIRS=/var/spacewalk /var/cache /srv"
    EOF
  3. Apply the configuration by restarting SUSE Multi-Linux Manager:

    mgradm restart

For more information about container volumes, see Persistent Container Volumes.

2. Thresholds

By default, SUSE Multi-Linux Manager creates a warning when a monitored directory reaches 90% disk usage. A critical alert is created when a monitored directory reaches 95% disk usage, and the container health check will fail.

You can change these alert thresholds by setting the DISKCHECKALERT and DISKTHRESHOLD environment variables.

Procedure: Configuring Disk Check Thresholds
  1. Create systemd override directories:

    mkdir -p /etc/systemd/system/uyuni-server.service.d/
    mkdir -p /etc/systemd/system/uyuni-db.service.d/
  2. Create configuration files for both server and database services:

    cat > /etc/systemd/system/uyuni-server.service.d/diskcheck.conf << 'EOF'
    [Service]
    Environment="DISKCHECKALERT=90"
    Environment="DISKTHRESHOLD=95"
    EOF
    
    cat > /etc/systemd/system/uyuni-db.service.d/diskcheck.conf << 'EOF'
    [Service]
    Environment="DISKCHECKALERT=90"
    Environment="DISKTHRESHOLD=95"
    EOF
  3. Apply the configuration by restarting SUSE Multi-Linux Manager:

    mgradm restart

For large deployments with multi-terabyte storage volumes, you may want to use higher thresholds to make more efficient use of disk space. For example, on a 10 TB volume, keeping 5% free means 500 GB unused. For tuning recommendations for large deployments, see specialized-guides:large-deployments/tuning.adoc#diskcheck-thresholds.

3. Database Disk Check

The database container has its own disk check that monitors only the PostgreSQL data directory (/var/lib/pgsql/data). This directory is always monitored and cannot be changed or overridden with the DISKCHECKDIRS environment variable.

The database disk check uses the DISKCHECKALERT and DISKTHRESHOLD environment variables configured for the uyuni-db service.

The database disk check runs as a PostgreSQL function and is invoked during container health checks. When the threshold is exceeded, the health check will fail and the container will be automatically stopped to prevent data corruption.

The database container only monitors /var/lib/pgsql/data. You cannot configure additional directories to monitor in the database container using DISKCHECKDIRS. To monitor other directories, use the server container configuration.

4. Disable Space Checking

The space checking tool is enabled by default and runs hourly via a Taskomatic scheduled task. Notification can be disabled by disabling diskcheck-task-queue-default Taskomatic job. To effectively disable disk space monitoring, set the threshold values to 99 (percent).

Procedure: Disabling Disk Space Monitoring
  1. Edit the systemd override files to set very high thresholds:

    cat > /etc/systemd/system/uyuni-server.service.d/diskcheck.conf << 'EOF'
    [Service]
    Environment="DISKCHECKALERT=99"
    Environment="DISKTHRESHOLD=99"
    EOF
    
    cat > /etc/systemd/system/uyuni-db.service.d/diskcheck.conf << 'EOF'
    [Service]
    Environment="DISKCHECKALERT=99"
    Environment="DISKTHRESHOLD=99"
    EOF
  2. Apply the configuration by restarting SUSE Multi-Linux Manager:

    mgradm restart

Disabling disk space monitoring is not recommended in production environments, as running out of disk space can cause severe and potentially unrecoverable damage to the database.