Problem:
Trying to install virt-who for RHEL subscription / ESXi Host management. This functionality is critical to my needs. This is long and painful, I’m sorry in advance but I’m at the end of my rope with this.
Couple of problems:
First Problem, virt-who version out of date
- Installed “tfm-rubygem-foreman_virt_who_configure” (mislabeld in documentation btw) plugin for Foreman (1.22) / Katello (3.12).
- Restarted Foreman, plugin shows up in menu as expected.
- Use plugin to create a virt-who entry for my vSphere (Version 6.5.0.20000 Build 9451637), submit entry, click “Deploy” tab.
- hammer virt-who module not installed, monkeyed with this for a while, so many broken things with the hammer virt-who configure module. Abandon hammer module completely to use deploy script.
- Cut/Paste deploy script, execute deploy script.
- Script installs virt-who (0.22.5) rpm from CentOS Base (7.6) repository which is out of date and the script says 0.24.2 is minimal virt-who version.
- Have to engage in quest to install correct version of virt-who, which is in the RHEL satellite-tools repo now. I don’t have access to this repo through my RHEL subscriptions because we don’t have a Satellite subscription (or I’d be using Satellite).
- This is the end of the first problem, the version that the plugin tries to install is out of date and incompatible. I know this should probably go to the plugin maintainer, but my real issue is my next problem:
Second Problem : Can’t get github versions of virt-who to work - NOTE, I realize that this should also go to virt-who author/maintainer, but read to the end, I eventually get the latest version to run but it fails connecting to rhsm because it says rhsm is missing an attribute.
- Find virt-who project/source on github.
- clone git repo
- install deps (pip install -r requirements.txt, yum-builddep virt-who.spec)
- attempt to run “make rpm” which fails because python2-pyyaml isn’t found because this script expects python-pyyaml which is deprecated. Try to kludge this, get sick of python bullshit.
- abandon rpm plan to trick deploy script
- just compile a binary from the source with “make DESTDIR=/usr install” as per the README.md.
- compiles just fine, wheee!!
- test virt-who with “one-shot” to make sure my config file at least works, it doesn’t. Apparently the plugin adds a line to the virt-who config file for “env=Library” which is no longer compatible with the current version of virt-who, so I just commented that line out.
- “virt-who -d -o” again, logs show it connected to my vSphere server, had a couple complains about a couple hosts missing some attribute (thats fine), seems to finish its data collection, then tries to upload that data to the rhsm instance (foreman) and fails because of a missing attribute.
"AttributeError: 'UEPConnection' object has no attribute 'hypervisorHeartbeat'"
- Get pissed. Try to download the virt-who that the deploy script said was the minimum supported version, 0.24.2.
- 0.24.2 compiles fine, need to re-add “env=Library” to config for this version to work
- 0.24-2 seems to one-shot ok, debug log shows a 200 for POSTing the data to rhsm, yet no data ever shows up in Foreman.
- Attempt to start virt-who 0.24.2 service, it just hangs and eventually systemd times it out :
# systemctl status virt-who.service -l
● virt-who.service - Daemon for reporting virtual guest IDs to subscription-manager
Loaded: loaded (/usr/lib/systemd/system/virt-who.service; enabled; vendor preset: disabled)
Active: failed (Result: timeout) since Thu 2019-08-15 09:15:32 EDT; 1min 7s ago
Process: 25555 ExecStart=/usr/bin/virt-who (code=exited, status=0/SUCCESS)
Main PID: 25555 (code=exited, status=0/SUCCESS)
Aug 15 09:14:01 FOREMANFQDN systemd[1]: Starting Daemon for reporting virtual guest IDs to subscription-manager...
Aug 15 09:15:31 FOREMANFQDN systemd[1]: virt-who.service start operation timed out. Terminating.
Aug 15 09:15:32 FOREMANFQDN systemd[1]: Failed to start Daemon for reporting virtual guest IDs to subscription-manager.
Aug 15 09:15:32 FOREMANFQDN systemd[1]: Unit virt-who.service entered failed state.
Aug 15 09:15:32 FOREMANFQDN systemd[1]: virt-who.service failed.
- Now, I don’t much care about the old version hanging, I’m much more interested in using the current build of virt-who with Foreman. (full log below) and am seeking help on making that happen. So, my issue is using the most current virt-who, when it tries to send that data to rhsm, it fails because it’s reporting that some object is missing an attribute. This is what seems to be needing attention. Or, if someone can tell me which release of virt-who is currently working with Foreman 1.22, I’d be happy to just use that.
Expected outcome:
virt-who runs, posts data to rhsm and hosts/guests are imported into Foreman.
Foreman and Proxy versions:
Installed Packages
Name : foreman
Arch : noarch
Version : 1.22.0
Release : 1.el7
Size : 157 M
Repo : installed
From repo : foreman
Summary : Systems Management web application
URL : https://theforeman.org
License : GPLv3+ with exceptions
Description : Foreman is aimed to be a Single Address For All Machines Life Cycle Management.
: Foreman is based on Ruby on Rails, and this package bundles Rails and all
: plugins required for Foreman to work.
Name : katello
Arch : noarch
Version : 3.12.2
Release : 1.el7
Size : 397
Repo : installed
From repo : katello
Summary : A package for managing application life-cycle for Linux systems
URL : https://theforeman.org/plugins/katello
License : GPLv2
Description : Provides a package for managing application life-cycle for Linux systems.
Foreman and Proxy plugin versions:
Installed Packages
Name : tfm-rubygem-foreman_virt_who_configure
Arch : noarch
Version : 0.4.1
Release : 1.fm1_22.el7
Size : 21 M
Repo : installed
From repo : katello
Summary : A plugin to make virt-who configuration easy
URL : https://github.com/theforeman/foreman_virt_who_configure
License : GPLv3
Description : A plugin to make virt-who configuration easy.
Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)
This is the /var/log/rhsm/rhsm.log from running virt-who 0.25.4-1 “one-shot” from the command line, I replaced my servername with FOREMANFQDN:
# cat rhsm.log
2019-08-15 09:23:56,747 [virtwho.config ERROR] MainProcess(26645):MainThread @config.py:parse_file:421 - Unable to read configuration file /etc/virt-who.conf
2019-08-15 09:23:56,751 [virtwho.rhsm_log DEBUG] MainProcess(26645):MainThread @config.py:init_config:1550 - [global]: Value for "interval" not set, using default: 3600
2019-08-15 09:23:56,751 [virtwho.rhsm_log DEBUG] MainProcess(26645):MainThread @config.py:init_config:1550 - [global]: Value for "log_per_config" not set, using default: False
2019-08-15 09:23:56,751 [virtwho.rhsm_log DEBUG] MainProcess(26645):MainThread @config.py:init_config:1550 - [global]: Value for "print_" not set, using default: False
2019-08-15 09:23:56,752 [virtwho.rhsm_log DEBUG] MainProcess(26645):MainThread @config.py:init_config:1550 - [global]: Value for "reporter_id" not set, using default: bsdv4vlcm01.ilnx.com-43860f2762b4429fa7b7ae8d0fa2b2b6
2019-08-15 09:23:56,752 [virtwho.rhsm_log DEBUG] MainProcess(26645):MainThread @config.py:init_config:1550 - [global]: Value for "log_dir" not set, using default: /var/log/rhsm
2019-08-15 09:23:56,752 [virtwho.rhsm_log DEBUG] MainProcess(26645):MainThread @config.py:init_config:1550 - [global]: Value for "configs" not set, using default: []
2019-08-15 09:23:56,752 [virtwho.rhsm_log DEBUG] MainProcess(26645):MainThread @config.py:init_config:1550 - [global]: Value for "log_file" not set, using default: rhsm.log
2019-08-15 09:23:56,752 [virtwho.rhsm_log DEBUG] MainProcess(26645):MainThread @config.py:init_config:1550 - [virt-who-config-1]: Value for "simplified_vim" not set, using default: True
2019-08-15 09:23:56,753 [virtwho.rhsm_log INFO] MainProcess(26645):MainThread @executor.py:__init__:54 - Using config named 'virt-who-config-1'
2019-08-15 09:23:56,753 [virtwho.rhsm_log INFO] MainProcess(26645):MainThread @main.py:main:162 - Using configuration "virt-who-config-1" ("esx" mode)
2019-08-15 09:23:56,753 [virtwho.rhsm_log INFO] MainProcess(26645):MainThread @main.py:main:164 - Using reporter_id='FOREMANFQDN-43860f2762b4429fa7b7ae8d0fa2b2b6'
2019-08-15 09:23:56,762 [rhsm.https DEBUG] MainProcess(26645):MainThread @https.py:<module>:56 - Using standard libs to provide httplib and ssl
2019-08-15 09:23:56,776 [virtwho.main DEBUG] MainProcess(26645):Thread-2 @virt.py:run:407 - Thread 'virt-who-config-1' started
2019-08-15 09:23:56,776 [virtwho.main DEBUG] MainProcess(26645):Thread-2 @esx.py:_prepare:130 - Log into ESX
2019-08-15 09:23:57,256 [virtwho.main DEBUG] MainProcess(26645):Thread-2 @esx.py:_prepare:133 - Creating ESX event filter
2019-08-15 09:24:03,921 [virtwho.main DEBUG] MainProcess(26645):Thread-2 @esx.py:getHostGuestMapping:270 - Host 'host-2942' doesn't have hypervisor_id property
2019-08-15 09:24:03,927 [virtwho.main DEBUG] MainProcess(26645):Thread-2 @esx.py:getHostGuestMapping:270 - Host 'host-3092' doesn't have hypervisor_id property
2019-08-15 09:24:03,938 [virtwho.main INFO] MainProcess(26645):Thread-2 @virt.py:_send_data:982 - Report for config "virt-who-config-1" gathered, placing in datastore
2019-08-15 09:24:04,180 [virtwho.main DEBUG] MainProcess(26645):Thread-2 @virt.py:run:435 - Thread 'virt-who-config-1' stopped after running once
2019-08-15 09:24:04,801 [rhsm.connection INFO] MainProcess(26645):Thread-3 @connection.py:__init__:871 - Connection built: host=FOREMANFQDN port=443 handler=/rhsm auth=basic username=virt_who_reporter_1
2019-08-15 09:24:04,796 [virtwho.destination_-5163520369811620371 DEBUG] MainProcess(26645):Thread-3 @virt.py:run:407 - Thread 'destination_-5163520369811620371' started
2019-08-15 09:24:04,802 [rhsm.connection DEBUG] MainProcess(26645):Thread-3 @connection.py:_request:545 - Making request: GET /rhsm/status/
2019-08-15 09:24:04,798 [virtwho.destination_-5163520369811620371 DEBUG] MainProcess(26645):Thread-3 @subscriptionmanager.py:_connect:144 - Authenticating with RHSM username virt_who_reporter_1
2019-08-15 09:24:04,798 [virtwho.destination_-5163520369811620371 INFO] MainProcess(26645):Thread-3 @subscriptionmanager.py:_connect:155 - X-Correlation-ID: 72623b873be3439186e05fd6e1a463ac
2019-08-15 09:24:04,912 [rhsm.connection INFO] MainProcess(26645):Thread-3 @connection.py:_request:588 - Response: status=200, request="GET /rhsm/status/"
2019-08-15 09:24:04,914 [virtwho.destination_-5163520369811620371 ERROR] MainProcess(26645):Thread-3 @virt.py:run:421 - Thread 'destination_-5163520369811620371' fails with exception:
Traceback (most recent call last):
File "virtwho/virt/virt.py", line 412, in run
self._run()
File "virtwho/virt/virt.py", line 368, in _run
self._send_data(data_to_send)
File "virtwho/virt/virt.py", line 604, in _send_data
self.dest.hypervisorHeartbeat(config=self.config, options=self.options)
File "virtwho/manager/subscriptionmanager/subscriptionmanager.py", line 265, in hypervisorHeartbeat
result = connection.hypervisorHeartbeat(config['owner'], named_options)
AttributeError: 'UEPConnection' object has no attribute 'hypervisorHeartbeat'
2019-08-15 09:24:04,915 [virtwho.destination_-5163520369811620371 INFO] MainProcess(26645):Thread-3 @virt.py:_send_data:615 - Error report received
2019-08-15 09:24:04,915 [virtwho.destination_-5163520369811620371 DEBUG] MainProcess(26645):Thread-3 @virt.py:run:435 - Thread 'destination_-5163520369811620371' stopped after running once
2019-08-15 09:24:05,799 [virtwho.main DEBUG] MainProcess(26645):MainThread @__main__.py:main:25 - virt-who terminated
2019-08-15 09:24:05,800 [virtwho.main DEBUG] MainProcess(26645):MainThread @executor.py:terminate:225 - virt-who is shutting down
#