RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1167451 - virt-who using wrong username and password for Satellite login
Summary: virt-who using wrong username and password for Satellite login
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-who
Version: 6.0
Hardware: noarch
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Radek Novacek
QA Contact: gaoshang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-24 20:05 UTC by Matthew LeSieur
Modified: 2019-09-12 08:06 UTC (History)
7 users (show)

Fixed In Version: virt-who-0.12-1.el6
Doc Type: Bug Fix
Doc Text:
Logging in to a Red Hat Satellite 5 server with the virt-who agent previously failed with an "incomplete format" error. With this update, virt-who uses correct credentials for connecting to Satellite 5 servers, and the login now works.
Clone Of:
Environment:
Last Closed: 2015-07-22 07:15:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to fix file /usr/share/virt-who/manager/satellite/satellite.py (1.68 KB, patch)
2014-11-24 20:05 UTC, Matthew LeSieur
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1377 0 normal SHIPPED_LIVE virt-who bug fix and enhancement update 2015-07-20 17:58:35 UTC

Description Matthew LeSieur 2014-11-24 20:05:35 UTC
Created attachment 960912 [details]
Patch to fix file /usr/share/virt-who/manager/satellite/satellite.py

Description of problem:

When configuring virt-who to populate Red Hat Satellite with hypervisors and virtual machine information from a vCenter server, the username and password for vCenter is erroneously used to log into Red Hat Satellite.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Server release 6.6 (Santiago)
virt-who-0.10-8.el6.noarch

How reproducible:
Configure virt-who to source information from a vCenter server and target information to a Red Hat Satellite server.

Steps to Reproduce:
1. Configure virt-who by entering appropriate information into /etc/sysconfig/virt-who (see below).  Temporarily, enable DEBUG and disable BACKGROUND.
2. Start virt-who: service virt-who start
3. See error messages about Satellite login problem.

Actual results:
ERROR: Unable to send host/guest assocaition to the satellite:
Traceback (most recent call last):
  File "/usr/share/virt-who/manager/satellite/satellite.py", line 158, in hypervisorCheckIn
    self.server.registration.virt_notify(hypervisor_systemid["system_id"], plan)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1243, in request
    headers
ProtocolError: <ProtocolError for vcenter.example.com/XMLRPC: 400 Bad Request>
ERROR: Error in communication with subscription manager, trying to recover:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 125, in _send
    self._sendGuests(config, virtualGuests)
  File "/usr/share/virt-who/virtwho.py", line 154, in _sendGuests
    result = manager.hypervisorCheckIn(config, virtualGuests)
  File "/usr/share/virt-who/manager/satellite/satellite.py", line 161, in hypervisorCheckIn
    raise SatelliteError("Unable to send host/guest assocaition to the satellite: % " % str(e))
ValueError: incomplete format

Expected results:
  Virt-who should be using the VIRTWHO_SATELLITE* variables for logging into Satellite, not VIRTWHO_ESX*

Additional info:
  Problem resolved using the attached patch.

  Important parts of /etc/sysconfig/virt-who:

VIRTWHO_BACKGROUND=0
VIRTWHO_DEBUG=1
VIRTWHO_ONE_SHOT=1
VIRTWHO_INTERVAL=0
VIRTWHO_SAM=0
VIRTWHO_SATELLITE=1
VIRTWHO_LIBVIRT=0
VIRTWHO_VDSM=0
VIRTWHO_ESX=1
VIRTWHO_RHEVM=0
VIRTWHO_HYPERV=0
VIRTWHO_ESX_OWNER=“Company Name”
VIRTWHO_ESX_ENV=not-used
VIRTWHO_ESX_SERVER="vcenter.example.com”
VIRTWHO_ESX_USERNAME="rh-virt-who”
VIRTWHO_ESX_PASSWORD="eradicated"
VIRTWHO_SATELLITE_SERVER=rhnsat.example.com
VIRTWHO_SATELLITE_USERNAME=virtwho
VIRTWHO_SATELLITE_PASSWORD=“eradicated”

Comment 1 Radek Novacek 2014-11-25 10:54:34 UTC
The same bug appears on RHEL-7: https://bugzilla.redhat.com/show_bug.cgi?id=1158859

Comment 2 Radek Novacek 2014-11-26 12:45:12 UTC
*** Bug 1167943 has been marked as a duplicate of this bug. ***

Comment 3 Radek Novacek 2015-02-26 09:47:44 UTC
This bug has been addresses upstream and will be fixed by rebase in RHEL-6.7.

Comment 4 Radek Novacek 2015-02-27 19:37:19 UTC
Fixed by rebase to virt-who-0.12-1.el6.

Comment 6 Liushihui 2015-04-02 09:06:40 UTC
Verified it on virt-who-0.12-2.el6.noarch.

Verified version:
virt-who-0.12-2.el6.noarch
subscription-manager-1.14.1-1.el6.x86_64
python-rhsm-1.14.1-1.el6.x86_64
Satellite-5.7.0-RHEL6-re20150108.2-x86_64

Verified process:
1.Register rhel to Satellite-5.7
[root@hp-z220-06 rhn]# rhnreg_ks --username virtwho_test --password=redhat123
[root@hp-z220-06 rhn]# subscription-manager identity
server type: RHN Classic
2.Configure virt-who in /etc/sysconfig/virt-who as the following:
[root@hp-z220-06 rhn]# cat /etc/sysconfig/virt-who
VIRTWHO_BACKGROUND=1
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=10
VIRTWHO_SATELLITE5=1
VIRTWHO_ESX=1
VIRTWHO_ESX_OWNER=ACME_Corporation
VIRTWHO_ESX_ENV=Library
VIRTWHO_ESX_SERVER=10.66.79.68
VIRTWHO_ESX_USERNAME=Administrator
VIRTWHO_ESX_PASSWORD=qwer1234P!
VIRTWHO_SATELLITE_SERVER=satellite57.redhat.com
VIRTWHO_SATELLITE_USERNAME=virtwho_test
VIRTWHO_SATELLITE_PASSWORD=redhat123
3.Restart virt-who service and check the virt-who's log file.
[root@hp-z220-06 rhn]# service virt-who restart
Stopping virt-who:                                         [FAILED]
Starting virt-who:                                         [  OK  ]
[root@hp-z220-06 rhn]# tail -f /var/log/rhsm/rhsm.log
2015-04-02 16:52:18,585 [INFO]  @virtwho.py:475 - Using configuration "env/cmdline" ("esx" mode)
2015-04-02 16:52:18,585 [DEBUG]  @virtwho.py:131 - Starting infinite loop with 10 seconds interval
2015-04-02 16:52:18,736 [DEBUG]  @esx.py:51 - Log into ESX
2015-04-02 16:52:21,231 [DEBUG]  @esx.py:54 - Creating ESX event filter
2015-04-02 16:52:21,540 [DEBUG]  @esx.py:113 - Waiting for ESX changes
2015-04-02 16:52:21,560 [DEBUG]  @satellite.py:60 - Initializing satellite connection to https://satellite57.redhat.com/XMLRPC
2015-04-02 16:52:21,560 [INFO]  @satellite.py:66 - Initialized satellite connection
2015-04-02 16:52:21,561 [INFO]  @satellite.py:147 - Sending update in hosts-to-guests mapping: {564d20f4-71b7-acdb-f875-d64ecec4a6c0: [4226082e-2746-17dc-6f01-dc91c6fc7fbb, 4224d6d4-b9ef-cd33-8f19-56bcfc179ed5]}
2015-04-02 16:52:21,561 [DEBUG]  @satellite.py:152 - Loading systemid for 564d20f4-71b7-acdb-f875-d64ecec4a6c0
2015-04-02 16:52:21,561 [DEBUG]  @satellite.py:74 - Loading system id info from /var/lib/virt-who/hypervisor-systemid-564d20f4-71b7-acdb-f875-d64ecec4a6c0
2015-04-02 16:52:21,918 [DEBUG]  @satellite.py:97 - New system created in satellite, system id saved in /var/lib/virt-who/hypervisor-systemid-564d20f4-71b7-acdb-f875-d64ecec4a6c0
2015-04-02 16:52:21,919 [DEBUG]  @satellite.py:155 - Building plan for hypervisor 564d20f4-71b7-acdb-f875-d64ecec4a6c0: [4226082e-2746-17dc-6f01-dc91c6fc7fbb, 4224d6d4-b9ef-cd33-8f19-56bcfc179ed5]
2015-04-02 16:52:21,919 [DEBUG]  @satellite.py:159 - Sending plan: [[0, 'exists', 'system', {'uuid': '0000000000000000', 'identity': 'host'}], [0, 'crawl_began', 'system', {}], [0, 'exists', 'domain', {'state': 'running', 'memory_size': 0, 'name': u'VM from esx hypervisor 564d20f4-71b7-acdb-f875-d64ecec4a6c0', 'virt_type': 'fully_virtualized', 'vcpus': 1, 'uuid': '4226082e274617dc6f01dc91c6fc7fbb'}], [0, 'exists', 'domain', {'state': 'running', 'memory_size': 0, 'name': u'VM from esx hypervisor 564d20f4-71b7-acdb-f875-d64ecec4a6c0', 'virt_type': 'fully_virtualized', 'vcpus': 1, 'uuid': '4224d6d4b9efcd338f1956bcfc179ed5'}], [0, 'crawl_ended', 'system', {}]]

Result:
virt-who can send the host/gust mappping to satellite5.7 server and the hyeprvisor will show on the satellite web UI.

Comment 7 errata-xmlrpc 2015-07-22 07:15:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1377.html


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