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 1211435 - it should show error msg when giving an wrong env and owner which are not exist in Satellite server
Summary: it should show error msg when giving an wrong env and owner which are not exi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who
Version: 7.5
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: pre-dev-freeze
: ---
Assignee: Jiri Hnidek
QA Contact: Eko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-14 01:58 UTC by Liushihui
Modified: 2019-10-28 07:23 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Cause: When virt-who is configured to report to a Satellite instance and the values specified for 'owner' and/or 'env' do not exist in the Satellite instance, virt-who could silently fail. Consequence: Updated host-guest mappings required for consumption of host-based subscriptions may not be available to the appropriate guests. Fix: Virt-who will check for correct values of 'owner' and 'env' when reporting to Satellite 6 and output an error message in the logs should the 'owner' or 'env' not exist. Result: Virt-who users should be more easily able to discover issues when configuring virt-who to report to Satellite 6.
Clone Of:
Environment:
Last Closed: 2018-04-10 16:19:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github virt-who virt-who pull 88 0 None closed 1211435: Don't send host-to-geust mapping, when env, owner are wrong 2020-12-03 07:21:55 UTC
Red Hat Product Errata RHEA-2018:0895 0 None None None 2018-04-10 16:21:04 UTC

Description Liushihui 2015-04-14 01:58:56 UTC
Description of problem:
When virt-who is used in satellite 6, it requires --*-env and --*-owner options to be set, although they're not used.

Version-Release number of selected component (if applicable):
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-6.1.0-RHEL-7-20150409.0

How reproducible:
Always

Steps to Reproduce:
1.Register rhel to Satellite6.1.0
2.Make virt-who run at command-line without --*-env and --*-owner options to be set.
[root@hp-z220-06 virt-who.d]# virt-who --one-shot --rhevm --rhevm-server=https://10.66.79.58:443 --rhevm-username=admin@internal --rhevm-password=redhat
Option --rhevm-owner (or VIRTWHO_RHEVM_OWNER envirmental variable) needs to be set
[root@hp-z220-06 virt-who.d]# virt-who --one-shot --rhevm --rhevm-server=https://10.66.79.58:443 --rhevm-username=admin@internal --rhevm-password=redhat --rhevm-owner=aaaa
Option --rhevm-env (or VIRTWHO_RHEVM_ENV envirmental variable) needs to be set
3.In the configure file ,both VIRTWHO_ESX_OWNER and VIRTWHO_ESX_ENV haven't been set, see as the following:
[root@hp-z220-06 virt-who.d]# vim /etc/sysconfig/virt-who
VIRTWHO_BACKGROUND=1
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=10
VIRTWHO_ESX=1
VIRTWHO_ESX_OWNER=
VIRTWHO_ESX_ENV=
VIRTWHO_ESX_SERVER=10.66.79.68
VIRTWHO_ESX_USERNAME=Administrator
VIRTWHO_ESX_PASSWORD=qwer1234P!
4. Restart virt-who service.
[root@hp-z220-06 virt-who.d]# service virt-who restart
Stopping virt-who:                                         [FAILED]
Starting virt-who: Option --esx-owner (or VIRTWHO_ESX_OWNER envirmental variable) needs to be set
                                                          [FAILED]

Actual results:
Failed to start virt-who service. Although virt-who hasn't use these two options, it still requires --*-env and --*-owner options to be set.

Expected results:
As virt-who hasn't used --*-env and --*-owner in the command line and it also hasn't use VIRTWHO_ESX_OWNER and VIRTWHO_ESX_ENV in the configure file, these options should optional not compulsive.

Additional info:
see the similar bug 1188568 which exist on Satellite5

Comment 2 Radek Novacek 2015-04-14 07:14:00 UTC
I don't see where is the problem.

virt-who in sat6 mode requires both owner and env to be set - either as commandline options or as environment variables (in /etc/sysconfig/virt-who).

When these options are not supplied or are empty, virt-who fails to run. I think this is correct behaviour. Am I missing something?

Comment 3 Liushihui 2015-04-14 08:03:31 UTC
Radek, Actually, virt-who seems hasn't use the owner and env which configured on /etc/sysconfig/virt-who or command line, it just send the host/guest mapping to owner or env which system has registered. For example:
system has been registered to "Default_Organization", no matter which owner or env set on configure file or command line, virt-who will send the host/guest mapping to the "Default_Organization",it seems the env and owner which configured in config file hasn't take effect. 
Meanwhile, In SAM1.4.1, in this situation, virt-who will show some error log which remind the configure is wrong when the configure env and owner isn't the same as it has registered.
If owner and env will be used on satellite6, it should show error message when the configure is wrong. what's your opinion?
[root@hp-z220-03 libvirt-test-API]# subscription-manager identity
system identity: 2b7d110a-3be9-451d-bfa2-07e26d57d22f
name: hp-z220-03.qe.lab.eng.nay.redhat.com
org name: Default Organization
org ID: Default_Organization

Comment 4 Liushihui 2015-04-23 09:08:29 UTC
Reproduce this issue as

Comment 5 Liushihui 2015-04-23 09:20:22 UTC
As it hasn't this problem on SAM1.4.1. it only exist on satellite6.1.0. Therefore, Reassign this bug to satellite6.1.0. 

Reproduce this issue as the following steps:

Version-Release number of selected component (if applicable):
subscription-manager-1.14.5-1.el6.x86_64
python-rhsm-1.14.2-1.el6.x86_64
virt-who-0.12-5.el6.noarch
katello-headpin-1.4.3.28-1.el6sam_splice.noarch
candlepin-0.9.6.5-1.el6sam.noarch
Satellite-6.1.0-RHEL-7-20150417.0

How reproducible:
Always

Steps to Reproduce:
1.Register system to Satellite server, the owner is "Default_Organization" , the env is "Library"
[root@rhel6 ~]# subscription-manager identity
system identity: a83a17c7-a07f-436e-a2f3-f4312e746407
name: rhel6.7-20150415.redhat.com
org name: Default Organization
org ID: Default_Organization
environment name: Library
2. Configure the different env and owner which isn't exist on Satellite.
# cat /etc/virt-who.d/virt
[test-esx1]
type=esx
server=10.66.79.68
username=Administrator
#encrypted_password=07928b0a0b0caa7c6e3b5915466210bd
password=qwer1234P!
owner=aaa
env=aaa
3. Restart virt-who service
# service virt-who restart
# tail -f /var/log/rhsm/rhsm.log

Result: virt-who will send host/guest mapping to "Default_Organization" which is different from its config

Expected result: As virt-who's configure is wrong ,It should show some error log,it can't send the host/guest mapping to "Default_Organization"

Comment 6 RHEL Program Management 2015-04-23 09:33:27 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 8 Tom McKay 2016-03-07 19:17:34 UTC
Need to have discussions on how this should behave.

Comment 13 Liushihui 2016-12-09 06:35:19 UTC
This bug is still exist on Satellite-6.2.0-RHEL-7-20161205.0.
Run virt-who with wrong env or owner, virt-who still send host/guest mapping info to defualt_org.

Satellite version:
satellite-6.2.5-1.0.el6sat.noarch
katello-3.0.0-14.el6sat.noarch
candlepin-0.9.54.14-1.el6.noarch
foreman-1.11.0.59-1.el6sat.noarch

Reproduced process:
1. Register system to satellite6.2
[root@hp-nehalem-02 ~]# subscription-manager  identity
system identity: 1f0ce4d0-d105-4eb2-a337-a0cf325d0cf9
name: hp-nehalem-02.rhts.eng.bos.redhat.com
org name: Default Organization
org ID: Default_Organization
environment name: Library

2. Run virt-who with wrong env/owner:
[root@hp-nehalem-02 ~]# virt-who --xen --xen-owner=xxxxxxx --xen-env=Library --xen-server=10.73.131.133 --xen-username=root --xen-password=Welcome1 -o -d

3. Check virt-who's log on terminal

4. Go to satellite webUI, check Default_Organization's hosts


Result:
Virtwho still can send mapping to org Default_Organization. 
It can show the xen hypervisor on satellite webUI under Default_Organization

Comment 14 Liushihui 2017-01-19 01:02:10 UTC
It still exist on satellite6.2.7-sp2.

Comment 15 yuefliu 2017-03-31 09:19:15 UTC
It still exist on RHEL-7.4-20170330.n.1

Comment 17 Chris Snyder 2017-06-28 15:51:44 UTC
I suspect this might be to do with virt-who using the consumer cert of the local system for auth. Moving to the virt-who component for investigation.

Comment 20 Chris Snyder 2017-08-22 13:54:50 UTC
Moving to MODIFIED as the fix has been merged upstream and will be included in the rebase on upstream.

Comment 22 yuefliu 2017-11-03 02:02:05 UTC
Verified the bug with virt-who-0.21.0-1.el7.noarch, when configure virt-who against Satellite6.2/6.3 by CLI or /etc/virt-who.d/test.conf or /etc/sysconfig/virt-who with wrong owner or/and env, virt-who will fail to run the hypervisor with Error like below and send other available hypervisors successfully.


2017-11-03 09:49:39,913 [virtwho.destination_-5765656196432590097 ERROR] MainProcess(119707):Thread-5 @virt.py:_send_data:640 - Error during hypervisor checkin: Cannot send data to: Default_Organization, because owner from configuration: xxxxxx is different
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtwho/virt/virt.py", line 623, in _send_data
    options=self.options)
  File "/usr/lib/python2.7/site-packages/virtwho/manager/subscriptionmanager/subscriptionmanager.py", line 238, in hypervisorCheckIn
    connection = self._connect(report.config)
  File "/usr/lib/python2.7/site-packages/virtwho/manager/subscriptionmanager/subscriptionmanager.py", line 204, in _connect
    self._check_owner_lib(kwargs, config)
  File "/usr/lib/python2.7/site-packages/virtwho/manager/subscriptionmanager/subscriptionmanager.py", line 123, in _check_owner_lib
    (owner_id, config['owner'])
ManagerError: Cannot send data to: Default_Organization, because owner from configuration: xxxxxx is different

Comment 25 errata-xmlrpc 2018-04-10 16:19:53 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://access.redhat.com/errata/RHEA-2018:0895


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