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 1313197 - virt-who go to satellite6 check logic although system register to satellite5.7
Summary: virt-who go to satellite6 check logic although system register to satellite5.7
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-who
Version: 6.8
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Radek Novacek
QA Contact: Eko
URL:
Whiteboard:
: 1313238 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-01 07:55 UTC by Liushihui
Modified: 2016-12-01 00:29 UTC (History)
5 users (show)

Fixed In Version: virt-who-0.16-7.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-10 23:57:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:0859 0 normal SHIPPED_LIVE virt-who bug fix and enhancement update 2016-05-10 22:44:47 UTC

Description Liushihui 2016-03-01 07:55:42 UTC
Description of problem:
Register system to satellite5.7, if virt-who run at default mode(not specify VIRTWHO_LIBVIRT=1), virt-who can't send host/guest mapping info to satellite5.7 since "SubscriptionManagerUnregisteredError: Unable to read certificate, system is not registered or you are not root".

Version-Release number of selected component (if applicable):
virt-who-0.16-5.el6.noarch
subscription-manager-1.16.8-3.el6.x86_64
python-rhsm-1.16.6-1.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Register system to satellite5.7
[root@sgi-xe500-01 virt-who.d]# rhnreg_ks --username admin  --password redhat
2. Configure virt-who run at default mode:
VIRTWHO_DEBUG=1
VIRTWHO_SATELLITE5=1
VIRTWHO_SATELLITE_SERVER=10.66.128.78
VIRTWHO_SATELLITE_USERNAME=admin
VIRTWHO_SATELLITE_PASSWORD=redhat
3. Restart virt-who service and check virt-who's log
[root@sgi-xe500-01 virt-who.d]# service virt-who restart && tail -f /var/log/rhsm/rhsm.log
Stopping virt-who: [  OK  ]
Starting virt-who: [  OK  ]
2016-03-01 15:35:40,688 [virtwho.init INFO] MainProcess(2463):MainThread @virtwho.py:main:715 - No configurations found, using libvirt as backend
2016-03-01 15:35:40,689 [virtwho.init INFO] MainProcess(2463):MainThread @virtwho.py:main:722 - Using configuration "env/cmdline" ("libvirt" mode)
2016-03-01 15:35:40,711 [virtwho.main DEBUG] MainProcess(2465):MainThread @virtwho.py:run:229 - Starting infinite loop with 60 seconds interval
2016-03-01 15:35:40,814 [virtwho.env_cmdline DEBUG] Libvirtd-1(2473):MainThread @virt.py:run:358 - Virt backend 'env/cmdline' started
2016-03-01 15:35:40,815 [virtwho.env_cmdline INFO] Libvirtd-1(2473):MainThread @libvirtd.py:_connect:156 - Using libvirt url: ""
2016-03-01 15:35:40,822 [virtwho.env_cmdline DEBUG] Libvirtd-1(2473):MainThread @libvirtd.py:_listDomains:236 - Libvirt domains found: 
2016-03-01 15:35:40,822 [virtwho.env_cmdline DEBUG] Libvirtd-1(2473):MainThread @virt.py:enqueue:351 - Report gathered, putting to queue for sending
2016-03-01 15:35:40,834 [virtwho.main DEBUG] MainProcess(2465):MainThread @subscriptionmanager.py:_connect:121 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2016-03-01 15:35:40,836 [virtwho.main ERROR] MainProcess(2465):MainThread @virtwho.py:_main:751 - Fatal error:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 748, in _main
    result = virtWho.run()
  File "/usr/share/virt-who/virtwho.py", line 333, in run
    self.send_current_report()
  File "/usr/share/virt-who/virtwho.py", line 153, in send_current_report
    if self.send(report):
  File "/usr/share/virt-who/virtwho.py", line 195, in send
    self._sendGuestList(report)
  File "/usr/share/virt-who/virtwho.py", line 220, in _sendGuestList
    manager.sendVirtGuests(report, self.options)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 139, in sendVirtGuests
    self._connect()
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 124, in _connect
    "Unable to read certificate, system is not registered or you are not root")
SubscriptionManagerUnregisteredError: Unable to read certificate, system is not registered or you are not root

Actual results:
It will show "system is not registered or you are not root" since virt-who go to satellite6 check logic.

Expected results:
It should show the same info as virt-who specified VIRTWHO_LIBVIRT=1,please see the detail in the "Additional info"

Additional info:
When configure "VIRTWHO_LIBVIRT=1" in /etc/sysconfig/virt-who, it will show info as the following:
2016-03-01 15:23:54,109 [virtwho.main DEBUG] MainProcess(2342):MainThread @virtwho.py:<module>:814 - virt-who terminated
2016-03-01 15:23:54,269 [virtwho.init INFO] MainProcess(2378):MainThread @virtwho.py:parseOptions:630 - Using reporter_id='hp-z220-07.qe.lab.eng.nay.redhat.com'
2016-03-01 15:23:54,271 [virtwho.init INFO] MainProcess(2378):MainThread @virtwho.py:main:722 - Using configuration "env/cmdline" ("libvirt" mode)
2016-03-01 15:23:54,286 [virtwho.main DEBUG] MainProcess(2380):MainThread @virtwho.py:run:229 - Starting infinite loop with 60 seconds interval
2016-03-01 15:23:54,393 [virtwho.env_cmdline DEBUG] Libvirtd-1(2388):MainThread @virt.py:run:358 - Virt backend 'env/cmdline' started
2016-03-01 15:23:54,394 [virtwho.env_cmdline INFO] Libvirtd-1(2388):MainThread @libvirtd.py:_connect:156 - Using libvirt url: ""
2016-03-01 15:23:54,405 [virtwho.env_cmdline DEBUG] Libvirtd-1(2388):MainThread @libvirtd.py:_listDomains:236 - Libvirt domains found: 
2016-03-01 15:23:54,405 [virtwho.env_cmdline DEBUG] Libvirtd-1(2388):MainThread @virt.py:enqueue:351 - Report gathered, putting to queue for sending
2016-03-01 15:23:54,419 [virtwho.main ERROR] MainProcess(2380):MainThread @virtwho.py:send:201 - Unable to send data: virt-who does not support sending local hypervisor data to satellite; use rhn-virtualization-host instead
2016-03-01 15:23:54,419 [virtwho.main DEBUG] MainProcess(2380):MainThread @virtwho.py:send_current_report:166 - Report from "env/cmdline" failed to sent

Comment 1 Radek Novacek 2016-03-10 13:03:36 UTC
There is indeed bug in the code that prevents virt-who from working in satellite 5 mode when configured in /etc/sysconfig/virt-who.

Workaround is to set `sat_server`, `sat_username`, and `sat_password` in the /etc/virt-who.d/* config.

Comment 2 Radek Novacek 2016-03-10 15:18:37 UTC
*** Bug 1313238 has been marked as a duplicate of this bug. ***

Comment 3 Radek Novacek 2016-03-10 18:27:25 UTC
Fixed in virt-who-0.16-7.el6.

Comment 5 Liushihui 2016-03-24 03:50:52 UTC
Verified it on virt-who-0.16-7.el6 since virt-who can send host/guest mapping info to satellite5.7.Therefore, verify it.

Verified version:
virt-who-0.16-7.el6
subscription-manager-1.16.8-7.el6.x86_64
python-rhsm-1.16.6-1.el6.x86_64

Verified process:
1. Register system to satellite5.7
[root@sgi-xe500-01 virt-who.d]# rhnreg_ks --username admin  --password redhat
2. Configure virt-who run at default mode:
VIRTWHO_DEBUG=1
VIRTWHO_SATELLITE5=1
VIRTWHO_SATELLITE_SERVER=10.66.128.78
VIRTWHO_SATELLITE_USERNAME=admin
VIRTWHO_SATELLITE_PASSWORD=redhat
3. Restart virt-who service and check virt-who's log
[root@sgi-xe500-01 virt-who.d]# service virt-who restart && tail -f /var/log/rhsm/rhsm.log
Stopping virt-who: [  OK  ]
Starting virt-who: [  OK  ]
2016-03-23 23:37:39,475 [virtwho.env_cmdline DEBUG] Libvirtd-1(7074):MainThread @libvirtd.py:_listDomains:244 - Libvirt domains found: 
2016-03-23 23:37:39,476 [virtwho.env_cmdline DEBUG] Libvirtd-1(7074):MainThread @virt.py:enqueue:351 - Report for config "env/cmdline" gathered, putting to queue for sending
2016-03-23 23:37:39,479 [virtwho.main ERROR] MainProcess(7061):MainThread @virtwho.py:send:203 - Unable to send data: virt-who does not support sending local hypervisor data to satellite; use rhn-virtualization-host instead
2016-03-23 23:37:39,480 [virtwho.main DEBUG] MainProcess(7061):MainThread @virtwho.py:send_report:168 - Report from "env/cmdline" failed to sent
4. Configure multi mode in /etc/virt-who.d/xxx:
[root@sun-x4440-01 ~]# cat /etc/virt-who.d/virtwho 
[test-rhevm1]
type=rhevm
server=https://10.73.3.247:443
username=admin@internal
password=redhat
owner=ACME_Corporation
env=Library
[root@sun-x4440-01 ~]# cat /etc/sysconfig/virt-who  | grep -v ^# | grep -v ^$
VIRTWHO_DEBUG=1
VIRTWHO_SATELLITE5=1
VIRTWHO_SATELLITE_SERVER=10.66.128.78
VIRTWHO_SATELLITE_USERNAME=admin
VIRTWHO_SATELLITE_PASSWORD=redhat
VIRTWHO_HYPERV=1
VIRTWHO_HYPERV_OWNER=ACME_Corporation
VIRTWHO_HYPERV_ENV=Library
VIRTWHO_HYPERV_SERVER=10.73.5.212
VIRTWHO_HYPERV_USERNAME=administrator
VIRTWHO_HYPERV_PASSWORD=Welcome1
5. Restart virt-who can check virt-who's log
[root@sgi-xe500-01 virt-who.d]# service virt-who restart && tail -f /var/log/rhsm/rhsm.log
Stopping virt-who: [  OK  ]
Starting virt-who: [  OK  ]
2016-03-23 23:45:57,685 [virtwho.test-rhevm1 DEBUG] RhevM-1(7509):MainThread @virt.py:enqueue:351 - Report for config "test-rhevm1" gathered, putting to queue for sending
2016-03-23 23:46:01,764 [virtwho.env_cmdline DEBUG] HyperV-2(7511):MainThread @virt.py:enqueue:351 - Report for config "env/cmdline" gathered, putting to queue for sending
2016-03-23 23:46:05,381 [virtwho.main DEBUG] MainProcess(7501):MainThread @satellite.py:_connect:73 - Initializing satellite connection to https://10.66.128.78/XMLRPC
2016-03-23 23:46:05,381 [virtwho.main DEBUG] MainProcess(7501):MainThread @satellite.py:_connect:79 - Initialized satellite connection
2016-03-23 23:46:05,382 [virtwho.main INFO] MainProcess(7501):MainThread @satellite.py:hypervisorCheckIn:156 - Sending update in hosts-to-guests mapping: 0 hypervisors and 0 guests found
2016-03-23 23:46:05,383 [virtwho.main DEBUG] MainProcess(7501):MainThread @satellite.py:hypervisorCheckIn:158 - Host-to-guest mapping: {
    "hypervisors": []
}
2016-03-23 23:46:05,383 [virtwho.main INFO] MainProcess(7501):MainThread @satellite.py:hypervisorCheckIn:176 - Mapping for config "test-rhevm1" updated
2016-03-23 23:46:05,384 [virtwho.main DEBUG] MainProcess(7501):MainThread @virtwho.py:send_report:161 - Report for config "test-rhevm1" sent
2016-03-23 23:46:53,594 [virtwho.env_cmdline DEBUG] HyperV-2(7511):MainThread @hyperv.py:retry_ntlm_negotitate:67 - Using NTLM authentication
2016-03-23 23:46:54,365 [virtwho.env_cmdline DEBUG] HyperV-2(7511):MainThread @hyperv.py:retry_ntlm_authenticate:80 - Sending NTLM authentication data
2016-03-23 23:46:54,763 [virtwho.env_cmdline DEBUG] HyperV-2(7511):MainThread @hyperv.py:retry_ntlm_authenticate:103 - NTLM authentication successful
2016-03-23 23:46:57,814 [virtwho.test-rhevm1 DEBUG] RhevM-1(7509):MainThread @virt.py:enqueue:351 - Report for config "test-rhevm1" gathered, putting to queue for sending
2016-03-23 23:47:00,678 [virtwho.env_cmdline DEBUG] HyperV-2(7511):MainThread @virt.py:enqueue:351 - Report for config "env/cmdline" gathered, putting to queue for sending
2016-03-23 23:47:05,389 [virtwho.main DEBUG] MainProcess(7501):MainThread @satellite.py:_connect:73 - Initializing satellite connection to https://10.66.128.78/XMLRPC
2016-03-23 23:47:05,389 [virtwho.main DEBUG] MainProcess(7501):MainThread @satellite.py:_connect:79 - Initialized satellite connection
2016-03-23 23:47:05,390 [virtwho.main INFO] MainProcess(7501):MainThread @satellite.py:hypervisorCheckIn:156 - Sending update in hosts-to-guests mapping: 1 hypervisors and 2 guests found
2016-03-23 23:47:05,392 [virtwho.main DEBUG] MainProcess(7501):MainThread @satellite.py:hypervisorCheckIn:158 - Host-to-guest mapping: {
    "hypervisors": [
        {
            "hypervisorId": {
                "hypervisorId": "564D80F1-61F0-8510-87BF-57F9EC6122D7"
            }, 
            "name": "hyperv_02", 
            "guestIds": [
                {
                    "guestId": "C877953C-A19E-5149-B614-D97873C4CBD2", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "hypervisorVersion": "6.3.9600.16404", 
                        "virtWhoType": "hyperv", 
                        "hypervisorType": "hyperv"
                    }
                }, 
                {
                    "guestId": "8329390B-8359-F646-9176-27D738580E81", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "hypervisorVersion": "6.3.9600.16404", 
                        "virtWhoType": "hyperv", 
                        "hypervisorType": "hyperv"
                    }
                }
            ], 
            "facts": {
                "cpu.cpu_socket(s)": "4"
            }
        }
    ]
}
2016-03-23 23:47:05,395 [virtwho.main DEBUG] MainProcess(7501):MainThread @satellite.py:hypervisorCheckIn:163 - Loading systemid for 564D80F1-61F0-8510-87BF-57F9EC6122D7

Result:
Virt-who send host/guest mapping info to satellite5.7 when work at multi mode.

Comment 7 errata-xmlrpc 2016-05-10 23:57:45 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/RHEA-2016-0859.html


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