Bug 1447881 - [downstream clone - 4.1.3] Fix vdsm-tool register
Summary: [downstream clone - 4.1.3] 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.1.3
: ---
Assignee: Douglas Schilling Landgraf
QA Contact: dguo
URL:
Whiteboard:
Depends On: 1422664
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-04 06:56 UTC by rhev-integ
Modified: 2019-04-28 13:42 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1422664
Environment:
Last Closed: 2017-07-06 07:32:08 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-2017:1696 0 normal SHIPPED_LIVE VDSM bug fix and enhancement update 4.1.3 2017-07-06 11:25:09 UTC
oVirt gerrit 73184 0 master MERGED register: _execute_http_request: adhere to cert_validation 2017-05-04 06:58:19 UTC
oVirt gerrit 74590 0 ovirt-4.0 ABANDONED register: _execute_http_request: adhere to cert_validation 2017-05-04 06:58:19 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 rhev-integ 2017-05-04 06:56:43 UTC
+++ This bug is a downstream clone. The original bug is: +++
+++   bug 1422664 +++
======================================================================

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.

(Originally by dougsland)

Comment 3 rhev-integ 2017-05-04 06:56:58 UTC
Checking the target milestone, it is set to ovirt-4.2.0, no build yet, so moving the bug to MODIFIED.

(Originally by Ying Cui)

Comment 4 rhev-integ 2017-05-04 06:57:04 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?

(Originally by danken)

Comment 5 rhev-integ 2017-05-04 06:57:09 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?

(Originally by Daijie Guo)

Comment 6 rhev-integ 2017-05-04 06:57:14 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

(Originally by Daijie Guo)

Comment 7 rhev-integ 2017-05-04 06:57:21 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.

(Originally by Chen Shao)

Comment 8 rhev-integ 2017-05-04 06:57:27 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

(Originally by Daijie Guo)

Comment 16 rhev-integ 2017-05-05 09:26:03 UTC
INFO: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[TAG 'v4.19.12' DOESN'T CONTAIN PATCH 'https://gerrit.ovirt.org/74591']
gitweb: https://gerrit.ovirt.org/gitweb?p=vdsm.git;a=shortlog;h=refs/tags/v4.19.12

For more info please contact: rhv-devops

Comment 18 dguo 2017-06-02 03:25:47 UTC
Just verified on rhvh-4.1-0.20170531.0+1


[root@dhcp-9-52 ~]# imgbase w
2017-06-01 23:20:11,145 [INFO] You are on rhvh-4.1-0.20170531.0+1
[root@dhcp-9-52 ~]# rpm -q vdsm
vdsm-4.19.17-1.el7ev.x86_64


Test below scenarios:

[root@dhcp-9-52 ~]# vdsm-tool register --engine-fqdn rhvm41-vdsm-auto.lab.eng.pek2.redhat.com
Starting registration...
Host UUID: 44454C4C-5700-1038-8047-B3C04F4D3258
Collecting CA data from Engine...
Calculated fingerprint: 12:f4:98:49:49:ff:0e:46:66:cd:52:02:f6:be:81:58:95:59:11:9d
Collecting ssh pub key data...
Registration completed, host is pending approval on Engine: rhvm41-vdsm-auto.lab.eng.pek2.redhat.com


[root@dhcp-9-52 ~]# vdsm-tool register --engine-fqdn 10.73.75.48 --check-fqdn False
Starting registration...
Host UUID: 44454C4C-5700-1038-8047-B3C04F4D3258
Collecting CA data from Engine...
Calculated fingerprint: 12:f4:98:49:49:ff:0e:46:66:cd:52:02:f6:be:81:58:95:59:11:9d
Collecting ssh pub key data...
Registration completed, host is pending approval on Engine: 10.73.75.48

[root@dhcp-9-52 ~]# vdsm-tool register --engine-fqdn rhvm41-vdsm-auto.lab.eng.pek2.redhat.com --check-fqdn False
Starting registration...
Host UUID: 44454C4C-5700-1038-8047-B3C04F4D3258
Collecting CA data from Engine...
Calculated fingerprint: 12:f4:98:49:49:ff:0e:46:66:cd:52:02:f6:be:81:58:95:59:11:9d
Collecting ssh pub key data...
Registration completed, host is pending approval on Engine: rhvm41-vdsm-auto.lab.eng.pek2.redhat.com

Comment 20 errata-xmlrpc 2017-07-06 07:32:08 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-2017:1696


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