Bug 1422664 - Fix vdsm-tool register
Summary: Fix vdsm-tool register
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: vdsm
Version: 4.1.0
Hardware: All
OS: Linux
medium
high
Target Milestone: ovirt-4.2.0
: 4.2.0
Assignee: Douglas Schilling Landgraf
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks: 1447881
TreeView+ depends on / blocked
 
Reported: 2017-02-15 19:29 UTC by Douglas Schilling Landgraf
Modified: 2019-05-16 13:03 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
: 1447881 (view as bug list)
Environment:
Last Closed: 2018-05-15 17:50:23 UTC
oVirt Team: Node
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:1489 0 None None None 2018-05-15 17:52:06 UTC
oVirt gerrit 73184 0 master MERGED register: _execute_http_request: adhere to cert_validation 2017-03-23 20:00:27 UTC
oVirt gerrit 74590 0 ovirt-4.0 ABANDONED register: _execute_http_request: adhere to cert_validation 2017-03-24 15:00:02 UTC
oVirt gerrit 74591 0 ovirt-4.1 MERGED register: _execute_http_request: adhere to cert_validation 2017-05-04 08:24:56 UTC

Description Douglas Schilling Landgraf 2017-02-15 19:29:09 UTC
Description of problem:

vdsm-tool provides register verb for registering the machine into Engine.
This tool is used in Node Legacy for registration and now we would like to double check it's working fine with oVirt Node Next/RHVH.

How reproducible:

Steps to Reproduce:

To trigger registration from node side execute the following:

validating engine fqdn:
===========================
# vdsm-tool register --engine-fqnd <ENGINE-FQDN> 

without validating engine fqdn (can use IP Address):
=======================================================
# vdsm-tool register --engine-fqnd <IP-Address or FQDN> --check-fqdn False

Log is available in the host: /var/log/vdsm/register.log

After registration, user must approve the node via oVirt Engine Admin
or API/Rest API.

There are others options in the tool, fell free to test.

Comment 2 Ying Cui 2017-02-16 09:27:20 UTC
Checking the target milestone, it is set to ovirt-4.2.0, no build yet, so moving the bug to MODIFIED.

Comment 3 Dan Kenigsberg 2017-02-16 11:35:34 UTC
Sandro, I believe that this is equally possible in 4.1 (and 4.0), and can be tested immediately. Can we move it to 4.1?

Comment 4 dguo 2017-02-20 07:26:23 UTC
Since we focus on the registration for rhvh, We need to clarify the test scope about this bug,

we only need to cover #vdsm-tool register --engine-fqdn ... and 
#vdsm-tool register --engine-fqnd <IP-Address or FQDN> --check-fqdn False
 
not all vdsm-tools commands, right?

Comment 5 dguo 2017-02-21 10:40:15 UTC
I tested on the latest rhvh-4.1-0.20170208.0+1, there is error below. And will wait for next build

[root@dhcp-8-140 ~]# imgbase w
[INFO] You are on rhvh-4.1-0.20170208.0+1
[root@dhcp-8-140 ~]# vdsm-tool register --engine-fqdn rhvm41-vlan50-1.lab.eng.pek2.redhat.com
Starting registration...
Host UUID: 44454C4C-5700-1038-8047-B3C04F4D3258
Collecting CA data from Engine...
Cannot connect to engine. rhvm41-vlan50-1.lab.eng.pek2.redhat.com matches the FQDN of Engine?
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 458, in main
    reg.download_ca()
  File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 291, in download_ca
    cert_validation=False)
  File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 209, in _execute_http_request
    res = requests.get("{u}".format(u=url), verify=cert_validation)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 69, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 50, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 431, in send
    raise SSLError(e, request=request)
SSLError: [Errno 2] No such file or directory

Comment 6 cshao 2017-02-21 10:46:34 UTC
(In reply to dguo from comment #4)
> Since we focus on the registration for rhvh, We need to clarify the test
> scope about this bug,
> 
> we only need to cover #vdsm-tool register --engine-fqdn ... and 
> #vdsm-tool register --engine-fqnd <IP-Address or FQDN> --check-fqdn False
>  
> not all vdsm-tools commands, right?

Got confirmed from PM and dev, QE only need to focus on bug description testing, do not need to test others options.

Comment 7 dguo 2017-02-22 03:41:41 UTC
The fqdn had been resolved by /etc/hosts, and can be ping successful
[root@dhcp-8-140 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.73.75.218 rhvm41-vlan50-1.lab.eng.pek2.redhat.com

[root@dhcp-8-140 ~]# ping rhvm41-vlan50-1.lab.eng.pek2.redhat.com
PING rhvm41-vlan50-1.lab.eng.pek2.redhat.com (10.73.75.218) 56(84) bytes of data.
64 bytes from rhvm41-vlan50-1.lab.eng.pek2.redhat.com (10.73.75.218): icmp_seq=1 ttl=60 time=0.871 ms
64 bytes from rhvm41-vlan50-1.lab.eng.pek2.redhat.com (10.73.75.218): icmp_seq=2 ttl=60 time=0.912 ms
64 bytes from rhvm41-vlan50-1.lab.eng.pek2.redhat.com (10.73.75.218): icmp_seq=3 ttl=60 time=0.931 ms


And tried another command, also caught failure:
[root@dhcp-8-140 ~]# vdsm-tool register --engine-fqdn 10.73.75.218 --check-fqdn False
Starting registration...
Host UUID: 44454C4C-5700-1038-8047-B3C04F4D3258
Collecting CA data from Engine...
Calculated fingerprint: 56:11:f0:21:05:e5:03:5b:86:c8:a1:43:b7:36:78:ac:0c:07:32:b1
Collecting ssh pub key data...
Cannot connect to engine. 10.73.75.218 matches the FQDN of Engine?
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 460, in main
    reg.execute_registration()
  File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 358, in execute_registration
    self._execute_http_request(self.url_reg)
  File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 212, in _execute_http_request
    "http response was non OK, code {r}".format(r=res.status_code)
RequestException: http response was non OK, code 400


So change this bug status to Assigned

Comment 16 dguo 2017-11-08 10:05:54 UTC
Verified on latest build rhvh-4.2-0.20171102.0

Test versions:
redhat-release-virtualization-host-4.2-0.4.el7.x86_64
RHVM: 4.2.0-0.4.master.el7
vdsm-4.20.6-1.el7ev.x86_64

Test steps:
1. Install rhvh via pxe
2. Register to engine by following two methods
# vdsm-tool register --engine-fqdn rhvm42-vlan50-1.lab.eng.pek2.redhat.com
# vdsm-tool register --engine-fqdn 10.73.75.137 --check-fqdn False
3. Check host is in pending approval status on rhvm
4. Approve the host to be added to existing datacenter

Results:
1. After step#2 with the two methods, the host is in pending approval status
2. After step#4, host status is up

Thus, this can be changed to verified according to above result

Comment 22 errata-xmlrpc 2018-05-15 17:50:23 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/RHEA-2018:1489

Comment 23 Franta Kust 2019-05-16 13:03:45 UTC
BZ<2>Jira Resync


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