The vCenter Server upgrade might stop responding and take a long time
search cancel

The vCenter Server upgrade might stop responding and take a long time

book

Article ID: 340916

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

The upgrade of vCenter Server might take a long time to deploy the vCenter Server service. The slow down in the upgrade process can be caused because of high volume of historical data stored in the database, such as data for events, tasks or statistics.

 


Environment

VMware vCenter Server 5.5.x
VMware vCenter Server 6.0.x
VMware vCenter Server 5.1.x

Resolution

Reduce the historical data records before running the vCenter Server upgrade. You can use a script for your type of database. The scripts for the supported database types are mentioned in this KB article.

The scripts contain three main parameters:

  • TaskMaxAgeInDays

    All tasks older than TaskMaxAgeInDays day will be deleted.

  • EventMaxAgeInDays

    All events older than EventMaxAgeInDays day will be deleted.

  • StatMaxAgeInDays

    All statisticts older than StatMaxAgeInDays day will be deleted.

The possible values for all of the parameters are:
-1Skips the respective historical data deletion. For example, TaskMaxAgeInDays = -1, means that no task records will be deleted.
0Deletes all historical data for the respective component. For example, TaskMaxAgeInDays = 0, will delete all task records.
1 and moreDeletes data older than the number you entere, in days. For example, TaskMaxAgeInDays = 10, leaves the task records gathered within the last 10 days and deletes all of the records gathered before that.
 
 
To reduce the data, first obtain the vCenter Server database password:
 

If vCenter Server is installed on a Windows machine:

  1. Log in as an administrator to the Windows machine on which vCenter Server is installed.
  2. Locate the vcdb.properties file in the %VMWARE_CFG_DIR%\vmware-vpx\ folder and open the file in a text editor.
  3. In the vcdb.properties file, locate the password of the vCenter Server database user and record it.

If you deployed the vCenter Server Appliance

  1. Log in as an administrator to the Linux machine on which vCenter Server is installed.
  2. Locate the vcdb.properties file in the /etc/vmware-vpx/ folder and open the file in a text editor.
  3. In the vcdb.propertiesfile, locate the password of the vCenter Server database user and record it.
    You can also run cat /etc/vmware-vpx/vcdb.properties | grep "password =" | awk '{ print $3 }'

Run the script for your database

If your database is Microsoft SQL Server:

  1. Log in to the Microsoft SQL Server machine as an administrator.
  2. Download and save the 2110031_MS_SQL_task_event_task.sql script attached to this KB article.
  3. Open the command prompt and run the script:

    sqlcmd -S IP-address-or-FQDN-of-the-database-machine -U vCenter-Server-database-user -P password -d database-name -v TaskMaxAgeInDays=task-days -v EventMaxAgeInDays=event-days -v StatMaxAgeInDays=stat-days -i download-path\2110031_MS_SQL_task_event_stat.sql

If your database is Oracle:

  1. Log in to the Oracle machine
  2. Download and save the 2110031_Oracle_task_event_task.sql script attached to this KB article.
  3. Log in to sqlplus with the vCenter Server database user name and password:

    sqlplus vCenter-Server-database-user/password

  4. Run the script:

    @ <PATH></PATH>/2110031_Oracle_task_event_stat.sql task-days event-days stat-days

    Note: The order of the task, event and stat days is critical for the correct script execution.

If your database is PostgreSQL:

  1. Log in to the machine on which vCenter Server is running.
  2. Download the 2110031_Postgres_task_event_task.sql script attached to this KB article.
  3. Run the script by using psql and when prompted provide the vCenter Server user password.
    • If you installed vCenter Server on Windows, at the command prompt navigate to the vCenter Server installation directory, which by default is C:\Program Files|VMware\vCenter Server\Postgres\bin and run psql:

      psql -U vCenter-Server-database-user -v TaskMaxAgeInDays=task-days -v EventMaxAgeInDays=event-days -v StatMaxAgeInDays=stat-days -d <DATABASE></DATABASE>-t -q -f download-path\2110031_Postgres_task_event_stat.sql

    • If you deployed the vCenter Server Appliance, run the following command:

      /opt/vmware/vpostgres/current/bin/psql -U vCenter-Server-database-user -v TaskMaxAgeInDays=task-days -v EventMaxAgeInDays=event-days -v StatMaxAgeInDays=stat-days -d database -t -q -f download-path/2110031_Postgres_task_event_stat.sql