This article provides steps on how to delete files automatically when the vCenter /Storage/archive partition is full.
This issue does not affect any operations of vCenter Server, as the /storage/archive partition can be full by design.
The customer's monitoring application triggers an alert when any partition is above 80%.
1. Take a snapshot of the vCenter Server Appliance
2. SSH into the vCenter Server Appliance
3. Run the following command to enable access to the Bash shell:
shell.set --enabled true
4. Type shell and press Enter
5. In vCenter shell command line, run below command:
# crontab -e
6. Add a line as below:
0 23 * * * find /storage/archive/vpostgres/ -mtime +300 | xargs rm
7. Press Esc button, type :wq to quit
Note:
1. The above command removes old WAL segments files that are older than 300 days, and the job will be executed daily at 23:00. Either the 300-day or the 23:00 execution time can be modified according to the customer's requirements or environments.
2. For vCenter upgrades, if the process does not succeed, this change may need to be reverted or redeployed.