A Quick Hack to Database Failure in vCenter Appliance

After playing with the vCenter appliance simulator feature documented by William, I got into a show stopper that vCenter service (VPXD) could not be started. I don’t think it’s related to the simulator feature at all. My guess is that it’s caused by a sudden power off of the virtual machine but didn’t try to reproduce the problem that way – I care more to fix it than anything else.

A quick Internet search got me the VMware KB article “VMware vCenter Server Appliance 5.0 GA with embedded DB2 database fails.” Knowing mine is 5.1 GA, I still tried to follow the steps there but couldn’t pass the second step due to invalid use name. I was not sure if the username is changed, or DB2 embedded is no longer used in the appliance. Update: from the print out messages in the vCenter appliance 5.1 console I found “vPostgres,” therefore I believe DB2 is no longer used in the appliance.

Bothered by SLOW Web UI to manage vSphere? Want to manage ALL your VMware vCenters, AWS, Azure, Openstack, container behind a SINGLE pane of glass? Want to search, analyze, report, visualize VMs, hosts, networks, datastores, events as easily as Google the Web? Find out more about vSearch 3.0: the search engine for all your private and public clouds.

Somehow I remember there was a tag in the simulator setting related to database setting. So I checked the configuration file again:

vim /etc/vmware-vpx/vpxd.cfg

There I did find it as shown below tagged as cleardb.

<simulator>
<enabled>true</enabled>
<cleardb>false</cleardb>
<initInventory>vcsim/model/initInventory.cfg</initInventory>
</simulator>

I was thinking if the database was corrupted cleaning the database might be able to fix the issue. Doing that would of course wipe out all the existing data. But I don’t care because the data was populated by the simulator and I don’t have any data I want to preserve as would in a production environment. All I care is to start the vCenter server. This may not be true for you. WARNING: If you want to keep your data, please stop here and contact VMware for help.

With that in mind, I changed the value of the cleardb to be true and restart the vpxd service with a single command line:

service vmware-vpxd restart

It took a bit longer than usual but it finally went through. To verify it, I opened the MOB and it seemed working just fine. Problem solved!

To make sure the simulator won’t waste time to clean DB each startup, I then changed the value of the cleardb tag back to false afterwards.

If the above hack doesn’t work for you, the last resort is to install a new vCenter appliance. That would surely solve your problem even though it may take a bit longer than this hack.

Again, it’s just a quick hack and not for anyone. Should you need to preserve database, try something else.

This entry was posted in Virtualization and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. Posted April 14, 2013 at 5:26 pm | Permalink

    A Quick Hack to Database Failure in vCenter Appliance http://t.co/y1leFX1Gyw via @sjin2008

  2. Posted April 14, 2013 at 6:14 pm | Permalink

    A Quick Hack to Database Failure in vCenter Appliance (DoubleCloud) http://t.co/xj8d1lYjjo

One Trackback

  • […] a sudden power off of the virtual machine but didn’t try to reproduce the problem that […]A Quick Hack to Database Failure in vCenter Appliance originally appeared on DoubleCloud by Steve Jin, author of VMware VI and vSphere SDK (Prentice […]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  • NEED HELP?


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__ doublecloud.org.

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.