Force v1 protocol in monitors during upgrade

Before all monitors are upgraded, it is needed to make sure they use v1
protocol, otherwise they will use v2 protocol and be unable to join the
ceph cluster.

Testing performed:
- Upgrade of 2+2+2
- Upgrade of AIO-DX
- Upgrade of AIO-SX
- Fresh install of AIO-SX
- Fresh install of AIO-DX
- Fresh install of 2+2

Story: 2009074
Task: 43956

Signed-off-by: Vinicius Lopes da Silva <vinicius.lopesdasilva@windriver.com>
Change-Id: I25d26c40cebb7d027b75e58d05bbb763ca97bb21
This commit is contained in:
Vinicius Lopes da Silva 2021-11-12 14:12:22 -03:00 committed by Bob Church
parent c861bc6f34
commit 79e7db3dff
1 changed files with 36 additions and 4 deletions

View File

@ -25,7 +25,7 @@ LOG = logging.getLogger(__name__)
class CephPuppet(openstack.OpenstackBasePuppet):
"""Class to encapsulate puppet operations for ceph storage configuration"""
SERVICE_PORT_MON = 6789
SERVICE_PORT_MON_V1 = 6789
SERVICE_NAME_RGW = 'swift'
SERVICE_PORT_RGW = 7480 # civetweb port
SERVICE_PATH_RGW = 'swift/v1'
@ -239,6 +239,7 @@ class CephPuppet(openstack.OpenstackBasePuppet):
def _get_ceph_mon_config(self, host):
ceph_mon = self._get_host_ceph_mon(host)
config = {}
mon_lv_size = None
if ceph_mon:
@ -246,10 +247,41 @@ class CephPuppet(openstack.OpenstackBasePuppet):
if mon_lv_size is None:
mon_lv_size = constants.SB_CEPH_MON_GIB
config['platform::ceph::params::mon_lv_size'] = mon_lv_size
return {
'platform::ceph::params::mon_lv_size': mon_lv_size,
}
if ceph_mon:
# During an upgrade from STX.5.0 -> STX.6.0, enforce msgr v1
# addressing on all monitors. Can revert this change in STX.7.0
try:
upgrade = self.dbapi.software_upgrade_get_one()
LOG.info("Platform Upgrade in Progress %s" % upgrade.state)
except Exception:
# Use default values from the system config if no upgrade in progress
pass
else:
ceph_mon_ips = StorageBackendConfig.get_ceph_mon_ip_addresses(
self.dbapi)
LOG.info("Formatting addresses to enforce v1 in monitors")
mon_0_ip = ceph_mon_ips[constants.CEPH_MON_0]
mon_1_ip = ceph_mon_ips[constants.CEPH_MON_1]
mon_2_ip = ceph_mon_ips.get(constants.CEPH_MON_2, None)
mon_0_addr = "[v1:%s:%s]" % (self._format_ceph_mon_address(mon_0_ip),
self.SERVICE_PORT_MON_V1)
mon_1_addr = "[v1:%s:%s]" % (self._format_ceph_mon_address(mon_1_ip),
self.SERVICE_PORT_MON_V1)
if mon_2_ip:
mon_2_addr = "[v1:%s:%s]" % (self._format_ceph_mon_address(mon_2_ip),
self.SERVICE_PORT_MON_V1)
else:
mon_2_addr = None
config.update({
'platform::ceph::params::mon_0_addr': mon_0_addr,
'platform::ceph::params::mon_1_addr': mon_1_addr,
'platform::ceph::params::mon_2_addr': mon_2_addr,
})
return config
def _get_ceph_osd_config(self, host):
osd_config = {}