Skip to content
Latest
Cleaning up SDDC Manager after a VCF 9.1.2 upgrade, and getting the space back on vSAN ESA
VMware Cloud Foundation December 4, 2026 10 min read Verified accurate

Cleaning up SDDC Manager after a VCF 9.1.2 upgrade, and getting the space back on vSAN ESA

With the management domain finally on VCF 9.1.2 (the vCenter part of that story is in my previous post), I wanted to tidy up before calling it done. A year of upgrades leaves things behind, and SDDC Manager is where most of it piles up. I expected to delete a few old bundles and move on. Instead I learned that deleting files inside a VM on vSAN ESA doesn’t give you the space back, and that the fix for that takes a lot longer than you’d think.

TL;DR

  • Old upgrade bundles live in /nfs/vmware/vcf/nfs-mount/bundle on SDDC Manager. Mine had six of them, all for versions I was no longer running, taking 110G.
  • Remove them with bundle_cleanup.py, not rm. Pass -st, otherwise it also deletes the task history for those bundles, which includes your past upgrades.
  • Deleting files in the guest only frees the space inside the guest. vSAN keeps counting those blocks until the guest tells it they are free, which means running fstrim.
  • On a big volume fstrim can run for an hour or more with no output at all. Run it in chunks so you can see it working.

Getting a shell

SDDC Manager doesn’t allow root over SSH, so you log in as vcf and then su -. One thing that tripped me up: the SSH session kept closing right after I typed the password, which made me think the account was locked. faillock --user vcf showed zero failures. The appliance just has a short login grace time, and I was opening the session and then wandering off before typing the password. If you see Connection closed straight after the password prompt, try again and type it right away.

Where the space actually goes

First a look at the filesystems.

df -h -x tmpfs -x devtmpfs

SDDC Manager has a lot of logical volumes and most of them are mostly empty by design. This is roughly what mine looked like before I touched anything:

MountSizeUsedWhat it is
/nfs/vmware/vcf/nfs-mount503G180GBundle repository, depot, cluster images
/opt/vmware/vcf165G1.6GApplication data
/storage/lvm_snapshot87G0Snapshot space used during SDDC Manager upgrades
/var/log/vmware63G9.4GLogs, mostly LCM
/ and /storage/alt_root26G each9G eachA and B root partitions for upgrades

None of those sizes should be changed. The alternate root and snapshot volumes are how SDDC Manager rolls back a failed upgrade of itself. The interesting one is the repository, so I broke that down:

du -sh /nfs/vmware/vcf/nfs-mount/* | sort -h
du -sh /nfs/vmware/vcf/nfs-mount/bundle/* | sort -rh

The repository had 110G in bundle, 40G in umds, 23G in base-install-images and 8G in personalities. The last three are vLCM depot content and cluster images for the version you are actually running, so I left them alone. The bundle folder is the one to look at.

Working out which bundle is which

The bundle folders are named by UUID, which tells you nothing. Listing the first few files in each one does:

cd /nfs/vmware/vcf/nfs-mount/bundle
for d in */; do echo "== $d $(du -sh $d | cut -f1)"; ls -lhR $d | grep -vE '^total|^$' | head -8; done

The file names inside give the product and build away. Mine came out like this:

Bundle IDSizeContents
ae1127ee-f307-50d4-b0f7-9f2073126e6b39GvCenter 9.0.2 (OVA, ISO, update repo)
1ca668c7-ea67-56b2-a649-eeaac7e9dd0d34GvCenter 9.1.1.0200
fd82e8d9-c3bd-5a1c-9b03-2ae76de6d29925GVCF Automation and services runtime 9.0.1 install
52842077-9e58-58b6-bef0-ec312c7eafd98.5GNSX 9.0.2 upgrade bundle
6e079d55-cb26-459c-aabe-e8cae1f5bae54.3GSDDC Manager 9.0.2 upgrade
efd96f7d-50f2-5a02-ae7d-1da46c603d9b634MESX 9.0.2 installer ISO

Everything in the domain was on 9.1.2, so every one of these was dead weight. The VCF Automation one needed a second thought, because if Automation had been deployed it might be the bundle it came from. I don’t run VCF Automation at all, and a future deployment would use a current 9.1 bundle from the depot anyway, so it went too.

Leave depot and VMware alone. Those hold SDDC Manager’s own state, and the folders under VMware/vRack/lcm are named after your workload domain IDs.

Deleting bundles the supported way

If you just rm the folders, the SDDC Manager database still thinks the bundles are there. There is a cleanup script that removes both the files and the database entries:

python3 /opt/vmware/vcf/lcm/lcm-app/bin/bundle_cleanup.py --help
usage: bundle_cleanup.py [-h] [-st] bundles [bundles ...]

positional arguments:
  bundles               bundleIds to be deleted separated with space

options:
  -h, --help            show this help message and exit
  -st, --skip-task-deletion
                        Skips the tasks deletion

That -st flag is the one to notice. By default the script also deletes the tasks linked to each bundle, and for upgrade bundles that is your upgrade history. I wanted to keep that, so:

python3 /opt/vmware/vcf/lcm/lcm-app/bin/bundle_cleanup.py -st \
  ae1127ee-f307-50d4-b0f7-9f2073126e6b \
  1ca668c7-ea67-56b2-a649-eeaac7e9dd0d \
  52842077-9e58-58b6-bef0-ec312c7eafd9 \
  6e079d55-cb26-459c-aabe-e8cae1f5bae5 \
  efd96f7d-50f2-5a02-ae7d-1da46c603d9b

It took about six seconds and logs to /var/log/vmware/vcf/lcm/bundle_cleanup.log. I ran it again for the Automation bundle once I’d made up my mind on that one.

StepRepository used
Before180G (38%)
After the five version bundles95G (20%)
After the Automation bundle71G (15%)

So 109G gone, and only depot and VMware left in the bundle folder.

Then vCenter still said 688 GB

Pleased with myself, I went to the SDDC Manager VM in vCenter and looked at Storage used. It said 687.8 GB. The guest has maybe 110G of real data across every volume. So what is going on?

SDDC Manager VM summary in vCenter showing 687.8 GB of storage used
The SDDC Manager VM after the bundle cleanup. The guest had freed 109G, vCenter still showed 687.8 GB.

Two things. The first is the storage policy. The VM uses a RAID 5 policy, and on vSAN ESA that writes 1.5 times the data on a cluster with fewer than six hosts, or 1.25 times with six or more. The number in vCenter is raw capacity, parity included.

The second, and the bigger one, is that the disks are thin provisioned, and a thin disk only ever grows. Every bundle downloaded since the first deployment was written to that disk at some point. When you delete a file, the filesystem marks the blocks as free, but vSAN has no idea. As far as vSAN knows, those blocks still hold data, and it will keep storing and protecting them until the guest says otherwise.

Trim on vSAN ESA

The guest says otherwise with a discard, also called unmap or trim. On vSAN OSA you have to turn on Guest Trim/Unmap per cluster. On ESA it’s always on, and the setting is greyed out with a note that it can’t be disabled. So the storage side was ready. What was missing was the guest actually sending the discards, because Linux doesn’t do that on delete unless the filesystem is mounted with it. You do it by hand with fstrim:

fstrim -v /nfs/vmware/vcf/nfs-mount

It’s safe on a live system. It doesn’t touch data, it only tells the storage which blocks are no longer in use.

vSAN ESA cluster advanced options with Guest Trim/Unmap greyed out
On vSAN ESA the Guest Trim/Unmap toggle is greyed out because it is always on.

What nobody tells you is how long it takes. fstrim sends discards for all of the free space on the volume, not just what you deleted. That was 407G for me. It prints nothing until it finishes, and after twenty minutes of a blinking cursor I started to wonder if it had hung.

Checking that it is doing something

The kernel keeps discard counters per disk in /proc/diskstats. From a second session:

grep -E ' sd[a-z] ' /proc/diskstats | awk '{printf "%s discards=%s trimmed=%.1f GiB\n", $3, $15, $17*512/1073741824}'
sda discards=0 trimmed=0.0 GiB
sdb discards=0 trimmed=0.0 GiB
sdc discards=0 trimmed=0.0 GiB
sdd discards=1357 trimmed=70.0 GiB
sde discards=0 trimmed=0.0 GiB
sdf discards=0 trimmed=0.0 GiB

So it was working, on the disk behind the repository volume, at roughly 3.5 GiB a minute. My guess is that ESA paces unmap so it doesn’t hurt normal I/O. In the cluster performance charts latency stayed around 0.1 to 0.2 ms and congestion stayed at zero the whole time. At that rate the full volume was going to take one and a half to two hours.

vSAN cluster performance charts during the trim, latency around 0.1 ms and zero congestion
Cluster performance while the trim ran. Latency stayed around 0.1 ms and congestion stayed at zero.

Trim in chunks instead

Rather than stare at a cursor, I started trimming 50G at a time from a second session, so each step prints a line. If you go this way, stop the original run first with Ctrl C. That’s safe, anything already trimmed stays trimmed.

for o in 0 50 100 150 200 250 300 350 400 450; do fstrim -v -o ${o}G -l 50G /nfs/vmware/vcf/nfs-mount; done
/nfs/vmware/vcf/nfs-mount: 0 B (0 bytes) trimmed
/nfs/vmware/vcf/nfs-mount: 0 B (0 bytes) trimmed
/nfs/vmware/vcf/nfs-mount: 7.8 GiB (8354652160 bytes) trimmed
/nfs/vmware/vcf/nfs-mount: 23.2 GiB (24937779200 bytes) trimmed
/nfs/vmware/vcf/nfs-mount: 17.9 GiB (19196645376 bytes) trimmed
/nfs/vmware/vcf/nfs-mount: 24.1 GiB (25858334720 bytes) trimmed
/nfs/vmware/vcf/nfs-mount: 24.1 GiB (25856798720 bytes) trimmed
/nfs/vmware/vcf/nfs-mount: 24.7 GiB (26506166272 bytes) trimmed
/nfs/vmware/vcf/nfs-mount: 23.3 GiB (25033764864 bytes) trimmed
/nfs/vmware/vcf/nfs-mount: 17.7 GiB (18957651968 bytes) trimmed

The first chunks report 0 B because the earlier run had already covered them, and ext4 remembers which block groups it has trimmed. Those zeros are also because I hadn’t stopped the first run yet, so for a while two trims were working the same filesystem. Don’t do that, they just get in each other’s way.

Once it finishes, give vSAN a few minutes and refresh the VM summary. Space is released in the background, so the Used figure can keep dropping for a while after the prompt comes back.

While I was at it

NSX Manager. NSX keeps a folder per version in /repository. After the upgrade mine had both 9.1.2.0.0.25929667 and 9.1.1.0100.0.25762940, about 6G each. With managers, edges and hosts all on 9.1.2 nothing uses the old one, so I removed it and the volume went from 42% to 21%. Keep the folder for the version you are running, because the host and edge upgrade pages read from it. If you have three managers, each one has its own copy.

vCenter. Nothing to do inside it. The reduced downtime upgrade builds a brand new appliance every time, so the disks start clean. The thing to clean up is the old appliance, which is left powered off after the switchover as a way back. Once you are happy with the new one and have a fresh file based backup, delete it from disk. Remove from Inventory leaves the files on the datastore.

Checklist

  1. Log in as vcf, then su -. Type the password promptly.
  2. du the bundle folder and list the files in each bundle to see what it is.
  3. Keep depot, VMware, umds, base-install-images and personalities.
  4. Remove old bundles with bundle_cleanup.py -st and the bundle IDs.
  5. Run fstrim on the repository volume, in 50G chunks if it’s large, and watch /proc/diskstats if you want proof it’s moving.
  6. Remove the old version folder from /repository on each NSX Manager.
  7. Delete the old vCenter appliance from disk once you trust the new one.
Share

Leave a comment

Comments need your full name and email — no anonymous comments. Your email is never published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.