From 96abb2329bf806f1ad3c73500b4ca929a4e91b6c Mon Sep 17 00:00:00 2001 From: pavankrishnat Date: Tue, 23 Aug 2022 10:23:03 +0530 Subject: [PATCH] CORTX-33705: confd and ios ports are not aligned with cluster (#2149) 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 Signed-off-by: pavankrishnat --- cfgen/cfgen | 28 ++++++++++++++-------------- cfgen/examples/multipools.yaml | 12 ++++++------ provisioning/miniprov/hare_mp/cdf.py | 8 ++++---- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cfgen/cfgen b/cfgen/cfgen index 81124566a..5572e5a4a 100755 --- a/cfgen/cfgen +++ b/cfgen/cfgen @@ -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, @@ -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: @@ -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): diff --git a/cfgen/examples/multipools.yaml b/cfgen/examples/multipools.yaml index 884882f02..2055a1d13 100644 --- a/cfgen/examples/multipools.yaml +++ b/cfgen/examples/multipools.yaml @@ -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 @@ -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 @@ -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 @@ -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: diff --git a/provisioning/miniprov/hare_mp/cdf.py b/provisioning/miniprov/hare_mp/cdf.py index 75a2e3dcf..5e61e3003 100644 --- a/provisioning/miniprov/hare_mp/cdf.py +++ b/provisioning/miniprov/hare_mp/cdf.py @@ -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(): @@ -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): @@ -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( @@ -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)))