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 1337757 - Virtwho failed to connect rhevm4.0 as get wrong api url
Summary: Virtwho failed to connect rhevm4.0 as get wrong api url
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Radek Novacek
QA Contact: Eko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-20 02:26 UTC by Liushihui
Modified: 2016-12-01 00:36 UTC (History)
7 users (show)

Fixed In Version: virt-who-0.17-2.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2016-11-04 05:09:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2387 0 normal SHIPPED_LIVE virt-who bug fix and enhancement update 2016-11-03 13:53:39 UTC

Description Liushihui 2016-05-20 02:26:15 UTC
Description of problem:
Virt-who can't get correct rhevm4.0 api url result in virt-who can't get h/g mapping info when monitor rhevm4.0

Version-Release number of selected component (if applicable):
rhevm-4.0.0-0.6.master.el7ev.noarch
Satellite-6.2.0-RHEL-7-20160518
virt-who-0.17-1.el7.noarch
subscription-manager-1.17.6-1.el7.x86_64
python-rhsm-1.17.2-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Register system to satellite6.2
2.Make virt-who monitor rhevm4.0:
[root@hp-dl2x170g6-01 virt-who.d]# cat /etc/virt-who.d/virt 
[test-rhevm1]
type=rhevm
server=https://hp-z220-13.qe.lab.eng.nay.redhat.com:443/ovirt-engine/
username=admin@internal
password=redhat
owner=ACME_Corporation
env=Library
3. Restart virt-who and check virt-who's log
2016-05-19 21:59:48,396 [virtwho.test-rhevm1 DEBUG] RhevM-1(31984):MainThread @virt.py:run:364 - Virt backend 'test-rhevm1' started
2016-05-19 21:59:49,720 [virtwho.test-rhevm1 DEBUG] RhevM-1(31984):MainThread @rhevm.py:get_xml:96 - Invalid xml file: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /api/clusters was not found on this server.</p>
</body></html>

2016-05-19 21:59:49,720 [virtwho.test-rhevm1 ERROR] RhevM-1(31984):MainThread @virt.py:run:374 - Virt backend 'test-rhevm1' fails with error: Invalid XML file returned from RHEV-M: syntax error: line 1, column 49

Actual results:
RHEVM3.5's api is https://[rhevmip:443/api/
RHEVM3.5's api is https://[rhevmip:443/ovirt-engine/api/
As rhevm's api's url has been modified , it failed to get h/g mapping info.

Expected results:
Virt-who should connect correct api and get host/guest mapping info successfully.

Additional info:
Analysis virt-who's source code. After run in rhevm.py, line71

        self.clusters_url = urlparse.urljoin(self.url, "/api/clusters")

It will omit "ovirt-engine" then get wrong clusters_url="https://[rhevmip]:443/api/clusters"

Comment 2 Radek Novacek 2016-05-31 08:53:47 UTC
Fixed in virt-who-0.17-2.el7.

Comment 4 Liushihui 2016-06-03 03:17:11 UTC
Verified it on virt-who-0.17-2.el7.noarch since virt-who can get host/guest mapping info when monitor rhevm4.0. Therefore, verify it.

Verified version:
subscription-manager-1.17.6-1.el7.x86_64
python-rhsm-1.17.2-1.el7.x86_64
python-rhsm-1.17.2-1.el7.x86_64

Verified process:
1.Register system to satellite6.2
2.Make virt-who monitor rhevm4.0:
[root@hp-dl2x170g6-01 virt-who.d]# cat /etc/virt-who.d/virt 
[test-rhevm1]
type=rhevm
server=https://hp-z220-13.qe.lab.eng.nay.redhat.com:443/ovirt-engine/
username=admin@internal
password=redhat
owner=ACME_Corporation
env=Library
3. Restart virt-who and check virt-who's log
2016-06-02 22:59:10,135 [virtwho.init INFO] MainProcess(22160):MainThread @main.py:main:157 - Using configuration "test-rhevm1" ("rhevm" mode)
........
2016-06-02 22:59:13,651 [virtwho.main DEBUG] MainProcess(22160):MainThread @subscriptionmanager.py:hypervisorCheckIn:195 - Host-to-guest mapping: {
    "617c7a4e-90af-4509-be53-febb4de61aa6": [
        {
            "guestId": "f3b653d4-14c8-45bd-ab8a-89d55236752c", 
            "state": 0, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "rhevm"
            }
        }, 
        {
            "guestId": "214f9ab8-d0b8-4202-99ad-6d36b78284ff", 
            "state": 0, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "rhevm"
            }
        }, 
        {
            "guestId": "ed450c66-40c8-440e-88b1-acbc12b58b05", 
            "state": 0, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "rhevm"
            }
        }
    ], 
    "55686905-75b2-4ff4-99e2-4029d19de409": []
}

Result:
Virt-who can get host/guest mapping info when monitor rhevm4.0

Comment 5 Liushihui 2016-06-03 05:42:12 UTC
please ignore the verified version in comment 4, The correct verified version as the following:

Verified version:
rhevm4.0
virt-who-0.17-2.el7.noarch
subscription-manager-1.17.6-1.el7.x86_64
python-rhsm-1.17.2-1.el7.x86_64

Comment 7 errata-xmlrpc 2016-11-04 05:09:03 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-2016-2387.html


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