Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
CORTX-33705: confd and ios ports are not aligned with cluster
Browse files Browse the repository at this point in the history
Problem:
The confd and ios Port information in hctl status is not matching with
cluster.conf in both Both basic Linux and K8s

In basic Linux, ios Port in hctl status is 21003 instead of 21001
(as per cluster.conf). And in K8s, both confd and ios Port are not matching
with cluster.conf

Solution:
Modified ios and confd port info to fetch default port.
For K8s, just by changing order in m0serverT list fixes this issue. But to fix
in basic Linux, updated the default ports and avoid rounding off to fetch
actual ports from cluster.conf.

Signed-off-by: pavankrishnat <pavan.k.thunuguntla@seagate.com>
  • Loading branch information
pavankrishnat committed Aug 23, 2022
1 parent f8eaf12 commit 41575f3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
28 changes: 14 additions & 14 deletions cfgen/cfgen
Original file line number Diff line number Diff line change
Expand Up @@ -1001,15 +1001,15 @@ class m0ProcT(Enum):


class PortalGroup(Enum):
hax = 22000
hax = 22001
m0_server = [{'name': 'confd', 'port': m0ProcT.confd},
{'name': 'ios', 'port': m0ProcT.ios}]
m0_client_s3 = 22500
m0_client_other = [{'name': 'default', 'port': 22500}]
m0_client_s3 = 22501
m0_client_other = [{'name': 'default', 'port': 22501}]


class Portals:
def __init__(self, hax=22000,
def __init__(self, hax=22001,
m0_server=[{'name': 'confd', 'port': m0ProcT.confd},
{'name': 'ios', 'port': m0ProcT.ios}],
m0_client_s3=22500,
Expand All @@ -1033,27 +1033,27 @@ def get_lnet_portal_group(
m0_client_s3=3,
m0_client_other=[]
) -> Portals:
protal_group = Portals(hax=hax, m0_server=m0_server,
portal_group = Portals(hax=hax, m0_server=m0_server,
m0_client_s3=m0_client_s3,
m0_client_other=m0_client_other)
protal_group.m0_client_other.append({'name': 'default',
portal_group.m0_client_other.append({'name': 'default',
'port': 4})
return protal_group
return portal_group


def get_libfab_portal_group(
hax=22000,
hax=22001,
m0_server=[{'name': 'confd', 'port': m0ProcT.confd},
{'name': 'ios', 'port': m0ProcT.ios}],
m0_client_s3=22500,
m0_client_s3=22501,
m0_client_other=[]
) -> Portals:
protal_group = Portals(hax=hax, m0_server=m0_server,
portal_group = Portals(hax=hax, m0_server=m0_server,
m0_client_s3=m0_client_s3,
m0_client_other=m0_client_other)
protal_group.m0_client_other.append({'name': 'default',
'port': 22500})
return protal_group
portal_group.m0_client_other.append({'name': 'default',
'port': 22501})
return portal_group


class Endpoint:
Expand Down Expand Up @@ -1116,7 +1116,7 @@ class LibfabricEndpoint(Endpoint):
assert portal > 0
self.portal = 0
self.portal = self.ep_map.setdefault((ipaddr, portal),
(portal + 1))
(portal))
self.ep_map[(ipaddr, portal)] += 1

def __repr__(self):
Expand Down
12 changes: 6 additions & 6 deletions cfgen/examples/multipools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ nodes:
- name: m0_client_other # name of the motr client
instances: 2 # Number of instances, this host will run
# network_ports:
# hax: 22000
# hax: 22001
# hax_http: 8008
# m0_server:
# - name: ios
Expand All @@ -34,8 +34,8 @@ nodes:
# port: 21000
# m0_client_other:
# - name: m0_client_other
# port: 21500
# m0_client_s3: 22500
# port: 21501
# m0_client_s3: 22501
- hostname: srvnode-2
node_group: srvnode-2
data_iface: enp175s0f1_c2
Expand All @@ -62,7 +62,7 @@ nodes:
- name: m0_client_other # name of the motr client
instances: 2 # Number of instances, this host will run
# network_ports:
# hax: 22000
# hax: 22001
# hax_http: 8008
# m0_server:
# - name: ios
Expand All @@ -71,8 +71,8 @@ nodes:
# port: 21000
# m0_client_other:
# - name: m0_client_other
# port: 21500
# m0_client_s3: 22500
# port: 21501
# m0_client_s3: 22501
pools:
- name: tier1-nvme
disk_refs:
Expand Down
8 changes: 4 additions & 4 deletions provisioning/miniprov/hare_mp/cdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def _create_fdmi_filter_descriptions(

def _create_ports_descriptions(self, hostname: str) -> NetworkPorts:
conf = self.provider
m0serverT = ['ios', 'confd']
m0serverT = ['confd', 'ios']
m0server_ports = []
m0client_ports = []
for srv in NetworkPorts.__annotations__.keys():
Expand All @@ -318,7 +318,7 @@ def _create_ports_descriptions(self, hostname: str) -> NetworkPorts:
_hax_http = _parsed_url.port
else:
if _parsed_url.hostname == hostname:
_hax = round(_parsed_url.port / 100) * 100
_hax = _parsed_url.port
elif srv == 'm0_client_other':
num_clients = int(conf.get('cortx>motr>num_clients'))
for i in range(num_clients):
Expand All @@ -332,7 +332,7 @@ def _create_ports_descriptions(self, hostname: str) -> NetworkPorts:
f'cortx>motr>clients[{i}]>endpoints[{j}]')
_parsed_url = urlparse(url)
if _parsed_url.hostname == hostname:
port = round(_parsed_url.port / 100) * 100
port = _parsed_url.port
client_name = conf.get(
f'cortx>motr>clients[{i}]>name')
m0client_ports.append(
Expand All @@ -347,7 +347,7 @@ def _create_ports_descriptions(self, hostname: str) -> NetworkPorts:
url = conf.get(f'cortx>motr>{server}>endpoints[{i}]')
_parsed_url = urlparse(url)
if _parsed_url.hostname == hostname:
port = round(_parsed_url.port / 100) * 100
port = _parsed_url.port
m0server_ports.append(
ServerPort(name=Text(server),
port=int(port)))
Expand Down

0 comments on commit 41575f3

Please sign in to comment.