The postupgrade scripts cause an intermittent problem when vpostgres service returns incorrect status.

Problem

When the vpostgres service reports being in a bad state, upgrade fails at the /etc/bootstrap/postupdate.d/10-postgres postupgrade script. When your upgrade fails on /etc/bootstrap/preupdate.d/10-postgres script execution, run these three scripts, one at a time, in the following order, and restart upgrade.

(1)

rm -rf /storage/db/psql-upgrade

(2)

cat > /etc/bootstrap/preupdate.d/00-00-00-fix-psql-restart << "EOF"
   #!/bin/sh

   cat >> /usr/lib/vmware-bootstrap-vrva-base/psql.inc << "EOF"

   function psql_restart () {
      echo 'Restarting PostgreSQL server..'
      service ${psql_service} stop > /dev/null
      service ${psql_service} start
      echo 'restart_psql finished'
   }
  EOF

(3)

chmod 700 /etc/bootstrap/preupdate.d/00-00-00-fix-psql-restart