Wednesday, November 14, 2012

Remove an inactive datastore from the vCenter Server inventory



This issue may occur if the datastore was removed from the ESX host before removing it from the vCenter Server Inventory.

To resolve this issue, you must manually remove the datastore references from the vCenter Server Inventory.

To manually remove the datastore references from the Inventory:

Notes:
  • Back up the database before proceeding.
  • Ensure that the datastore is not referenced by any virtual machine.
  1. Stop the VMware VirtualCenter Server service on the vCenter Server. 
  2. Launch SQL Management studio connected to the vCenter Server database.
  3. Run this query to identify the datastore ID in the vCenter Server database:

    select ID from VPX_ENTITY where name ='';
    Where  is the datastore to be removed. The query returns the ID of the datastore.
  4. To remove the datastore from the vCenter Server database:

    1. Run these queries to delete the datastore from the VPX_DS_ASSIGNMENT and VPX_DATASTORE tables:

      delete from VPX_DS_ASSIGNMENT where DS_ID=;
      delete from VPX_VM_DS_SPACE where DS_ID=;
      delete from VPX_DATASTORE where ID=;
      Where  is the output of Step 3.
    2. Run this query to delete the datastore from the entity table:

      delete from VPX_ENTITY where ID=;
  5. Run these queries to verify if the datastore has been removed from the VPX_ENTITYVPX_DS_ASSIGNMENT, andVPX_DATASTORE tables:

    Note: If the datastore references are successfully removed, these queries do not display any results.

    select * from VPX_DS_ASSIGNMENT where DS_ID=;
    select * from VPX_VM_DS_SPACE where DS_ID=;
    select * from VPX_DATASTORE where ID=;
    select * from VPX_ENTITY where ID=;
  6. For the database changes to take effect, restart the VMware VirtualCenter Server service on the vCenter Server.

No comments:

Post a Comment