After previously running a file system check from KB article 326323 to repair a vCenter that would not start up, the vCenter now boots up successfully, but is listing the following error on the console:
"Write-error on swap-device"
Restarting the vCenter to run another file system check per the steps in KB article 326323 does not find any issues to repair. Upon booting the vCenter, the vpostgres service is not starting, preventing dependent services from starting.
The serverlog.stderr log in the /var/log/vmware/vpostgres/ directory states the /storage/db/vpostgres/postgresql.conf file has errors.
When reviewing the latter, you get a message similar to this:
# less /storage/db/vpostgres/postgresql.conf
"/storage/db/vpostgres/postgresql.conf" may be a binary file. See it anyway?
Upon confirmation, all you see is a lot of "^@" as in the following screenshot:
This is due to the /storage/db/vpostgres/postgresql.conf, normally a text file containing configurations for the embedded vPostgres database, having been corrupted.
To solve this issue, try replacing the /storage/db/vpostgres/postgresql.conf against the same file from a working VCSA that has the same version and build.
service-control --stop --all && service-control --start --all
If replacing the postgresql.conf file allows the vpostres service to start and the rest of the vCenter services start up successfully, it is highly recommend to run a VAMI file based backup of the vCenter that can be used to perform a restoration of the vCenter if necessary. The following documentation details the VAMI backup and restore process: