Bug 1321977

Summary: ESXi host license info out of sync between API and Elasticsearch
Product: Red Hat Satellite Reporter: Jason Berry <jberry86>
Component: Subscription ManagementAssignee: Eric Helms <ehelms>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.7CC: bkearney, walden
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-12 19:37:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jason Berry 2016-03-29 13:44:41 UTC
Description of problem:
When removing a license from an ESXi host under Content Hosts, if the license has guests using the "Guests Of" license, the GUI will allow you to remove the license and all seems proper.  However, if you hit the subscriptions API, the old license still exists, and any new license you assign to that ESXi host is not found anywhere. 

Only after a katello:clean_backend_objects and katello:reindex, does the web interface and the API match up again

Version-Release number of selected component (if applicable):
6.1.7 of Satellite

How reproducible:
Sporadically.  Those conditions mentioned above are what I've been able to narrow it down to, but I have limited testing capabilities due to this being a production infrastructure

Steps to Reproduce:
1. virt-who and inventory an ESXi cluster
2. Assign a "1 guest" license to an ESXi host
3. subscription-manager register a VM on that host to Sat6 and assign it the "guest of <esxihost>" license available
4. Remove the license from the ESXi host
5. Hit the subscriptions API and search by the UUID of the ESXi host, and the "removed" subscription still shows attached.
6. Assign a new license to the ESXi host
7. Hit the subscriptions API again and you'll still find the old license attached to the UUID, and nothing about the new license

Actual results:
API and Elasticsearch are out of sync

Expected results:
They should be the same without having to do the foreman-rake jobs

Comment 1 Bryan Kearney 2016-07-26 19:00:50 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 2 Bryan Kearney 2017-01-12 19:37:33 UTC
Elastic Search has been removed in 6.2, this issue should be resolved.