Expired license entries available in Aria suite lifecycle manager locker and there is no option available to remove those expired licenses.
Running below API calls to remove the expired license from Swagger UI removes the expired licenses from locker. However, these re-appear in the locker when an inventory sync is run on the aria operations environment.
GET /lcm/locker/api/v2/licenses/alias/{alias}
Delete /lcm/locker/api/licenses/{vmid}
Environment
VMware Aria operations 8.x
Aria suite lifecycle manager 8.x
Cause
Stale expired license entries in Aria operations database
Resolution
Prerequisite:
Take a non-memory snapshot of all the nodes before proceeding with the below steps.
Steps to remove expired stale license entry from Aria operations database table 'vcenter_license_mapping'
Connect to the PostgreSQL database by running the command below
su - postgres -c "/opt/vmware/vpostgres/current/bin/psql -d vcopsdb -p 5433"
Once in the Postgres DB, Check the license mappings table.
select * from vcenter_license_mapping;
Review the output and identify any expired licenses, note down the 'vc_id' of expired license you wish to remove.
Delete stale license entries
delete from vcenter_license_mapping where vc_id = '<vc_id>';
Note: Replace the vc_id noted from step 3.
Retry expired license deletion using Aria Suite Lifecycle Swagger APIs:
Get the vmid of the expired license
GET /lcm/locker/api/v2/licenses/alias/{alias}
Delete the expired license
DELETE /lcm/locker/api/licenses/{vmid}
Verify license removal
Ensure that the expired license no longer appears in the Aria Suite Lifecycle > Locker > Licenses.
Run inventory sync on Aria Operations
Perform an inventory sync to confirm that the expired licenses do not reappear in the Aria Suite Lifecycle locker.