Douglas Schilling Landgraf has posted comments on this change.
Change subject: vdsm-tool: Add register verb
......................................................................
Patch Set 11: Verified+1
I have verified the patch in 3 ways below, after all patches merged, I will
write a ovirt wiki feature page with all data about the new registration schema.
Starting the tool via TUI (patch in the commit msg), using the autoreg (replace
for vdsm-config, patch in commit) and manually. All worked and generated the
log in /var/log/vdsm/register.log
Real example:
Engine FQDN: engine.localdomain Engine IP: 192.168.122.166
# vdsm-tool register --engine-fqdn engine.localdomain
Identifying the registration protocol...
Registration procotol selected: service
Host UUID: EC3B64C0-6ADA-4F83-9F89-1960630BE95C
Collecting CA data from Engine...
Calculated fingerprint:
61:95:a7:c1:e8:3a:f0:b3:cc:dd:51:6d:f2:f1:f5:f3:c7:57:67:42
Collecting ssh pub key data...
Registration completed, host is pending approval on Engine: engine.localdomain
############ TEST 2
# vdsm-tool register --engine-fqdn 192.168.122.166
Identifying the registration protocol...
Registration procotol selected: service
Host UUID: EC3B64C0-6ADA-4F83-9F89-1960630BE95C
Collecting CA data from Engine...
Calculated fingerprint:
61:95:a7:c1:e8:3a:f0:b3:cc:dd:51:6d:f2:f1:f5:f3:c7:57:67:42
Collecting ssh pub key data...
Cannot connect to engine. 192.168.122.166 matches the FQDN of Engine?
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 485, in
main
reg.download_ssh()
File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 365, in
download_ssh
res = self._execute_http_request(self.url_ssh_key)
File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 221, 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 55, in get
return request('get', url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 288, in
request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify,
cert=cert, proxies=proxies)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 383, in
send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 213, in
send
raise SSLError(e)
SSLError: hostname '192.168.122.166' doesn't match u'engine.localdomain'
######## TEST 3
# vdsm-tool register --engine-fqdn 192.168.122.166 --check-fqdn false
Identifying the registration protocol...
Registration procotol selected: service
Host UUID: EC3B64C0-6ADA-4F83-9F89-1960630BE95C
Collecting CA data from Engine...
Calculated fingerprint:
61:95:a7:c1:e8:3a:f0:b3:cc:dd:51:6d:f2:f1:f5:f3:c7:57:67:42
Collecting ssh pub key data...
Registration completed, host is pending approval on Engine: 192.168.122.166
########### TEST 4
# vdsm-tool register --engine-fqdn 192.168.122.166 --check-fqdn false
--ssh-user root
Identifying the registration protocol...
Registration procotol selected: service
Host UUID: EC3B64C0-6ADA-4F83-9F89-1960630BE95C
Collecting CA data from Engine...
Calculated fingerprint:
61:95:a7:c1:e8:3a:f0:b3:cc:dd:51:6d:f2:f1:f5:f3:c7:57:67:42
Collecting ssh pub key data...
Registration completed, host is pending approval on Engine: 192.168.122.166
####### TEST 5
# vdsm-tool register --engine-fqdn engine.localdomain --engine-https-port 5555
Identifying the registration protocol...
Registration procotol selected: service
Host UUID: EC3B64C0-6ADA-4F83-9F89-1960630BE95C
Collecting CA data from Engine...
Calculated fingerprint:
61:95:a7:c1:e8:3a:f0:b3:cc:dd:51:6d:f2:f1:f5:f3:c7:57:67:42
Collecting ssh pub key data...
Cannot connect to engine. engine.localdomain matches the FQDN of Engine?
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 485, in
main
reg.download_ssh()
File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 365, in
download_ssh
res = self._execute_http_request(self.url_ssh_key)
File "/usr/lib/python2.7/site-packages/vdsm/tool/register.py", line 221, 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 55, in get
return request('get', url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 288, in
request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify,
cert=cert, proxies=proxies)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 383, in
send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 206, in
send
raise ConnectionError(sockerr)
ConnectionError: [Errno 113] No route to host
#### TEST 6
vdsm-tool register --engine-fqdn 192.168.122.166 --check-fqdn false --ssh-user
root --vdsm-port 5555
* Command sent to engine usind 5555 as VDSM PORT:
https://192.168.122.166/ovirt-engine/services/host-register?version=1&command=register&name=node&address=node.localdomain&sshUser=root&sshPort=22&port=5555&uniqueId=EC3B64C0-6ADA-4F83-9F89-1960630BE95C
##### TEST 7
vdsm-tool register --engine-fqdn engine.localdomain --ssh-user root --ssh-port
444
register.log
==============
5/19/2015 05:10:30 PM =======================================
05/19/2015 05:10:30 PM Registering the node
05/19/2015 05:10:30 PM =======================================
<snip>
05/19/2015 05:10:30 PM SSH User: root
05/19/2015 05:10:30 PM SSH Port: 444
</snip>
##### TEST 8 (autoreg)
Using auto install script that is called during ovirt-node boot
# python autoreg.py
<node appear to be approved in ENGINE>
##### TEST 9 (autoreg)
Providing only management_server_fingerprint
# python autoreg.py
To use management_server_fingerprint is required to set management_server key
too!
###### TEST 10 (autoreg)
Proving wrong fingerprint
# python autoreg.py
autoinstall: vdsm-tool register command FAILED!
Full log: /var/log/vdsm/register.log
cat /var/log/vdsm/register.log
<snip>
RuntimeError: The fingeprints doesn't match:
Calculated fingerprint:
[61:95:a7:c1:e8:3a:f0:b3:cc:dd:51:6d:f2:f1:f5:f3:c7:57:67:42]
Attribute fingerprint:
[161:95:a7:c1:e8:3a:f0:b3:cc:dd:51:6d:f2:f1:f5:f3:c7:57:67:42]
####### TEST 11 (TUI)
Everything worked as expected and node appear in Engine much faster.
--
To view, visit https://gerrit.ovirt.org/40966
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ica800027beec1e5a20165bb5e1e78baf9283c1da
Gerrit-PatchSet: 11
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: No
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches