Tendrl / node-agent

A python agent local to every managed storage node in the sds cluster
GNU Lesser General Public License v2.1
4 stars 14 forks source link

fqdn field of .clusters.nodes reply doesn't always contain fqdn #863

Open mbukatov opened 5 years ago

mbukatov commented 5 years ago

fqdn field of .clusters.nodes Tendrl API reply doesn't always contain fqdn.

Version of Tendrl

1.6.3

Steps to Reproduce

  1. Prepare gluster trusted storage pool via gdeploy, and specify some nodes via ip address, some via short hostname and some via fqdn
  2. Check result of gluster pool list and note that Hostname column of each node contains either ip address, short name or fqdn.
  3. Import the cluster into Tendrl
  4. Save json part of response to /api/1.0/clusters REST API call
  5. Check fqdn provided by the response via jq '.clusters[0].nodes[].fqdn' reply.json

Actual results

This is what gluster reports:

# gluster pool list
UUID                    Hostname                                        State
8d04e1ea-706e-4af5-90d4-680a5acdc07f    10.37.169.168                                   Connected 
1343b399-2201-4ca6-ae52-90a3301202e7    10.37.169.174                                   Connected 
d60f0df1-ea6a-493b-9628-7060329b678e    mbukatov-usm2-gl2                               Connected 
d0e0f425-a252-40b7-bbf3-2576f90913cb    mbukatov-usm2-gl4.example.com          Connected 
4a892af6-d7ef-4264-979e-3c3cbd935ec6    mbukatov-usm2-gl5                               Connected 
07ad3a80-3f3e-4770-ad69-e46c17d98d7e    localhost                                                  Connected

And this is the fqdn provided by Tendrl REST API:

$ jq '.clusters[0].nodes[].fqdn' reply.json
"10.37.169.168"
"mbukatov-usm2-gl1"
"mbukatov-usm2-gl5"
"mbukatov-usm2-gl4.example.com"
"10.37.169.174"
"mbukatov-usm2-gl2

Expected results

Either provide fqdn in the field, or rename the field to something else. This depends on the purpose of the field and how it's actually used by Tendrl web ui.

Note that fixing this without coordination with ui will likely break web ui of Tendrl.

mbukatov commented 5 years ago

The data comes from /nodes/UUID/NodeContext/fqdn:

[root@mbukatov-usm1-server ~]#  etcdctl --ca-file /etc/pki/tls/certs/ca-usmqe.crt --cert-file /etc/pki/tls/certs/etcd.crt --key-file /etc/pki/tls/private/etcd.key --endpoints https://${HOSTNAME}:2379 ls /nodes | xargs -I'{}'  etcdctl --ca-file /etc/pki/tls/certs/ca-usmqe.crt --cert-file /etc/pki/tls/certs/etcd.crt --key-file /etc/pki/tls/private/etcd.key --endpoints https://${HOSTNAME}:2379 get '{}'/NodeContext/fqdn
10.37.169.35
10.37.169.62
mbukatov-usm1-gl5
mbukatov-usm1-gl1.example.com
mbukatov-usm1-gl2
mbukatov-usm1-gl4.example.com