dcasota1
Contributor
Contributor

Content library item delete issue

Jump to solution

Hi,

We configured on a vSphere vCenter 6.7 a syncing content library on a DC1 using a content library with 5 VMs on a DC2 imported using Clonetocontentlibrary.  The sync completed the first vm however the others we not successfully synced ("?"-symbol on VM) . The task freezed at 3%. Cancelling the task was processed. However retrigger the sync freezes at 0%.

We tried to delete the target contentlibrary. Therefore the sync was stopped. However each cleanup throws com.vmware.cl.SyncLibraryItemFailEvent. Any idea how to cleanup the content library successfully ?

Tags (1)
1 Solution

Accepted Solutions
Raj1988
Enthusiast
Enthusiast

Most likely a stale entry in VCDB .

To resolve this issue delete stale entry from VCDB after backing up VCDB.

  1. Take a backup of the VCDB from vCenter Appliance or vCenter server and snapshot of vCenter VM.
  2. Log in to the vCenter server database and execute the following queries to capture the details for the content library.

           - VCDB=# select id,name from cl_library;
            id | name
            --------------------------------------+-------
            8bc3326e-3a0b-49e6-9be0-acb18b91d4b2 | Test
            3b4280d3-b878-4428-85d0-867cb8252e66 | Stale

           - VCDB=# select * from cl_library_storage;
           library_id | storage_id
           --------------------------------------+--------------------------------------
           8bc3326e-3a0b-49e6-9be0-acb18b91d4b2 | ff3f7160-0731-4d01-9cc0-a2cce03ab3ce
           3b4280d3-b878-4428-85d0-867cb8252e66 | 1325cd29-0b3e-4be4-8445-625da0dce452
           (2 rows)

           - VCDB=# select * from cl_storage;
           id | storageuri | type
           --------------------------------------+-------------------------------------------------------------+-----------
           ff3f7160-0731-4d01-9cc0-a2cce03ab3ce | Datastore:datastore-11:f271f3f1-a924-4519-a3f5-e9a75d962888 | Datastore
           1325cd29-0b3e-4be4-8445-625da0dce452 | Datastore:datastore-11:f271f3f1-a924-4519-a3f5-e9a75d962888 | Datastore
           (2 rows)

          - VCDB=# select id,name from vpx_datastore where id=11;
          id | name
          ----+------
         11 | DS1
         (1 row)

Note: As per the snippets above, we see the id for the library is "3b4280d3-b878-4428-85d0-867cb8252e66". The storage id for the same library is "1325cd29-0b3e-4be4-8445-625da0dce452". When we check the location, we see that the library is saved in the datastore with id "11" (Datastore:datastore-11:f271f3f1-a924-4519-a3f5-e9a75d962888) We can get the datastore name from the datastore table, which is "DS1" here.

To remove stale entry follow below order.

VCDB=# delete from cl_library_storage where library_id='3b4280d3-b878-4428-85d0-867cb8252e66';
VCDB=# delete from cl_storage where id='1325cd29-0b3e-4be4-8445-625da0dce452';
VCDB=# delete from cl_library where id='3b4280d3-b878-4428-85d0-867cb8252e66';

The output for each of the above command would return "DELETE 1",Once deleted, we can log in to the web client.

View solution in original post

0 Kudos
3 Replies
GayathriS
Expert
Expert

Please confirm if you have followed below steps :

Prerequisites

Required privilege: Content library > Delete subscribed library or Content library > Delete local library on the type of library you want to delete.

Procedure

  1. In the vSphere Web Client navigator, select vCenter Inventory Lists > Content Libraries.
  2. Right-click a content library from the list and select Delete.
  3. In the Delete library confirmation dialog box, click Yes.

Results

The content library and all its contents are deleted.

This could have been saved in VC DB , check out below link :

https://www.reddit.com/r/vmware/comments/62prjo/unable_to_delete_content_library/

Please consider marking this answer as "correct" or "helpful" if you think your questions have been answered.

Regards

Gayathri

0 Kudos
Raj1988
Enthusiast
Enthusiast

Most likely a stale entry in VCDB .

To resolve this issue delete stale entry from VCDB after backing up VCDB.

  1. Take a backup of the VCDB from vCenter Appliance or vCenter server and snapshot of vCenter VM.
  2. Log in to the vCenter server database and execute the following queries to capture the details for the content library.

           - VCDB=# select id,name from cl_library;
            id | name
            --------------------------------------+-------
            8bc3326e-3a0b-49e6-9be0-acb18b91d4b2 | Test
            3b4280d3-b878-4428-85d0-867cb8252e66 | Stale

           - VCDB=# select * from cl_library_storage;
           library_id | storage_id
           --------------------------------------+--------------------------------------
           8bc3326e-3a0b-49e6-9be0-acb18b91d4b2 | ff3f7160-0731-4d01-9cc0-a2cce03ab3ce
           3b4280d3-b878-4428-85d0-867cb8252e66 | 1325cd29-0b3e-4be4-8445-625da0dce452
           (2 rows)

           - VCDB=# select * from cl_storage;
           id | storageuri | type
           --------------------------------------+-------------------------------------------------------------+-----------
           ff3f7160-0731-4d01-9cc0-a2cce03ab3ce | Datastore:datastore-11:f271f3f1-a924-4519-a3f5-e9a75d962888 | Datastore
           1325cd29-0b3e-4be4-8445-625da0dce452 | Datastore:datastore-11:f271f3f1-a924-4519-a3f5-e9a75d962888 | Datastore
           (2 rows)

          - VCDB=# select id,name from vpx_datastore where id=11;
          id | name
          ----+------
         11 | DS1
         (1 row)

Note: As per the snippets above, we see the id for the library is "3b4280d3-b878-4428-85d0-867cb8252e66". The storage id for the same library is "1325cd29-0b3e-4be4-8445-625da0dce452". When we check the location, we see that the library is saved in the datastore with id "11" (Datastore:datastore-11:f271f3f1-a924-4519-a3f5-e9a75d962888) We can get the datastore name from the datastore table, which is "DS1" here.

To remove stale entry follow below order.

VCDB=# delete from cl_library_storage where library_id='3b4280d3-b878-4428-85d0-867cb8252e66';
VCDB=# delete from cl_storage where id='1325cd29-0b3e-4be4-8445-625da0dce452';
VCDB=# delete from cl_library where id='3b4280d3-b878-4428-85d0-867cb8252e66';

The output for each of the above command would return "DELETE 1",Once deleted, we can log in to the web client.

0 Kudos
dcasota1
Contributor
Contributor

Hi,

The procedure works!

pastedImage_0.png

However no idea why the gui klicks didn't work. tail -f /var/log/vmware/content-library/cls.log didn't throw anything obvious (?), saved the cls-xx.log.gz just in case.

I've recreating a new content library and the sync started as expected.

Thanks!

Daniel