This tutorial will show you how to perform the SDDC Manager / root Partition Cleanup using the Command line.
Performing an SDDC Manager /root partition cleanup is crucial in VMware Cloud Foundation environments, especially if the root partition is nearing capacity. The steps below help you safely clean up the / root partition from the command line.
Step 1: The safer side recommended to take SDDC Manager appliance virtual machine snapshot without memory.
Step 2: Open PuTTY and connect to the SDDC Manager appliance.
ssh vcf@<sddc-manager-ip>!Then switch to root using su#su
Replace <sddc-manager-ip> with the actual IP address or Hostname of your SDDC Manager.
Step 3: To identify the usage of the SDDC manager file system:
#df -h
Focus on the / or root partition. If it is above 80% utilization is considered a warning and above 90% is considered critical, proceed with the cleanup.
Step 4: First check for Large Files and SOS bundle consuming the disk.
! If an SOS bundle is present on the SDDC Manager, it is safe to remove it. This blog post covers how to Generate SDDC Manager Support Bundle through UI and CLI.#ls -ltrh /var/log/vmware/vcf/sddc-support/! Use rm command to remove the file sos-<GENERATED-DATE-TIME>.tar.gz
# rm /var/log/vmware/vcf/sddc-support/sos-<GENERATED-DATE-TIME>.tar.gzReplace sos-<GENERATED-DATE-TIME>.tar.gz with the actual file from the ls ouput your SDDC Manager.! If no SOS bundle is present in the /var/log/vmware/vcf/sddc-support/ path, follow the commands below to clean up.# journalctl --disk-usage! Above the command shows disk usage of journalctl logs.#journalctl --vacuum-time=1d! Above the command safely clean up the journalctl logs.
Refer to the screenshot.
Note: If Step 4 doesn't reduce the disk usage / Partition follow Step 5.
Step 5: Identify large files and unnecessary logs
! The below command identifies the top 30 files and folders consuming space#du -ah / | sort -rh | head -n 30! Caution: Only remove tar.gz and .log files. Avoid deleting system-critical files or folders that will break the SDDC Manager. Only recommended to remove Journalctl logs and SOS bundle. If you're unsure contact Broadcom support always.#find /var/log -type f -name "*.log" -mtime +30 -exec rm -f {} \;! The above command identifies 30 days aged files and folders consuming space.! /var/tmp temp files are auto-removed during the reboot if you find any such take a reboot of the SDDC manager.
“Information is power. But like all power, there are those who want to keep it for themselves.”
― Aaron Swartz
I hope this information is useful for you. Please forgive any typos or incomplete sentences.
Thanks for Visiting vNetes.com