Bug 2152221

Summary: virt-who for RHV
Product: Red Hat Satellite Reporter: Donald Berry <dberry>
Component: Virt-who Configure PluginAssignee: satellite6-bugs <satellite6-bugs>
Status: NEW --- QA Contact: yanpliu <yanpliu>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 6.11.0CC: bangelic, chrobert, lufu
Target Milestone: UnspecifiedKeywords: Documentation, Triaged
Target Release: UnusedFlags: mdolezel: needinfo? (bangelic)
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2165774    

Description Donald Berry 2022-12-09 19:57:35 UTC
Document URL:

Configuring Virtual Machine Subscriptions in Red Hat Satellite
https://access.redhat.com/documentation/en-us/red_hat_satellite/6.11/html/configuring_virtual_machine_subscriptions_in_red_hat_satellite/index

Section Number and Name: 

Describe the issue: 
The entire procedure for RHV is wrong.
- you do not need to create a user
- you do not need to create a config on the Satellite
- the suggested config (Chapter 4. Creating a virt-who Configuration) doesn't work

Suggestions for improvement: 

- create config on hypervisor with just the header:
# echo [$(hostname)] > /etc/virt-who.d/rhv.conf
- systemctl enable virt-who
- systemctl start virt-who

Additional information: 

Using the suggested config doesn't work:

[root@sat6 ~]# for i in {1..6}; do hammer virt-who-config create --name rdu$i --organization tamlab --interval 1440 --filtering-mode none --hypervisor-id hostname --hypervisor-type libvirt --hypervisor-server dell-r640-0$i.rhvmgmt.tamlab.rdu2.redhat.com --hypervisor-username virt-who --satellite-url sat6.tamlab.rdu2.redhat.com; done
Virt Who configuration [rdu1] created
Virt Who configuration [rdu2] created
Virt Who configuration [rdu3] created
Virt Who configuration [rdu4] created
Virt Who configuration [rdu5] created
Virt Who configuration [rdu6] created

[dberry@t580 ~]$ scp Downloads/deploy_virt_who_config_15.sh root.rdu2.redhat.com:

[root@dell-r640-01 ~]# sh deploy_virt_who_config_15.sh
...
== Finished ==
Finished successfully

[root@dell-r640-01 ~]# cat /etc/virt-who.d/virt-who-config-15.conf 
### This configuration file is managed via the virt-who configure plugin
### manual edits will be deleted.
[virt-who-config-15]
type=libvirt
hypervisor_id=hostname
owner=tamlab

server=dell-r640-01.rhvmgmt.tamlab.rdu2.redhat.com
username=virt-who
encrypted_password=4839cf299139e2dba40695f5843dbff2bd9279623ed4ed68b4eb62cee382d9e6
rhsm_hostname=sat6.tamlab.rdu2.redhat.com
rhsm_username=virt_who_reporter_15
rhsm_encrypted_password=35d4fa8da56129bb05d628bb8041ad07300055e7dc50192d60da9f26958dc5ba
rhsm_prefix=/rhsm

/var/log/rhsm/rhsm.log:
2022-12-08 14:06:53,550 [INFO] @main.py:176 - Using configuration "virt-who-config-15" ("libvirt" mode)
2022-12-08 14:06:53,550 [INFO] @main.py:178 - Using reporter_id='dell-r640-01.tamlab.rdu2.redhat.com-9b5ee8f2693649428dc51b921d720a8b'
2022-12-08 14:06:53,563 [INFO] @libvirtd.py:280 - Using libvirt url: qemu+ssh://virt-who.tamlab.rdu2.redhat.com/system?no_tty=1
2022-12-08 14:06:53,807 [ERROR] @libvirtd.py:288 - Error in libvirt backend
libvirtError: Cannot recv data: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).: Connection reset by peer
2022-12-08 14:06:53,808 [ERROR] @virt.py:416 - Thread 'virt-who-config-15' fails with error: Cannot recv data: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).: Connection reset by peer

There is an article, but it needs to be updated (rhevm is no longer supported, vdsm is removed):

Consolidated Troubleshooting Article for Virt-who and Virtual Datacenter (VDC) Subscriptions Issues
https://access.redhat.com/articles/6463781

That article has links to the four solutions, but only one of them is correct:

How to configure virt-who in VDSM mode to work with RHEL-H or RHV-H?
https://access.redhat.com/solutions/2162051

"Ensure that the virt-who configuration looks as displayed below i.e. no specific type set so that It can use the default type as libvirt"

Also the link to the docs (6.2) in this KCS is broken
https://access.redhat.com/articles/2884051

I don't want to update the article or the four solutions since I am not familiar enough with the various backends (i.e. when were vdsm and rhevm removed).