vCenter upgrade from 7.0 U3 to 8.0 U2 fails with an error "Database in-place upgrade failed. Please see vcdb_inplace.err and vcdb_inplace.out for details."
search cancel

vCenter upgrade from 7.0 U3 to 8.0 U2 fails with an error "Database in-place upgrade failed. Please see vcdb_inplace.err and vcdb_inplace.out for details."

book

Article ID: 371665

calendar_today

Updated On:

Products

VMware vCenter Server 7.0

Issue/Introduction

  • vCenter Server upgrade fails in stage 2 with the following error:
    Database in-place upgrade failed. Please see vcdb_inplace.err and vcdb_inplace.out for details.
    Please search for these symptoms in the VMware Knowledge Base for any known issues and possible
    resolutions. If none can be found, collect a support bundle and open a support request.
    
    VMware VirtualCenter failed firstboot.
    Please search for these symptoms in the VMware Knowledge Base for any known issues and possible
    resolutions. If none can be found, collect a support bundle and open a support request.



  • The following is seen in /var/log/firstboot logs:
    INFO firstbootInfrastructure Firstboot duration: 335 sec
    INFO firstbootInfrastructure First boot is a failure
    ERROR firstbootInfrastructure Installation of vCenter server failed with firstboot scripts
    Failed to run inplace database upgrade - Error while executing ./Upgrade-v2017-to-v2018/postgresql/upgrade_PostgreSQL.sql, reason: Statement failure(rc=-1).
    ALTER SEQUENCE IF EXISTS VPX_EVENT_SEQ INCREMENT BY 1000 MINVALUE 1 MAXVALUE 4294965000 CYCLE;
    
    
    1 [22023](1) ERROR: RESTART value (8588097201) cannot be greater than MAXVALUE (4294965000);
    Error while executing the query
    Error while executing ./Upgrade-v2017-to-v2018/postgresql/VCDB_views_PostgreSQL.sql:1345, reason: Statement failure(rc=-1).

Environment

vCenter Server 7.x

Cause

This issue occurs during the sequence that generates IDs for the events in the VCDB. At some point, the generated ID exceeds the maximum value, causing a failure. The value in the failure logs is greater than the maximum limit, so it is necessary to reset the sequence value.

ERROR: RESTART value (8588097201) cannot be greater than MAXVALUE (4294965000);

 

Resolution

Note: Please ensure that a fresh backup of the vCenter Server Appliance exists before attempting to make any changes to the vCenter database.

Steps to reset the sequence value in VCDB:

  • Connect to the VCDB:
    /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
  •  Run the following command to check the sequence value:
    SELECT nextval('vc.vpx_event_seq');

    For example:

    VCDB=# SELECT nextval ('vc.vpx_event_seq' );
    nextval
    8588565201
    (1 row)
  •  Reset the sequence value:
    SELECT setval('vc.vpx_event_seq', 1, false);
  • Proceed with the upgrade.