vCenter Server Appliance Database

The vCenter Server Appliance comes with a built-in DB2 database for use as an all-in-one solution for small lab environments. The sizing is supposed to be less than 5 hosts and 50 VMs. But it can work much higher than that if given enough resources, :-).

One issue that occurs when using this appliance is that the DB2 log settings are too small for any extended operation. This is due to stat roll-up jobs taking more log space to complete than the DB2 instanace is set for. Symptoms of this will be your vCenter service resetting itself every so often, you can verify this happening by watching the vpxd.log file for the line “Transaction log full” and the service dying shortly after that. The way I found it is that my vSphere Client would disconnect and ask for me to log back in everyonce in a while.

The easy(-ish) fix for this is to do the following:

  1. SSH to the vCenter Appliance, if you left the default the username is ‘root’ and the password is ‘vmware’. Once you are SSH’ed to the box you will need to change to the DB2 user.
  2. su -l db2inst1

  3. Check your current log setting by running:
  4. db2 get db cfg for vCDB | grep log

    This will show you something like this:

    User exit for logging status = NO

    Catalog cache size (4KB) (CATALOGCACHE_SZ) = 300

    Number of primary log files (LOGPRIMARY) = 128

    Number of secondary log files (LOGSECOND) = 16

    Changed path to log files (NEWLOGPATH) =

    Path to log files = /storage/db/db2/home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/

    Overflow log path (OVERFLOWLOGPATH) =

    Mirror log path (MIRRORLOGPATH) =

    First active log file =

    Block log on disk full (BLK_LOG_DSK_FUL) = NO

    Block non logged operations (BLOCKNONLOGGED) = NO

    Percent max primary log space by transaction (MAX_LOG) = 0

    Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0

    Percent log file reclaimed before soft chckpt (SOFTMAX) = 520

    User exit for logging enabled (USEREXIT) = OFF

    HADR log write synchronization mode (HADR_SYNCMODE) = NEARSYNC

    First log archive method (LOGARCHMETH1) = OFF

    Options for logarchmeth1 (LOGARCHOPT1) =

    Second log archive method (LOGARCHMETH2) = OFF

    Options for logarchmeth2 (LOGARCHOPT2) =

    Failover log archive path (FAILARCHPATH) =

    Number of log archive retries on error (NUMARCHRETRY) = 5

  5. To change the log file sizing run the following:
  6. db2 UPDATE DB CFG FOR VCDB USING logprimary 128 logsecond 16 logfilsiz 8192

  7. For the setting to take effect you will need to reboot the appliance. Once the vCenter Appliance is running again you can check/watch the log files being created.
  8. ls -lah /storage/db/db2/home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/

  1. VMware only supports up to 5 hosts or 50 VMs with embedded DB2 database, the only external database supported is Oracle which supports up to 1000 hosts, 10000 VMs

    Like

    Reply

  2. That is true. But even at those levels the log limit is hit after a few month of stat rollups. The setting given here will also let you go higher that the small supported number.

    Like

    Reply

  3. my comment was in reference to 'The sizing is supposed to be less than 25 hosts and 1,000 VMs. But it can work much higher than that if given enough resources' as this is misleading unsupported information.vCenterGuy

    Like

    Reply

  4. You are correct I will correct that. Thanks.

    Like

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: