Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1486088

Summary: [RFE] Virt-who should not list and send the invalid hosts for vcenter/rhevm
Product: Red Hat Satellite Reporter: Liushihui <shihliu>
Component: Subscriptions - virt-whoAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Eko <hsun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, bcourt, csnyder, dpeess, hsun, khowell, sgao, yuefliu
Target Milestone: UnspecifiedKeywords: FutureFeature
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1487273 (view as bug list) Environment:
Last Closed: 2019-04-01 12:07:01 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1487273    

Description Liushihui 2017-08-29 01:01:49 UTC
Description of problem:
When one esx hypervisor is disconnect, virt-who failed to send host/guest mapping info to server as it failed to get the disconnected hypervisor's hostname.

Version-Release number of selected component (if applicable):
virt-who-0.20.4-1.el6sat.noarch
subscription-manager-1.18.10-1.el6.x86_64
python-rhsm-1.18.7-1.el6_9.x86_64
Satellite6.3.0-sp13

How reproducible:
Always

Steps to Reproduce:
Precondition: There are over two esx hypervisors in vcenter, make one hypervisor in disconnect mode.

1. Register system to satellite6.3.0-sp13

2. Configure virt-who run at esx mode
# cat /etc/virt-who.d/virt-who.conf
[test-esx1]
type=esx
server=10.73.131.114
username=Administrator
password=Welcome1!
owner=Default_Organization
env=Default_Organization

3.Restart virt-who and check virt-who's log
# service virt-who restart | tail -f /var/log/rhsm/rhsm.log
11:38:09 2017-08-28 04:35:57,227 [virtwho.destination_3096823934142387789 DEBUG] MainProcess(450):Thread-9 @subscriptionmanager.py:_is_rhsm_server_async:224 - Checking if server has capability 'hypervisor_async'
11:38:09 2017-08-28 04:35:57,282 [rhsm.connection INFO] MainProcess(450):Thread-9 @connection.py:_request:525 - Response: status=200, request="GET /rhsm/status"
11:38:09 2017-08-28 04:35:57,283 [rhsm.connection DEBUG] MainProcess(450):Thread-9 @connection.py:_load_manager_capabilities:803 - Server has the following capabilities: ['cores', 'ram', 'instance_multiplier', 'derived_product', 'cert_v3', 'guest_limit', 'vcpu', 'hypervisors_async', 'storage_band', 'remove_by_pool_id', 'batch_bind', 'org_level_content_access']
11:38:09 2017-08-28 04:35:57,284 [virtwho.destination_3096823934142387789 DEBUG] MainProcess(450):Thread-9 @subscriptionmanager.py:_is_rhsm_server_async:228 - Server has capability 'hypervisors_async'
11:38:09 2017-08-28 04:35:57,284 [virtwho.destination_3096823934142387789 DEBUG] MainProcess(450):Thread-9 @subscriptionmanager.py:hypervisorCheckIn:182 - Host-to-guest mapping: {
11:38:09     "hypervisors": [
11:38:09         {
11:38:09             "hypervisorId": {
11:38:09                 "hypervisorId": "09fa4d56-ca62-583c-b5db-7db9fab938bc"
11:38:09             }, 
11:38:09             "name": "", ==========> The disconnected esx hypervisor
11:38:09             "guestIds": [
11:38:09                 {
11:38:09                     "guestId": "564d447f-0d3f-f6e3-5df1-d38961ecf6e3", 
11:38:09                     "state": 5, 
11:38:09                     "attributes": {
11:38:09                         "active": 0, 
11:38:09                         "virtWhoType": "esx"
11:38:09                     }
11:38:09                 }, 
11:38:09                 {
11:38:09                     "guestId": "564d580c-8c98-1480-f760-d901499b1f63", 
11:38:09                     "state": 5, 
11:38:09                     "attributes": {
11:38:09                         "active": 0, 
11:38:09                         "virtWhoType": "esx"
11:38:09                     }
11:38:09                 }, 
11:38:09                 {
11:38:09                     "guestId": "564d701d-1dcc-d20e-063e-0bcf2281a311", 
11:38:09                     "state": 5, 
11:38:09                     "attributes": {
11:38:09                         "active": 0, 
11:38:09                         "virtWhoType": "esx"
11:38:09                     }
11:38:09                 }
11:38:09             ], 
11:38:09             "facts": {
11:38:09                 "hypervisor.type": "vmware", 
11:38:09                 "cpu.cpu_socket(s)": "2"
11:38:09             }
11:38:09         }, 
11:38:09         {
11:38:09             "hypervisorId": {
11:38:09                 "hypervisorId": "abce4d56-514b-42da-d052-e26dc66003df"
11:38:09             }, 
11:38:09             "name": "bootp-73-131-168.rhts.eng.pek2.redhat.com", 
11:38:09             "guestIds": [], 
11:38:09             "facts": {
11:38:09                 "hypervisor.type": "VMware ESXi", 
11:38:09                 "cpu.cpu_socket(s)": "2", 
11:38:09                 "hypervisor.version": "6.5.0"
11:38:09             }
11:38:09         }
11:38:09     ]
11:38:09 }
11:38:09 2017-08-28 04:35:57,287 [rhsm.connection DEBUG] MainProcess(450):Thread-9 @connection.py:_request:490 - Making request: POST /rhsm/hypervisors/Default_Organization?reporter_id=esx-rhel6.9-sattool.redhat.com&cloaked=False&env=Default_Organization
11:38:09 2017-08-28 04:35:57,669 [rhsm.connection INFO] MainProcess(450):Thread-9 @connection.py:_request:525 - Response: status=200, request="POST /rhsm/hypervisors/Default_Organization?reporter_id=esx-rhel6.9-sattool.redhat.com&cloaked=False&env=Default_Organization"
11:38:09 2017-08-28 04:35:57,672 [rhsm.connection INFO] MainProcess(450):Thread-9 @connection.py:__init__:758 - Connection built: host=satellite63-ohsnap-rhel7.redhat.com port=443 handler=/rhsm auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=0
11:38:09 2017-08-28 04:35:57,672 [rhsm.connection DEBUG] MainProcess(450):Thread-9 @connection.py:_request:490 - Making request: GET /rhsm/status/
11:38:09 2017-08-28 04:35:57,671 [virtwho.destination_3096823934142387789 DEBUG] MainProcess(450):Thread-9 @subscriptionmanager.py:_connect:132 - Authenticating with certificate: /etc/pki/consumer/cert.pem
11:38:09 2017-08-28 04:35:57,746 [rhsm.connection INFO] MainProcess(450):Thread-9 @connection.py:_request:525 - Response: status=200, request="GET /rhsm/status/"
11:38:09 2017-08-28 04:35:57,747 [virtwho.destination_3096823934142387789 DEBUG] MainProcess(450):Thread-9 @subscriptionmanager.py:check_report_state:263 - Checking status of job hypervisor_update_fe93e2a1-cd71-476a-acc9-c02085cd50eb
11:38:09 2017-08-28 04:35:57,749 [rhsm.connection DEBUG] MainProcess(450):Thread-9 @connection.py:_request:490 - Making request: GET /rhsm/jobs/hypervisor_update_fe93e2a1-cd71-476a-acc9-c02085cd50eb?result_data=True
11:38:09 2017-08-28 04:35:57,824 [rhsm.connection INFO] MainProcess(450):Thread-9 @connection.py:_request:525 - Response: status=200, request="GET /rhsm/jobs/hypervisor_update_fe93e2a1-cd71-476a-acc9-c02085cd50eb?result_data=True"
11:38:09 2017-08-28 04:35:57,826 [virtwho.destination_3096823934142387789 ERROR] MainProcess(450):Thread-9 @virt.py:run:389 - Thread 'destination_3096823934142387789' fails with exception:
11:38:09 Traceback (most recent call last):
11:38:09   File "/usr/lib/python2.6/site-packages/virtwho/virt/virt.py", line 380, in run
11:38:09     self._run()
11:38:09   File "/usr/lib/python2.6/site-packages/virtwho/virt/virt.py", line 336, in _run
11:38:09     self._send_data(data_to_send)
11:38:09   File "/usr/lib/python2.6/site-packages/virtwho/virt/virt.py", line 656, in _send_data
11:38:09     self.dest.check_report_state(batch_host_guest_report)
11:38:09   File "/usr/lib/python2.6/site-packages/virtwho/manager/subscriptionmanager/subscriptionmanager.py", line 284, in check_report_state
11:38:09     for fail in result_data.get('failedUpdate', []):
11:38:09 AttributeError: 'str' object has no attribute 'get'
11:38:09 2017-08-28 04:35:57,826 [virtwho.destination_3096823934142387789 INFO] MainProcess(450):Thread-9 @virt.py:_send_data:563 - Error report received
11:38:09 2017-08-28 04:35:57,826 [virtwho.destination_3096823934142387789 INFO] MainProcess(450):Thread-9 @virt.py:run:408 - Waiting 3600 seconds before performing action again 'destination_3096823934142387789'

Actual results:
Failed to send host/guest mapping info to server as "fail in result_data.get('failedUpdate', []):
11:38:09 AttributeError: 'str' object has no attribute 'get'"

Expected results:
As the esx hypervisor was disconnect, it shouldn't show on virt-who log. Meanwhile, virt-who should send h/g mapping info to satellite normally.

Additional info:

Comment 2 Eko 2017-08-29 02:40:39 UTC
sometimes, the esx host in vcenter may be broken or ip changed, it will show "disconnect" state in vcenter, that means it's an invalid host, virt-who should not show and send them to satellite for these invalid esx hosts,

Comment 4 Bryan Kearney 2019-02-28 19:39:56 UTC
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Red Hat Technical Support or your account team. If we do not hear from you, we will close this bug out. Thank you.

Comment 5 Bryan Kearney 2019-04-01 12:07:01 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.

Comment 6 Bryan Kearney 2019-04-02 13:33:44 UTC
Wrond closure reason.