Bug 895477 - virt-who will report error info after unregistering one registered host from SAM webUI in rhevm backend.
Summary: virt-who will report error info after unregistering one registered host from ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Subscription Asset Manager
Classification: Retired
Component: Documentation
Version: 1.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Deon Ballard
QA Contact: Katello Bug Bin
URL:
Whiteboard:
Depends On:
Blocks: sam20-tracker
TreeView+ depends on / blocked
 
Reported: 2013-01-15 10:02 UTC by Hui Wang
Modified: 2016-12-12 12:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-05-10 03:42:45 UTC
Embargoed:


Attachments (Terms of Use)

Description Hui Wang 2013-01-15 10:02:19 UTC
Description of problem:
After unregistering one host of rhel in rhevm backend from SAM web UI, the virt-who will report error info in /var/log/rhsm/rhsm.log.

Version-Release number of selected component (if applicable):
virt-who-0.8-5.el6
katello-headpin-1.2.1-12h.el6_3.noarch
candlepin-0.7.23-1.el6_3.noarch

How reproducible:
100%

Steps to Reproduce:
1. Prepared two rhel6.4 hosts(Host1, Host2)
2. Add the two rhel6.4 host to rhevm3.1
3. Prepared the third rhel6.4(Host3) which is running virt-who
4. Config the virt-who on rhel64 (Host3) that in step3
VIRTWHO_BACKGROUND=1
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=10
VIRTWHO_RHEVM=1
VIRTWHO_RHEVM_OWNER=ACME_Corporation
VIRTWHO_RHEVM_ENV=env1
VIRTWHO_RHEVM_SERVER=https://10.66.79.91:443
VIRTWHO_RHEVM_USERNAME=admin@internal
VIRTWHO_RHEVM_PASSWORD=redhat
5. Restart virt-who on Host3, then Host1 and Host registered to SAM 
6. Remove one registered system(Host1 or Host2) from SAM web UI

  
Actual results:
Registered system(Host1 or Host2) will unregister from SAM and virt-who will report the h/g info no error

Expected results:
After unregistering one host of rhel in rhevm backend from SAM web UI, the virt-who will report error info in /var/log/rhsm/rhsm.log.


Additional info:
2013-01-15 09:22:59,125 [DEBUG]  @subscriptionmanager.py:89 - Sending update in hosts-to-guests mapping: {'37e3f4b6-5ec9-11e2-8066-4fd08b494d38': ['087d8309-456c-44ff-b1fb-38749fa3436c', '7d32a874-3df8-44df-8bb7-caaf4bd14224'], 'e952876e-5ec7-11e2-8bb0-932c09392102': []}
2013-01-15 09:22:59,283 [ERROR]  @virt-who.py:200 - Error during update list of guests: 37e3f4b6-5ec9-11e2-8066-4fd08b494d38: Hypervisor 37e3f4b6-5ec9-11e2-8066-4fd08b494d38 has been deleted previously
2013-01-15 09:22:59,283 [INFO]  @virt-who.py:203 - Updated host: e952876e-5ec7-11e2-8bb0-932c09392102 with guests: []
2013-01-15 09:23:09,490 [DEBUG]  @subscriptionmanager.py:89 - Sending update in hosts-to-guests mapping: {'37e3f4b6-5ec9-11e2-8066-4fd08b494d38': ['087d8309-456c-44ff-b1fb-38749fa3436c', '7d32a874-3df8-44df-8bb7-caaf4bd14224'], 'e952876e-5ec7-11e2-8bb0-932c09392102': []}
2013-01-15 09:23:09,642 [ERROR]  @virt-who.py:200 - Error during update list of guests: 37e3f4b6-5ec9-11e2-8066-4fd08b494d38: Hypervisor 37e3f4b6-5ec9-11e2-8066-4fd08b494d38 has been deleted previously

Comment 1 Radek Novacek 2013-01-15 10:27:59 UTC
I think that this is not a bug in virt-who. virt-who gets the information about host-guest association from RHEV-M and send it to the SAM server. RHEV-M doesn't know about removal of the registered system, so it's sending the same host-guest association all the time.

virt-who doesn't do anything else that acquiring the host-guest association from RHEV-M and resending it to SAM server. virt-who also doesn't know that some of the systems has been unregistered.

IMHO SAM server should filter out the information about unregistered host and don't return error back to virt-who, because only SAM has the information about unregistration.

I can add workaround to virt-who (suppress printing this error) but it would hide same error even when it's not false positive.

Reassigning to SAM, please assign back to virt-who if you believe it's really virt-who issue.

Comment 3 Tom McKay 2013-01-15 13:39:11 UTC
It is my understanding that when a system is removed it gets a 'deletion record' in candlepin. This means that when virt-who sends up its list of guests (Host1 and Host2 in this case) that an error message will come back indicating if any of the systems sent have been deleted.

The purpose of this is to allow the user/admin this has happened. This allows, for example, the deletion record itself to be removed and the system re-added to the hypervisor. (This is done through the katello remove_deletion command.)

Given this, what is the problem being experienced? The "additional info" shows exactly the correct informatin:

2013-01-15 09:22:59,283 [ERROR]  @virt-who.py:200 - Error during update list of guests: 37e3f4b6-5ec9-11e2-8066-4fd08b494d38: Hypervisor 37e3f4b6-5ec9-11e2-8066-4fd08b494d38 has been deleted previously

The following command would remove this deletion record and the next time virt-who sent back the list of guests, the deleted system would be added back into candlepin (and show up in SAM's list of systems):

% katello system remove_deletion --uuid=37e3f4b6-5ec9-11e2-8066-4fd08b494d38

In summary, the error message is absolute working as expected.

Comment 4 Hui Wang 2013-01-16 02:42:49 UTC
(In reply to comment #3)
> It is my understanding that when a system is removed it gets a 'deletion
> record' in candlepin. This means that when virt-who sends up its list of
> guests (Host1 and Host2 in this case) that an error message will come back
> indicating if any of the systems sent have been deleted.
> 
> The purpose of this is to allow the user/admin this has happened. This
> allows, for example, the deletion record itself to be removed and the system
> re-added to the hypervisor. (This is done through the katello
> remove_deletion command.)
> 
> Given this, what is the problem being experienced? The "additional info"
> shows exactly the correct informatin:
> 
> 2013-01-15 09:22:59,283 [ERROR]  @virt-who.py:200 - Error during update list
> of guests: 37e3f4b6-5ec9-11e2-8066-4fd08b494d38: Hypervisor
> 37e3f4b6-5ec9-11e2-8066-4fd08b494d38 has been deleted previously
> 
> The following command would remove this deletion record and the next time
> virt-who sent back the list of guests, the deleted system would be added
> back into candlepin (and show up in SAM's list of systems):
> 
> % katello system remove_deletion --uuid=37e3f4b6-5ec9-11e2-8066-4fd08b494d38
> 
> In summary, the error message is absolute working as expected.

Yes, in the SAM server side, after running CLI 
" headpin -u admin -p admin system remove_deletion --uuid=$systemUUID ", the virt-who can update the h/g association info as expected and the unregistered Host can re-register to SAM. But if do not run the CLI, the virt-who will report error info and the users can't re-register the Host to SAM. This is confused to users. So propose to give prompt to users to guide them after removing the system from SAM webUI or virt-who reporting error info. Any comments?

Comment 5 Tom McKay 2013-07-03 14:18:29 UTC
Suggest adding documentation for hypervisor when systems are deleted by hand from katello.

Comment 6 Deon Ballard 2013-10-10 01:08:51 UTC
I added section 7.5.1 here:
https://access.redhat.com/site/documentation/en-US/Red_Hat_Subscription_Management/1/html/Using_Subscription_Asset_Manager/sam-virt-deleting.html

Tom, is that enough to address comment #5?

Thanks!
Deon

Comment 7 Deon Ballard 2014-05-10 03:42:45 UTC
Mass closure of bugs modified in 2013. All of these are in the currently-published docs.


Note You need to log in before you can comment on or make changes to this bug.