VMware vCenter Service 4.x/5.x status reports the error: "Cannot store license usage in the vCenter Server database"
search cancel

VMware vCenter Service 4.x/5.x status reports the error: "Cannot store license usage in the vCenter Server database"

book

Article ID: 311212

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
  • VMware vCenter Service Status reports this error:

    License accounting module health monitor Alarm
    Message: "Cannot store license usage in the vCenter Server database"

     
  • Clicking Download report for a licensing report in the Licensing Reporting Manager, you see this error:

    Cannot export license usage. License data integrity problem detected in the database


Environment

VMware vCenter Server 5.0.x
VMware vCenter Server 5.1.x
VMware vCenter Server 5.5.x
VMware vCenter Server 4.1.x
VMware vCenter Server Appliance 5.1.x

Cause

  • This issue may occur if there is missing data in the VPX_LIC_METADATA table due to an incomplete installation/upgrade process. For more information on an incomplete installation/upgrade process in a non-US English localized installation, see Installing or upgrading to vCenter Server 4.1 fails on a non-US English MSSQL with the error: ODBC error 22007 (1024737).
     
  • This issue occurs when you retry the upgrade after a failed upgrade/installation. Though the database upgrade fails the first time, it changes the vCenter Server version in the database. When you retry the database upgrade, vCenter Server incorrectly assumes that the database is up-to-date and fails to complete the upgrade process.

Resolution

To resolve this issue:

Important:
  • These steps should not be run on a vCenter Server 6.0 environment or a vCenter Server 5.5 environment connected to 6.0 Platform Service Controllers.
  • Before performing any database operations, take complete backup of the database. VMware recommends that you consult a Database Administrator (DBA) before implementing any changes to the database configuration.
  • Because the vCenter Server upgrade was not successful in the first attempt, there may be issues with other vCenter Server features (CIM-Hardware health status, SMS, query search).
  • Performing this procedure results in loss of licensing history data.
  • Verify that the user account being used to access the vCenter Server database has db_owner permissions.
 

For vCenter Server 5.x:

  1. Stop the VMware VirtualCenter Management Webservices service. For more information, see Stopping, starting, or restarting vCenter services (1003895).
  2. Ensure that the VPX_LIC_* tables are empty. If not, delete their contents.

    To delete the contents from the VPX_LIC_* tables:
     
    1. Launch SQL Management Studio (SQL Server) or SQL*Plus (Oracle).
    2. Run these SQL statements:

      DELETE FROM VPX_LIC_SNAPSHOT;
      DELETE FROM VPX_LIC_SNAPSHOT_VC_GROUP;
      DELETE FROM VPX_LIC_USAGE;
      DELETE FROM VPX_LIC_CONTEXT;
      DELETE FROM VPX_LIC_ASSET_PROPERTIES;
      DELETE FROM VPX_LIC_ASSETS;
      DELETE FROM VPX_LIC_LICENSES;
      DELETE FROM VPX_LIC_VC_GROUP_MEMBERS;
      DELETE FROM VPX_LIC_VC_GROUPS;
      DELETE FROM VPX_LIC_METADATA;
      DELETE FROM VPX_LIC_SETTINGS;


      Note: For vCenter Server 5.5.x run these additional statements:

      DELETE FROM VPX_LIC_TPS_ASSETS;
      DELETE FROM VPX_LIC_AUTO_KEYS;
      DELETE FROM VPX_LICENSE;

       
  3. Run these INSERT statements to initialize the licensing metadata in the VPX_LIC_METADATA table:
     
    • For Microsoft SQL:

      INSERT INTO VPX_LIC_METADATA (DATA_TYPE, LAST_SAMPLE_ID, LAST_SAMPLE_TIMESTAMP, RETAINED_SAMPLE_ID, RETAINED_SAMPLE_TIMESTAMP, GLOBAL_DIGEST, IS_STATE_VALID, WEEK_KEEP_COUNT)
      VALUES('MAC', 0, CONVERT(datetime, '1900-12-31 00:00:00', 120), 0, CONVERT(datetime, '1900-12-31 00:00:00', 120), NULL, 1, -1);

      INSERT INTO VPX_LIC_METADATA (DATA_TYPE, LAST_SAMPLE_ID, LAST_SAMPLE_TIMESTAMP, RETAINED_SAMPLE_ID, RETAINED_SAMPLE_TIMESTAMP, GLOBAL_DIGEST, IS_STATE_VALID, WEEK_KEEP_COUNT)
      VALUES('UHD', 0, CONVERT(datetime, '1900-12-31 00:00:00', 120), 0, CONVERT(datetime, '1900-12-31 00:00:00', 120), NULL, 1, 208);


      Note: For vCenter 5.5, run these additional statements:

      INSERT INTO VPX_LIC_METADATA(DATA_TYPE, LAST_SAMPLE_ID, LAST_SAMPLE_TIMESTAMP, RETAINED_SAMPLE_ID, RETAINED_SAMPLE_TIMESTAMP, GLOBAL_DIGEST, IS_STATE_VALID, WEEK_KEEP_COUNT)
      VALUES('ABT', 0, CONVERT(datetime, '1900-12-31 00:00:00', 120), 0, CONVERT(datetime, '1900-12-31 00:00:00', 120), NULL, 1, -1);

       
    • For Oracle:

      INSERT INTO VPX_LIC_METADATA(DATA_TYPE, LAST_SAMPLE_ID, LAST_SAMPLE_TIMESTAMP, RETAINED_SAMPLE_ID, RETAINED_SAMPLE_TIMESTAMP, GLOBAL_DIGEST, IS_STATE_VALID, WEEK_KEEP_COUNT)
      VALUES('UHD',0, TO_DATE('1900-12-31 00:00:00','YYYY-MM-DD HH24:MI:SS'), 0, TO_DATE('1900-12-31 00:00:00','YYYY-MM-DD HH24:MI:SS'), NULL, 1, 208);

      INSERT INTO VPX_LIC_METADATA(DATA_TYPE, LAST_SAMPLE_ID, LAST_SAMPLE_TIMESTAMP, RETAINED_SAMPLE_ID, RETAINED_SAMPLE_TIMESTAMP, GLOBAL_DIGEST, IS_STATE_VALID, WEEK_KEEP_COUNT)
      VALUES('MAC', 0, TO_DATE('1900-12-31 00:00:00','YYYY-MM-DD HH24:MI:SS'), 0, TO_DATE('1900-12-31 00:00:00','YYYY-MM-DD HH24:MI:SS'), NULL, 1, -1);


      You must run this statement when running vCenter Server 5.5:

      INSERT INTO VPX_LIC_METADATA(DATA_TYPE, LAST_SAMPLE_ID, LAST_SAMPLE_TIMESTAMP, RETAINED_SAMPLE_ID, RETAINED_SAMPLE_TIMESTAMP, GLOBAL_DIGEST, IS_STATE_VALID, WEEK_KEEP_COUNT)
      VALUES('ABT', 0, TO_DATE('1900-12-31 00:00:00','YYYY-MM-DD HH24:MI:SS'), 0, TO_DATE('1900-12-31 00:00:00','YYYY-MM-DD HH24:MI:SS'), NULL, 1, -1)


       
  4. Start the VMware VirtualCenter Management Webservices service. For more information, see Stopping, starting, or restarting vCenter services (1003895).
 

For vCenter Server 4.1

  1. Stop the VMware VirtualCenter Management Webservices service. For more information, see Stopping, starting, or restarting vCenter services (1003895).
  2. Ensure that the VPX_LIC_* tables are empty. If not, delete their contents.

    To delete the contents from the VPX_LIC_* tables:
     
    1. Launch SQL Management Studio (SQL Server) or SQL*Plus (Oracle).
    2. Run these SQL statements:

      DELETE FROM VPX_LIC_SNAPSHOT;
      DELETE FROM VPX_LIC_SNAPSHOT_VC_GROUP;
      DELETE FROM VPX_LIC_USAGE;
      DELETE FROM VPX_LIC_CONTEXT;
      DELETE FROM VPX_LIC_ASSETS;
      DELETE FROM VPX_LIC_LICENSES;
      DELETE FROM VPX_LIC_VC_GROUP_MEMBERS;
      DELETE FROM VPX_LIC_VC_GROUPS;
      DELETE FROM VPX_LIC_METADATA;
      DELETE FROM VPX_LIC_SETTINGS;

       
  3. Run this INSERT statement to initialize the licensing metadata in the VPX_LIC_METADATA table:
     
    • For SQL Server:

      INSERT INTO VPX_LIC_METADATA (LAST_SAMPLE_ID, LAST_SAMPLE_TIMESTAMP, RETAINED_SAMPLE_ID, RETAINED_SAMPLE_TIMESTAMP, GLOBAL_DIGEST, IS_STATE_VALID, WEEK_KEEP_COUNT)
      VALUES(0, CONVERT(datetime, '1900-12-31 00:00:00', 120), 0, CONVERT(datetime, '1900-12-31 00:00:00', 120), NULL, 1, 208);

       
    • For Oracle:

      INSERT INTO vpx_lic_metadata(last_sample_id, last_sample_timestamp, retained_sample_id, retained_sample_timestamp, global_digest, is_state_valid, week_keep_count)
      VALUES(0, TO_DATE('1900-12-31 00:00:00','YYYY-MM-DD HH24:MI:SS'), 0, TO_DATE('1900-12-31 00:00:00','YYYY-MM-DD HH24:MI:SS'), NULL, 1, 208);

       
  4. Start the VMware VirtualCenter Management Webservices service. For more information, see Stopping, starting, or restarting vCenter services (1003895).
Note: If these steps do not resolve the issue, you may have to recreate the stored procedures and/or rollup jobs. For more information, see Verifying vCenter Server 4.1 jobs and stored procedures (1029824).

Additional Information

For more information, see vCenter Server service status reports the error: Could not find stored procedure 'process_license_snapshot_proc' (2004647).

How to stop, start, or restart vCenter Server services
vCenter Server service status reports the error: Could not find stored procedure 'process_license_snapshot_proc'
VMware vCenter Service 4.x/5.x のステータスで次のエラーが報告される: Cannot store license usage in the vCenter Server database

Impact/Risks:
Caution: Before performing any database operations, take a complete backup of the database. VMware recommends that you consult a Database Administrator (DBA) before implementing any changes to the database configuration.