VCD / root Directory Cleanup and API Request Log Retention Policy Configuration
search cancel

VCD / root Directory Cleanup and API Request Log Retention Policy Configuration

book

Article ID: 442313

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • The root directory (/) of a VMware Cloud Director (VCD) cell shows high disk space utilization (e.g., exceeding 90%).
  • When checking disk usage with the following command: du -aShx / | sort -rh | head -20
    You identify that the path /opt/vmware/vcloud-director/logs is consuming significant space (e.g., 15GB or more) and contains a massive volume of API request logs.

Environment

VMware Cloud Director 10.6.1.1

Cause

The default API request log retention policy in VCD may not be configured, or the retention period is set too long, leading to the continuous accumulation of log files that eventually exhaust the disk space on the root partition.

Resolution

Step 1: Manually Clean Up Old Logs:

First, manually delete expired log files to immediately free up disk space.

This command cannot be undone. Verify every parameter before running.

cd /opt/vmware/vcloud-director/logs
# Example: Remove all old logs from the year 2022
rm 2022*

Step 2: Configure Log Retention Policy

To prevent the issue from recurring, configure the automatic retention days for API request logs.

  1. Log in directly or by using an SSH client to the OS of the VMware Cloud Director cell as root.
  2. If you want change the retention policy of the request logs, use the manage-config subcommand of the cell management tool.
    The retention policy value represents the number of days for which VMware Cloud Director retains the National Center for Supercomputing Applications (NCSA) compliant request log. The default value is 0, where 0 means forever. Deleting the value also keeps the logs forever. The least amount of time you can keep the logs is 1 day.
    /opt/vmware/vcloud-director/bin/cell-management-tool manage-config --name "vcloud.http.log.retainDays" --value New_Value
  3. For the changes to take effect, you must restart the cells.
    After you restart a cell, it begins using the updated value. You can restart part of the cells or all of the cells at once.
    service vmware-vcd restart

Additional Information

Control the API Request Logging in VMware Cloud Director

https://techdocs.broadcom.com/us/en/vmware-cis/cloud-director/vmware-cloud-director/10-6/control-the-request-logging-in-vcd.html