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 1403640 - Show "NameError: global name 'virt' is not defined" when remote libvirt mode with hypervisor = hwuuid
Summary: Show "NameError: global name 'virt' is not defined" when remote libvirt mode ...
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
high
medium
Target Milestone: rc
: 6.10
Assignee: Patrick Creech
QA Contact: Eko
URL:
Whiteboard:
Depends On:
Blocks: 1437229
TreeView+ depends on / blocked
 
Reported: 2016-12-12 03:05 UTC by Liushihui
Modified: 2018-06-19 05:23 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1437229 (view as bug list)
Environment:
Last Closed: 2018-06-19 05:21:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github virt-who virt-who pull 56 0 None None None 2017-03-17 20:21:10 UTC
Red Hat Product Errata RHBA-2018:1915 0 None None None 2018-06-19 05:23:02 UTC

Description Liushihui 2016-12-12 03:05:41 UTC
Description of problem:
When configure virt-who run at remote libvirt mode to report hwuuid to server, it will show "NameError: global name 'virt' is not defined"

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

How reproducible:
Always

Steps to Reproduce:
1. Register system to stage candlepin.

2. Configure virt-who report remote libvirt hwuuid info to stage candlepin.
[root@hp-z220-10 ~]# cat /etc/virt-who.d/virt
[libvirt]
type=libvirt
server=hp-z220-03.qe.lab.eng.nay.redhat.com
username=root
password=
owner=7970632
env=7970632
hypervisor_id=hwuuid

3. Restart virt-who and check virt-who's log
[root@hp-z220-10 ~]# service virt-who restart && tail -f /var/log/rhsm/rhsm.log
2016-12-11 21:49:11,074 [virtwho.libvirt DEBUG] Libvirtd-1(21719):MainThread @virt.py:run:363 - Virt backend 'libvirt' started
2016-12-11 21:49:11,075 [virtwho.libvirt INFO] Libvirtd-1(21719):MainThread @libvirtd.py:_get_url:125 - Protocol is not specified in libvirt url, using qemu+ssh://
2016-12-11 21:49:11,076 [virtwho.libvirt INFO] Libvirtd-1(21719):MainThread @libvirtd.py:_get_url:136 - Libvirt path is not specified in the url, using /system
2016-12-11 21:49:11,076 [virtwho.libvirt INFO] Libvirtd-1(21719):MainThread @libvirtd.py:_connect:157 - Using libvirt url: qemu+ssh://root.lab.eng.nay.redhat.com/system?no_tty=1
2016-12-11 21:49:11,430 [virtwho.libvirt ERROR] Libvirtd-1(21719):MainThread @virt.py:run:378 - Virt backend 'libvirt' fails with exception:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/virtwho/virt/virt.py", line 371, in run
    self._run()
  File "/usr/lib/python2.6/site-packages/virtwho/virt/libvirtd/libvirtd.py", line 197, in _run
    report = self._get_report()
  File "/usr/lib/python2.6/site-packages/virtwho/virt/libvirtd/libvirtd.py", line 223, in _get_report
    return HostGuestAssociationReport(self.config, self._getHostGuestMapping())
  File "/usr/lib/python2.6/site-packages/virtwho/virt/libvirtd/libvirtd.py", line 315, in _getHostGuestMapping
    host = Hypervisor(hypervisorId=self._remote_host_id(),
  File "/usr/lib/python2.6/site-packages/virtwho/virt/libvirtd/libvirtd.py", line 287, in _remote_host_id
    raise virt.VirtError(
NameError: global name 'virt' is not defined
2016-12-11 21:49:11,432 [virtwho.libvirt INFO] Libvirtd-1(21719):MainThread @virt.py:run:391 - Waiting 60 seconds before retrying backend 'libvirt'


Actual results:
Failed to send remote host's hwuuid to stage candlepin as "NameError: global name 'virt' is not defined"

Expected results:
It should send remote host's hwuuid to stage candlepin 

Additional info:
When configure virt-who send hostname/uuid(hypervisor_id=hostname/uuid) to server ,it hasn't this problem

Comment 2 Eko 2016-12-15 08:08:34 UTC
hwuuid is applicable to esx and rhevm only according to "man virt-who-config"

Comment 3 Liushihui 2016-12-16 00:23:23 UTC
According to comment2, Although hwuuid is not supported on remote libvirtd mode, it shouldn't show these error info in the log, it should show remind info like "hypervisor hwuuid is not implemented in remote libvirtd backend ". Therefore, Modify the expected result and reopen it.

Expected result:
it should show remind info like "hypervisor hwuuid is not implemented in remote libvirtd backend "

Comment 4 Chris Snyder 2017-03-20 15:03:22 UTC
Moving to POST as the fix has been merged upstream.
Also moving to RHEL 6.10 as development for 6.9 is over.

Comment 6 Jan Kurik 2017-12-06 13:00:23 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/

Comment 13 errata-xmlrpc 2018-06-19 05:21:42 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/RHBA-2018:1915


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