Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1410000 - [Satellite5.7]Failed to register hypervisor to another org
Summary: [Satellite5.7]Failed to register hypervisor to another org
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-who
Version: 6.9
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: 6.9
Assignee: Patrick Creech
QA Contact: Eko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-04 07:20 UTC by Liushihui
Modified: 2018-02-27 16:06 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-21 10:31:53 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github virt-who virt-who pull 42 0 None None None 2017-01-13 21:10:24 UTC
Red Hat Bugzilla 1460786 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Product Errata RHBA-2017:0675 0 normal SHIPPED_LIVE virt-who bug fix update 2017-03-21 12:35:57 UTC

Internal Links: 1460786

Description Liushihui 2017-01-04 07:20:09 UTC
Description of problem:
Failed to register hypervisor to another organization since Hypervisor Base channel has been used by the previous org

Version-Release number of selected component (if applicable):
virt-who-0.18-1.el6.noarch
subscription-manager-1.18.6-1.el6.x86_64
python-rhsm-1.18.6-1.el6.x86_64
satellite5.7

How reproducible:
Always

Steps to Reproduce:
1. Register hypervisor to satellite5.7 with username=admin and password=redhat, virt-who send mapping info to satellite5.7's default org "Red Hat Czech, s.r.o". successfully. the hypervisors will auto attach a hypervisor base channel.
[root@hp-z220-05 virt-who.d]# virt-who --satellite --satellite-server=satellite57jan3.redhat.com --satellite-username=admin --satellite-password=redhat --esx --esx-owner= --esx-env= --esx-server=10.73.3.161 --esx-username=Administrator@vsphere.local --esx-password=Welcome1! -o -d

2. In satellite5.7 webUI, create a new org named test_org. 
Go to Admin-->Create Organization, with the following info:
Organization Name: test_org
Desired Login*:testadmin
Desired Password *:redhat

3. In satellite5.7 webUI, go to systems page, delete all hypervisors which generate on step1.

4. Register hypervisor to satellite5.7 with new username=testadmin and password=redhat(it owns to org "test_org"), check virt-who's log.
[root@hp-z220-05 virt-who.d]# virt-who --satellite --satellite-server=satellite57jan3.redhat.com --satellite-username=testadmin --satellite-password=redhat --esx --esx-owner=test_org --esx-env= --esx-server=10.73.3.161 --esx-username=Administrator@vsphere.local --esx-password=Welcome1! -o -d

2017-01-04 01:23:44,447 [virtwho.init INFO] MainProcess(27279):MainThread @main.py:main:165 - Using configuration "env/cmdline" ("esx" mode)
2017-01-04 01:23:44,447 [virtwho.init INFO] MainProcess(27279):MainThread @main.py:main:167 - Using reporter_id='hp-z220-05.qe.lab.eng.nay.redhat.com'
2017-01-04 01:23:44,479 [virtwho.env_cmdline DEBUG] Esx-1(27285):MainThread @virt.py:run:363 - Virt backend 'env/cmdline' started
2017-01-04 01:23:44,479 [virtwho.env_cmdline DEBUG] Esx-1(27285):MainThread @esx.py:_prepare:128 - Log into ESX
2017-01-04 01:23:44,680 [virtwho.env_cmdline DEBUG] Esx-1(27285):MainThread @esx.py:_prepare:131 - Creating ESX event filter
2017-01-04 01:23:44,764 [virtwho.env_cmdline DEBUG] Esx-1(27285):MainThread @virt.py:enqueue:356 - Report for config "env/cmdline" gathered, putting to queue for sending
2017-01-04 01:23:44,772 [rhsm.https DEBUG] MainProcess(27279):MainThread @https.py:<module>:59 - Using m2crypto wrappers to provide httplib and ssl
2017-01-04 01:23:44,780 [virtwho.main DEBUG] MainProcess(27279):MainThread @satellite.py:_connect:75 - Initializing satellite connection to https://satellite57jan3.redhat.com/XMLRPC
2017-01-04 01:23:44,781 [virtwho.main DEBUG] MainProcess(27279):MainThread @satellite.py:_connect:84 - Initialized satellite connection
2017-01-04 01:23:44,781 [virtwho.main INFO] MainProcess(27279):MainThread @satellite.py:hypervisorCheckIn:208 - Sending update in hosts-to-guests mapping: 2 hypervisors and 1 guests found
2017-01-04 01:23:44,782 [virtwho.main DEBUG] MainProcess(27279):MainThread @satellite.py:hypervisorCheckIn:210 - Host-to-guest mapping: {
    "hypervisors": [
        {
            "hypervisorId": {
                "hypervisorId": "58a14d56-558b-61d0-fbdf-b690cf7255df"
            }, 
            "name": "bootp-73-5-217.rhts.eng.pek2.redhat.com", 
            "guestIds": [], 
            "facts": {
                "hypervisor.type": "VMware ESXi", 
                "cpu.cpu_socket(s)": "2", 
                "hypervisor.version": "6.5.0"
            }
        }, 
        {
            "hypervisorId": {
                "hypervisorId": "9fea4d56-5ed5-ddfe-b806-e7872726c0d7"
            }, 
            "name": "bootp-73-5-251.rhts.eng.pek2.redhat.com", 
            "guestIds": [
                {
                    "guestId": "421acd53-a77b-df79-99b0-48b1beaf5ce6", 
                    "state": 1, 
                    "attributes": {
                        "active": 1, 
                        "virtWhoType": "esx"
                    }
                }
            ], 
            "facts": {
                "hypervisor.type": "VMware ESXi", 
                "cpu.cpu_socket(s)": "2", 
                "hypervisor.version": "6.5.0"
            }
        }
    ]
}
2017-01-04 01:23:44,782 [virtwho.main DEBUG] MainProcess(27279):MainThread @satellite.py:hypervisorCheckIn:215 - Loading systemid for 58a14d56-558b-61d0-fbdf-b690cf7255df
2017-01-04 01:23:44,782 [virtwho.main DEBUG] MainProcess(27279):MainThread @satellite.py:_load_hypervisor:155 - Loading system id info from /var/lib/virt-who/hypervisor-systemid-58a14d56-558b-61d0-fbdf-b690cf7255df
2017-01-04 01:23:44,783 [virtwho.main DEBUG] MainProcess(27279):MainThread @satellite.py:hypervisorCheckIn:218 - Building plan for hypervisor 58a14d56-558b-61d0-fbdf-b690cf7255df: []
2017-01-04 01:23:44,784 [virtwho.main DEBUG] MainProcess(27279):MainThread @satellite.py:hypervisorCheckIn:223 - Sending plan: [[0, 'exists', 'system', {'uuid': '0000000000000000', 'identity': 'host'}], [0, 'crawl_began', 'system', {}], [0, 'crawl_ended', 'system', {}]]
2017-01-04 01:23:44,787 [virtwho.env_cmdline DEBUG] Esx-1(27285):MainThread @virt.py:run:384 - Virt backend 'env/cmdline' stopped after sending one report
2017-01-04 01:23:45,187 [virtwho.main WARNING] MainProcess(27279):MainThread @satellite.py:hypervisorCheckIn:227 - System was deleted from Satellite 5, reregistering
2017-01-04 01:23:45,407 [virtwho.main DEBUG] MainProcess(27279):MainThread @satellite.py:_register_system:105 - hypervisor-base channel was not found, creating one
2017-01-04 01:23:45,465 [virtwho.main ERROR] MainProcess(27279):MainThread @satellite.py:_register_system:113 - Unable to create hypervisor-base channel
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/virtwho/manager/satellite/satellite.py", line 111, in _register_system
    'channel-x86_64', '')
  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/lib/python2.6/site-packages/virtwho/util.py", line 45, in request
    return self.parse_response(resp)
  File "/usr/lib/python2.6/site-packages/virtwho/util.py", line 54, in parse_response
    return u.close()
  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
Fault: <Fault 1200: "redstone.xmlrpc.XmlRpcFault: The channel name 'Hypervisor Base' is already in use, please enter a different name">
2017-01-04 01:23:45,487 [virtwho.main ERROR] MainProcess(27279):MainThread @satellite.py:hypervisorCheckIn:231 - Unable to send host/guest association to the satellite:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/virtwho/manager/satellite/satellite.py", line 228, in hypervisorCheckIn
    hypervisor_systemid = self._load_hypervisor(hypervisor.hypervisorId, hypervisor_type=report.config.type, force=True)
  File "/usr/lib/python2.6/site-packages/virtwho/manager/satellite/satellite.py", line 159, in _load_hypervisor
    new_system = self._register_system(hypervisor_uuid, hypervisor_type, systemid_filename)
  File "/usr/lib/python2.6/site-packages/virtwho/manager/satellite/satellite.py", line 114, in _register_system
    raise SatelliteError("Unable to create hypervisor-base channel: %s" % str(e))
SatelliteError: Unable to create hypervisor-base channel: <Fault 1200: "redstone.xmlrpc.XmlRpcFault: The channel name 'Hypervisor Base' is already in use, please enter a different name">
2017-01-04 01:23:45,487 [virtwho.main ERROR] MainProcess(27279):MainThread @executor.py:send:144 - Unable to send data: Unable to send host/guest association to the satellite: Unable to create hypervisor-base channel: <Fault 1200: "redstone.xmlrpc.XmlRpcFault: The channel name 'Hypervisor Base' is already in use, please enter a different name">
2017-01-04 01:23:45,488 [virtwho.main DEBUG] MainProcess(27279):MainThread @executor.py:send_report:109 - Report from "env/cmdline" failed to sent


Actual results:
Failed to send mapping info to new org "test_org" since the channel name 'Hypervisor Base' is already used by previous org "Red Hat Czech, s.r.o", please see screenshot channel.jpeg in attachment.

Expected results:
Virt-who can send mapping info to any specify org.

Additional info:

Comment 2 Chris Snyder 2017-01-05 16:33:54 UTC
Hey Grant,

Is there any way in Sat 5 to specify the organization that a hypervisor guest mapping is intended for?

Any insight on the above would be much appreciated.

Comment 3 Grant Gainey 2017-01-05 16:49:03 UTC
Hey Chris,

The problem here is that virt-who creates the customer base-channel-for-hypervisors with a static name, so when it goes to create one using a different login (which is in a different org), the names/labels collide.

In the public API, the user.getDetails call returns (among other things) 'org_id'. I would try looking up the details for the provided login, and changing the code that checks-for/creates the hypervisor base channel, to use something like "<current string here>" + "-" + org_id , for both channel name and label - that would avoid the collision in the above stacktrace\, I believe.

Does that help?

Comment 4 Chris Snyder 2017-01-05 16:51:22 UTC
That does help. Thank you much Grant!

Comment 9 yuefliu 2017-02-06 08:14:17 UTC
Verified with the RHEL-6.9-20170201.0 (snapshot 3), still failed to register hypervisor to another org with below error, so reopen the bug.

#[root@hp-z220-09 virt-who]# virt-who --satellite --satellite-server=10.66.129.50 --satellite-username=testadmin --satellite-password=redhat --esx --esx-owner=test_org --esx-env=xxx --esx-server=10.73.3.237 --esx-username=Administrator@vsphere.local --esx-password=Welcome1! -o -d

2017-02-06 03:02:15,762 [virtwho.init INFO] MainProcess(12026):MainThread @main.py:main:165 - Using configuration "env/cmdline" ("esx" mode)
2017-02-06 03:02:15,762 [virtwho.init INFO] MainProcess(12026):MainThread @main.py:main:167 - Using reporter_id='hp-z220-09.qe.lab.eng.nay.redhat.com'
2017-02-06 03:02:15,793 [virtwho.env_cmdline DEBUG] Esx-1(12032):MainThread @virt.py:run:363 - Virt backend 'env/cmdline' started
2017-02-06 03:02:15,794 [virtwho.env_cmdline DEBUG] Esx-1(12032):MainThread @esx.py:_prepare:128 - Log into ESX
2017-02-06 03:02:15,995 [virtwho.env_cmdline DEBUG] Esx-1(12032):MainThread @esx.py:_prepare:131 - Creating ESX event filter
2017-02-06 03:02:16,093 [virtwho.env_cmdline DEBUG] Esx-1(12032):MainThread @virt.py:enqueue:356 - Report for config "env/cmdline" gathered, putting to queue for sending
2017-02-06 03:02:16,099 [rhsm.https DEBUG] MainProcess(12026):MainThread @https.py:<module>:59 - Using m2crypto wrappers to provide httplib and ssl
2017-02-06 03:02:16,104 [virtwho.main DEBUG] MainProcess(12026):MainThread @satellite.py:_connect:75 - Initializing satellite connection to https://10.66.129.50/XMLRPC
2017-02-06 03:02:16,105 [virtwho.main DEBUG] MainProcess(12026):MainThread @satellite.py:_connect:84 - Initialized satellite connection
2017-02-06 03:02:16,105 [virtwho.main INFO] MainProcess(12026):MainThread @satellite.py:hypervisorCheckIn:218 - Sending update in hosts-to-guests mapping: 2 hypervisors and 3 guests found
2017-02-06 03:02:16,106 [virtwho.main DEBUG] MainProcess(12026):MainThread @satellite.py:hypervisorCheckIn:220 - Host-to-guest mapping: {
    "hypervisors": [
        {
            "hypervisorId": {
                "hypervisorId": "b6ad4d56-5fdd-94c2-4357-afcaac9175eb"
            }, 
            "name": "host1.rhts.eng.pek2.redhat.com", 
            "guestIds": [
                {
                    "guestId": "421d1083-25f6-f8d0-b31a-f98ec7e4a87c", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "virtWhoType": "esx"
                    }
                }
            ], 
            "facts": {
                "hypervisor.type": "VMware ESXi", 
                "cpu.cpu_socket(s)": "2", 
                "hypervisor.version": "6.5.0"
            }
        }, 
        {
            "hypervisorId": {
                "hypervisorId": "c0f04d56-d7a9-577f-7100-76d8b97e9f3f"
            }, 
            "name": "236-fqdn", 
            "guestIds": [
                {
                    "guestId": "421ce0fc-af56-2476-0edc-20deed295e37", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "virtWhoType": "esx"
                    }
                }, 
                {
                    "guestId": "421de5a3-a462-2fae-656b-094173934a0d", 
                    "state": 1, 
                    "attributes": {
                        "active": 1, 
                        "virtWhoType": "esx"
                    }
                }
            ], 
            "facts": {
                "hypervisor.type": "VMware ESXi", 
                "cpu.cpu_socket(s)": "2", 
                "hypervisor.version": "6.5.0"
            }
        }
    ]
}
2017-02-06 03:02:16,107 [virtwho.main DEBUG] MainProcess(12026):MainThread @satellite.py:hypervisorCheckIn:225 - Loading systemid for b6ad4d56-5fdd-94c2-4357-afcaac9175eb
2017-02-06 03:02:16,107 [virtwho.main DEBUG] MainProcess(12026):MainThread @satellite.py:_load_hypervisor:165 - Loading system id info from /var/lib/virt-who/hypervisor-systemid-b6ad4d56-5fdd-94c2-4357-afcaac9175eb
2017-02-06 03:02:16,114 [virtwho.env_cmdline DEBUG] Esx-1(12032):MainThread @virt.py:run:384 - Virt backend 'env/cmdline' stopped after sending one report
2017-02-06 03:02:16,504 [virtwho.main DEBUG] MainProcess(12026):MainThread @satellite.py:_register_system:105 - Using existing hypervisor-base channel

2017-02-06 03:02:23,786 [virtwho.main ERROR] MainProcess(12026):MainThread @satellite.py:_register_system:141 - Unable to register system:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/virtwho/manager/satellite/satellite.py", line 139, in _register_system
    "Hypervisor OS", "unknown", "x86_64", self.username, self.password, {})
  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/lib/python2.6/site-packages/virtwho/util.py", line 45, in request
    return self.parse_response(resp)
  File "/usr/lib/python2.6/site-packages/virtwho/util.py", line 54, in parse_response
    return u.close()
  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
Fault: <Fault -90: '\nError Class Code: 90\nError Class Info: Unable to entitle system\nExplanation: \n     An error has occurred while processing your request. If this problem\n     persists please enter a bug report at bugzilla.redhat.com.\n     If you choose to submit the bug report, please be sure to include\n     details of what you were trying to do when this error occurred and\n     details on how to reproduce this problem.\n'>
2017-02-06 03:02:23,786 [virtwho.main ERROR] MainProcess(12026):MainThread @executor.py:send:144 - Unable to send data: Unable to register system: <Fault -90: '\nError Class Code: 90\nError Class Info: Unable to entitle system\nExplanation: \n     An error has occurred while processing your request. If this problem\n     persists please enter a bug report at bugzilla.redhat.com.\n     If you choose to submit the bug report, please be sure to include\n     details of what you were trying to do when this error occurred and\n     details on how to reproduce this problem.\n'>
2017-02-06 03:02:23,786 [virtwho.main DEBUG] MainProcess(12026):MainThread @executor.py:send_report:109 - Report from "env/cmdline" failed to sent
2017-02-06 03:02:23,787 [virtwho.main DEBUG] MainProcess(12026):MainThread @__main__.py:main:23 - virt-who terminated
2017-02-06 03:02:23,787 [virtwho.main DEBUG] MainProcess(12026):MainThread @executor.py:terminate:308 - virt-who is shutting down

Comment 10 yuefliu 2017-02-06 09:15:13 UTC
Update comment 9, verified the bug with RHEL-6.9-20170202.0 (snapshot 3), not RHEL-6.9-20170201.0, thanks.

Comment 11 Patrick Creech 2017-02-06 16:18:37 UTC
yuefliu,

I talked with ggainey about this, and it appears the organization 'test_org' does not have any Management entitlements added to it, which will be needed for this to work.  Can you add a management entitlement to the org and try again?

Comment 12 Liushihui 2017-02-07 02:01:22 UTC
The comment 9's problem can't reproduce after add management entitlement to the 'test_org'. Do as the bug's description, this bug can't reproduce. Therefore, Verify it on virt-who-0.18-3.el6.noarch.

Comment 13 yuefliu 2017-03-07 01:23:10 UTC
please refer to comment12 by Liushihui, have verified the bug.

Comment 15 errata-xmlrpc 2017-03-21 10:31: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://rhn.redhat.com/errata/RHBA-2017-0675.html


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