Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1082981 - Faild to add Hyper-V 2012 to SAM as virt-who communication with Hyper-V failed
Faild to add Hyper-V 2012 to SAM as virt-who communication with Hyper-V failed
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who (Show other bugs)
7.0
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Radek Novacek
Li Bin Liu
:
Depends On:
Blocks: 1113520
  Show dependency treegraph
 
Reported: 2014-04-01 04:55 EDT by Liushihui
Modified: 2016-11-30 19:32 EST (History)
7 users (show)

See Also:
Fixed In Version: virt-who-0.11-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 05:23:08 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
The successful transaction on HyperV2008 (34.41 KB, application/vnd.tcpdump.pcap)
2014-04-01 04:58 EDT, Liushihui
no flags Details
The error transaction on the HyperV2012 (153.02 KB, application/vnd.tcpdump.pcap)
2014-04-01 05:00 EDT, Liushihui
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0430 normal SHIPPED_LIVE Moderate: virt-who security, bug fix, and enhancement update 2015-03-05 09:52:46 EST

  None (edit)
Description Liushihui 2014-04-01 04:55:17 EDT
Description of problem:
Virt-who can't get the host/guest association in the HYPER-V mode as it connect with Hyper-V failed

Version-Release number of selected component (if applicable):
subscription-manager-1.10.14-7.el7.x86_64
python-rhsm-1.10.12-2.el7.x86_64
virt-who-0.8-12.el7.noarch

How reproducible:
Always

Test Env:
Hyper-V 2012 : 10.66.12.120
SAM server: 10.66.12.116 username/password:admin/admin

Steps to Reproduce:
1. Install a Hyper-V 2012 on a physical machine.
2. Configure Hyper-V 2012 as README.hyperv file 
 https://git.fedorahosted.org/cgit/virt-who.git/tree/README.hyperv
3. Configure virt-who run at the hyperv mode. 
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=5
VIRTWHO_HYPERV=1

VIRTWHO_HYPERV_OWNER=ACME_Corporation
VIRTWHO_HYPERV_ENV=Library
VIRTWHO_HYPERV_SERVER=10.66.12.120
VIRTWHO_HYPERV_USERNAME=administrator
VIRTWHO_HYPERV_PASSWORD=qwer1234P
4.Restart virt-who service
# systemctl restart virt-who
5.Check the http transactions which from virt-who to Hyper-V 2012
Please see it in the attachment Hyperv2012.pcap
6.Check the virt-who log in the /var/log/rhsm/rhsm.log
#tail -f /var/log/rhsm/rhsm.log

Actual results:
it can't get the host/guest mapping as the Hyper-V response 415 error message when virt-who send post request to Hyper-V 2012.

2014-04-01 15:36:25,217 [DEBUG]  @hyperv.py:165 - Hyper-V url: http://10.66.12.120:5985/wsman
2014-04-01 15:36:25,219 [DEBUG]  @hyperv.py:215 - Using NTLM authentication
2014-04-01 15:36:25,222 [DEBUG]  @hyperv.py:242 - NTLM authentication successful
2014-04-01 15:36:25,224 [ERROR]  @virt-who.py:200 - Unable to recover, retry in 5 seconds.
2014-04-01 15:36:30,229 [DEBUG]  @hyperv.py:165 - Hyper-V url: http://10.66.12.120:5985/wsman
2014-04-01 15:36:30,230 [DEBUG]  @hyperv.py:215 - Using NTLM authentication
2014-04-01 15:36:30,235 [DEBUG]  @hyperv.py:242 - NTLM authentication successful
2014-04-01 15:36:30,236 [ERROR]  @virt-who.py:197 - Error in communication with virt backend, trying to recover:
Traceback (most recent call last):
  File "/usr/share/virt-who/virt-who.py", line 191, in _send
    virtualGuests = self.virt.getHostGuestMapping()
  File "/usr/share/virt-who/hyperv.py", line 270, in getHostGuestMapping
    uuid = hypervsoap.Enumerate("select BIOSGUID from Msvm_VirtualSystemSettingData where SettingType = 3")
  File "/usr/share/virt-who/hyperv.py", line 88, in Enumerate
    response = self.post(data)
  File "/usr/share/virt-who/hyperv.py", line 68, in post
    raise HyperVException("Communication with Hyper-V failed, HTTP error: %d" % response.status)
HyperVException: Communication with Hyper-V failed, HTTP error: 415

Expected results:
Virt-who should connect to the Hyper-V successfully. it will send the correct host/guest association mapping to SAM server

Additional info:
[NOTE]: Do the same test on the Hyper-V 2008 against SAM, it hasn't this problem, please see the http transactions between virt-who and Hyper-V 2008 in the attachment Hyperv2008.pcap. Check the "http POST" packets which from virt-who to Hyper-V 2008 and Hyper-V 2012, the package contend is the same.
Comment 1 Liushihui 2014-04-01 04:58:51 EDT
Created attachment 881250 [details]
The successful transaction on HyperV2008
Comment 3 Liushihui 2014-04-01 05:00:05 EDT
Created attachment 881251 [details]
The error transaction on the HyperV2012
Comment 4 RHEL Product and Program Management 2014-04-09 01:47:53 EDT
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 5 Liushihui 2014-06-23 01:46:28 EDT
Do the same test as bug description on RHEL5u11-Server-x64-20140603.0(kvm) + HyperV2012, The bug is still exist.

Test Env:
Hyper-V 2012 : 10.66.129.161
SAM server: 10.66.129.45 username/password:admin/admin

Version-Release number of selected component (if applicable):
subscription-manager-1.11.3-5.el5
python-rhsm-1.11.3-3.el5
virt-who-0.9-4.el5

Steps to Reproduce:
1. Install a Hyper-V 2012 on a physical machine which installed Windows Server 2012 R2 Datacenter.
2. Configure Hyper-V 2012 as README.hyperv file 
 https://git.fedorahosted.org/cgit/virt-who.git/tree/README.hyperv
3. Configure virt-who run at the hyperv mode. 
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=5
VIRTWHO_HYPERV=1

VIRTWHO_HYPERV_OWNER=ACME_Corporation
VIRTWHO_HYPERV_ENV=Library
VIRTWHO_HYPERV_SERVER=10.66.129.161
VIRTWHO_HYPERV_USERNAME=administrator
VIRTWHO_HYPERV_PASSWORD=qwer1234P
4.Register system to SAM server and restart virt-who service
[root@hp-z220-03 ~]#subscription-manager register --username=admin --password=admin
[root@hp-z220-03 ~]# service virt-who restart
Stopping virt-who:                                         [FAILED]
Starting virt-who:                                         [  OK  ]
5.Check the virt-who log in the /var/log/rhsm/rhsm.log
#tail -f /var/log/rhsm/rhsm.log

2014-06-23 01:28:10,592 [WARNING]  @virt-who.py:547 - Listening for events is not available in VDSM, ESX, RHEV-M or Hyper-V mode
2014-06-23 01:28:10,750 [DEBUG]  @hyperv.py:172 - Hyper-V url: http://10.66.128.161:5985/wsman
2014-06-23 01:28:10,750 [DEBUG]  @virt-who.py:562 - Virt-who is running in hyperv mode
2014-06-23 01:28:10,751 [DEBUG]  @virt-who.py:569 - Starting infinite loop with 5 seconds interval and event handling
2014-06-23 01:28:10,755 [DEBUG]  @hyperv.py:222 - Using NTLM authentication
2014-06-23 01:28:10,867 [DEBUG]  @hyperv.py:249 - NTLM authentication successful
2014-06-23 01:28:10,931 [ERROR]  @virt-who.py:207 - Error in communication with virt backend, trying to recover:
Traceback (most recent call last):
  File "/usr/share/virt-who/virt-who.py", line 198, in _send
    virtualGuests = self.virt.getHostGuestMapping()
  File "/usr/share/virt-who/hyperv.py", line 277, in getHostGuestMapping
    uuid = hypervsoap.Enumerate("select BIOSGUID from Msvm_VirtualSystemSettingData where SettingType = 3")
  File "/usr/share/virt-who/hyperv.py", line 95, in Enumerate
    response = self.post(data)
  File "/usr/share/virt-who/hyperv.py", line 75, in post
    raise HyperVException("Communication with Hyper-V failed, HTTP error: %d" % response.status)
HyperVException: Communication with Hyper-V failed, HTTP error: 415
Comment 7 Radek Novacek 2014-09-24 03:27:45 EDT
This bug should be fixed by rebase to virt-who-0.11-1.el7.
Comment 9 Liushihui 2014-10-09 22:17:40 EDT
Verify it on virt-who-0.11-1.el7.noarch

Verified process:
Env:
Hyper-V 2012 : 10.66.128.26
SAM server: 10.66.129.124 username/password:admin/admin

Version-Release number of selected component (if applicable):
subscription-manager-1.13.3-1.el7.x86_64
python-rhsm-1.13.2.1-2.el7.x86_64
virt-who-0.11-1.el7.noarch

Steps to verify:
1. Install a Hyper-V 2012 on a physical machine which installed Windows Server 2012 R2 Datacenter.
2. Configure Hyper-V 2012 as README.hyperv file 
 https://git.fedorahosted.org/cgit/virt-who.git/tree/README.hyperv
3. Configure virt-who run at the hyperv mode. 
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=5
VIRTWHO_HYPERV=1

VIRTWHO_HYPERV_OWNER=ACME_Corporation
VIRTWHO_HYPERV_ENV=Library
VIRTWHO_HYPERV_SERVER=10.66.128.26
VIRTWHO_HYPERV_USERNAME=administrator
VIRTWHO_HYPERV_PASSWORD=qwer1234P
4.Register system to SAM server and restart virt-who service
[root@dhcp-128-2 ~]# subscription-manager register --username=admin --password=admin
The system has been registered with ID: 240e7611-6fde-451c-8a24-282dde528024 
[root@dhcp-128-2 ~]# service virt-who restart
Redirecting to /bin/systemctl restart  virt-who.service

5.Check the virt-who log in the /var/log/rhsm/rhsm.log,it hasn't show any error log, Meanwhile, the hypervisor has been registered to SAM successfully.Therefore, Verify it.

#tail -f /var/log/rhsm/rhsm.log
2014-10-10 10:11:26,595 [INFO]  @virtwho.py:442 - Using virt-who configuration: virt-who
2014-10-10 10:11:26,596 [DEBUG]  @virtwho.py:170 - Starting infinite loop with 5 seconds interval
2014-10-10 10:11:26,724 [DEBUG]  @hyperv.py:208 - Hyper-V url: http://10.66.128.26:5985/wsman
2014-10-10 10:11:26,728 [DEBUG]  @hyperv.py:258 - Using NTLM authentication
2014-10-10 10:11:26,774 [DEBUG]  @hyperv.py:285 - NTLM authentication successful
2014-10-10 10:11:26,783 [DEBUG]  @hyperv.py:325 - Error when enumerating using root/virtualization namespace, trying root/virtualization/v2 namespace
2014-10-10 10:11:26,784 [DEBUG]  @hyperv.py:258 - Using NTLM authentication
2014-10-10 10:11:26,801 [DEBUG]  @hyperv.py:285 - NTLM authentication successful
2014-10-10 10:11:26,897 [INFO]  @subscriptionmanager.py:116 - Sending update in hosts-to-guests mapping: {'60527517-6284-7593-6AAB-75BF2A6375EF': []}
2014-10-10 10:11:28,013 [INFO]  @virtwho.py:164 - Created host: 48c16a13-d920-43a2-b72a-a812b9a899db with guests: []
Comment 11 errata-xmlrpc 2015-03-05 05:23:08 EST
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/RHSA-2015-0430.html

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