vCenter Server fails to start with the error: [VpxdMain] Failed to initialize: vmodl.fault.ManagedObjectNotFound
search cancel

vCenter Server fails to start with the error: [VpxdMain] Failed to initialize: vmodl.fault.ManagedObjectNotFound

book

Article ID: 328239

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:
  • VMware VirtualCenter Server service fails to start.
  • With trivia logging and DB tracing enabled, the vpxd.log file contains entries similar to:

    [02796 trivia 'App'] LoadTableSchema: index name length = 22
    [02796 trivia 'App'] LoadTableSchema: Adding index VPX_ALARM_EXPR_COMP_M1 on VPX_ALARM_EXPR_COMP, col=EXPRESSION_ID
    [02796 trivia 'App'] LoadTableSchema: Done getting indexes
    [02796 trivia 'App'] [Vdb::GetConnection] 8 out of 10 connections are available
    [02796 trivia 'App'] LoadTableSchema: index name length = -1
    [02796 trivia 'App'] LoadTableSchema: Done getting indexes
    [02796 warning 'VpxProfiler'] ServerApp::Init took 7625 ms
    [02796 error 'App'] [VpxdMain] Failed to initialize: vmodl.fault.ManagedObjectNotFound
    [02796 error 'App'] Failed to intialize VMware VirtualCenter. Shutting down...

    Note: For information on enabling trivia logging, see Enabling trivia logging in vCenter Server 4.0.x/4.1.x/5.0.x (1001584).


  • With standard logging enabled, the vpxd.log contains entries similar to:

    [2012-02-12 11:01:40.588 02764 info 'App'] [Vpxd::ServerApp::Init:953] Calling: Vpxd::Prof::Init()
    [2012-02-12 11:01:40.625 02764 info 'App'] [Vpxd::ServerApp::Init:956] Calling: ResManagerUpdater::Init()
    [2012-02-12 11:01:40.625 02764 info 'App'] [Vpxd::ServerApp::Init:957] Calling: VpxdTask::Init(gDB)
    [2012-02-12 11:01:41.199 02764 warning 'VpxProfiler'] ServerApp::Init took 86596 ms
    [2012-02-12 11:01:41.199 02764 error 'App'] [VpxdMain] Failed to initialize: vmodl.fault.ManagedObjectNotFound
    [2012-02-12 11:01:41.199 02764 error 'App'] Failed to intialize VMware VirtualCenter. Shutting down...
    [2012-02-12 11:02:37.442 02764 info 'App'] Forcing shutdown of VMware VirtualCenter now


Cause

This issue may occur when:

  • There is an alarm configured in the vCenter Server for a virtual machine that does not exist in the vCenter database.
  • There is a DRS rule associated with a virtual machine that does not exist in the vCenter database.
  • An existing alarm definition references an invalid datastore which no longer exists in the vCenter database.

Resolution

Note: Ensure to take a backup of the vCenter Server database before proceeding. For more information, see Backing up the vCenter Server database running on Microsoft SQL or SQL Express server (2012138).

To correct any Alarms associated with invalid Virtual Machines or invalid Datastores:

  1. To retrieve the details about the alarms configured in the vCenter Server, run this query:

    • For MSSQL, run query:

      SELECT a.ALARM_ID, a.NAME, a.ENTITY_ID, a.ENTITY_TYPE, b.OBJECT_TYPE, b.OBJECT_PATH FROM VPX_ALARM a JOIN VPX_ALARM_EXPRESSION b ON a.ALARM_ID=b.ALARM_ID WHERE a.ALARM_ID !='' AND OBJECT_TYPE != '';

    • For Oracle, run query:

      SELECT a.ALARM_ID, a.NAME, a.ENTITY_ID, a.ENTITY_TYPE, b.OBJECT_TYPE, b.OBJECT_PATH FROM VPX_ALARM a JOIN VPX_ALARM_EXPRESSION b ON a.ALARM_ID=b.ALARM_ID WHERE a.ALARM_ID is not null AND OBJECT_TYPE is not null;

  2. Make a note of all the values reported in the ENTITY_ID column.
  3. Use this query to get the description about the values in ENTITY_ID reported in the previous step.

    SELECT * FROM VPX_ENTITY where ID = XXXXX


    where XXXXX is the Entity ID identified in the first step above. This needs to be repeated for each unique ENTITY_ID.

  4. Identify an ENTITY_ID that does not exist in the VPX_ENTITY table, and note its ALARM_ID.
  5. Once the ALARM_ID is identified, run these commands to remove it:

    DELETE from VPX_ALARM_ACTION where ALARM_ID = XX
    DELETE from VPX_ALARM_EXPRESSION where ALARM_ID = XX
    DELETE from VPX_ALARM where ALARM_ID = XX


    where XX is the ALARM_ID identified in step #3.

    Note: The DELETE statement removes all alarms, whether they are default or customized.

  6. Create any necessary default alarms. For more information, see How to create default alarms when upgrading to vCenter Server 4.0 (1010399).


To correct any DRS rules associated with invalid virtual machines:

  1. Run this query to find any invalid virtual machine ID and the associated rule ID:

    select ruleVms.* from(select id as ruleId, cast( substring(cast(RULES_INFO as xml).value('declare default element namespace "urn:vim25"; (/obj/ClusterRuleInfo/vm)[1]','varchar(20)'),4,10) as int) as vmid from VPX_COMPUTE_RESOURCE) as ruleVms
    where not exists (select 1 from VPX_ENTITY e where e.ID = ruleVms.vmid)
    and ruleVms.vmid is not NULL


    For example, you see a query result similar to:
    id vmid
    49
    34

  2. Get the rule info from the appropriate table:

    select rules_info from VPX_COMPUTE_RESOURCE where id = 49

    Sample query returned is similar to:

    <obj xmlns:xsd="</SPAN> http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance " xmlns="urn:vim25" versionId="5.0" xsi:type="ArrayOfClusterRuleInfo"><ClusterRuleInfo xsi:type="ClusterAntiAffinityRuleSpec"><key>1</key><enabled>true</enabled><name>FFX-DCs</name><userCreated>true</userCreated> <vm type="VirtualMachine" xsi:type="ManagedObjectReference">vm-34</vm><vm type="VirtualMachine" xsi:type="ManagedObjectReference">vm-27</vm></ClusterRuleInfo></obj>

  3. Rewrite the query results from Step 2, removing only the invalid virtual machine ID (the XML content in Red) and then update the DRS rule using this query:

    update VPX_COMPUTE_RESOURCE
    set RULES_INFO='<obj xmlns:xsd="</SPAN> http://www.w3.org/2001/XMLSchema " xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance " xmlns="urn:vim25" versionId="5.0" xsi:type="ArrayOfClusterRuleInfo"><ClusterRuleInfo xsi:type="ClusterAntiAffinityRuleSpec"><key>1</key><enabled>true</enabled><name>FFX-DCs</name><userCreated>true</userCreated><vm type="VirtualMachine" xsi:type="ManagedObjectReference">vm-27</vm></ClusterRuleInfo></obj>'
    where ID = 49


  4. Repeat Steps 2 and 3 for each row if multiple virtual machines are returned by Step 1.

    After both DRS rules and Alarms have are corrected, vCenter Server should start successfully.


Additional Information

For more information about the settings related to alarms, see Working with Alarms in vSphere Datacenter Administration Guide.

If this issue persists, file a support request with VMware Support and note this KB article ID in the problem description. For more information, see Filing a Support Request in Customer Connect (2006985).

Enabling trivia logging in VMware vCenter Server
Creating default alarms when upgrading to vCenter Server 4.0
How to file a Support Request in Customer Connect
vCenter Server が次のエラーで起動に失敗する:[VpxdMain] vmodl.fault.ManagedObjectNotFound の初期化に失敗しました
vCenter Server 启动失败,并显示错误:[VpxdMain] 初始化失败: vmodl.fault.ManagedObjectNotFound ([VpxdMain] Failed to initialize: vmodl.fault.ManagedObjectNotFound)