Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[crmsh-4.6] Dev: bootstrap: add gfs2 stage functionality (Technical Preview) #1637

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions crmsh/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from . import userdir
from .constants import QDEVICE_HELP_INFO, STONITH_TIMEOUT_DEFAULT,\
REJOIN_COUNT, REJOIN_INTERVAL, PCMK_DELAY_MAX, CSYNC2_SERVICE, WAIT_TIMEOUT_MS_DEFAULT
from . import ocfs2
from . import cluster_fs
from . import qdevice
from . import parallax
from . import log
Expand Down Expand Up @@ -76,7 +76,7 @@
"/etc/samba/smb.conf", SYSCONFIG_NFS, SYSCONFIG_PCMK, SYSCONFIG_SBD, PCMK_REMOTE_AUTH, WATCHDOG_CFG,
PROFILES_FILE, CRM_CFG, SBD_SYSTEMD_DELAY_START_DIR)

INIT_STAGES_EXTERNAL = ("ssh", "csync2", "corosync", "sbd", "cluster", "ocfs2", "admin", "qdevice")
INIT_STAGES_EXTERNAL = ("ssh", "csync2", "corosync", "sbd", "cluster", "ocfs2", "gfs2", "admin", "qdevice")
INIT_STAGES_INTERNAL = ("csync2_remote", "qnetd_remote", "remote_auth")
INIT_STAGES_ALL = INIT_STAGES_EXTERNAL + INIT_STAGES_INTERNAL
JOIN_STAGES_EXTERNAL = ("ssh", "csync2", "ssh_merge", "cluster")
Expand Down Expand Up @@ -119,6 +119,7 @@ def __init__(self):
self.qdevice_heuristics_mode = None
self.qdevice_rm_flag = None
self.ocfs2_devices = []
self.gfs2_devices = []
self.use_cluster_lvm2 = None
self.mount_point = None
self.cluster_node = None
Expand Down Expand Up @@ -287,8 +288,8 @@ def validate_option(self):
logger.warning("--no-overwrite-sshkey option is deprecated since crmsh does not overwrite ssh keys by default anymore and will be removed in future versions")
if self.type == "join" and self.watchdog:
logger.warning("-w option is deprecated and will be removed in future versions")
if self.ocfs2_devices or self.stage == "ocfs2":
ocfs2.OCFS2Manager.verify_ocfs2(self)
if self.ocfs2_devices or self.gfs2_devices or self.stage in ("ocfs2", "gfs2"):
cluster_fs.ClusterFSManager.pre_verify(self)
if not self.skip_csync2 and self.type == "init":
self.skip_csync2 = utils.get_boolean(os.getenv("SKIP_CSYNC2_SYNC"))
if self.skip_csync2 and self.stage:
Expand Down Expand Up @@ -1514,8 +1515,18 @@ def init_ocfs2():
"""
if not _context.ocfs2_devices:
return
ocfs2_manager = ocfs2.OCFS2Manager(_context)
ocfs2_manager.init_ocfs2()
ocfs2_manager = cluster_fs.ClusterFSManager(_context)
ocfs2_manager.init()


def init_gfs2():
"""
GFS2 configure process
"""
if not _context.gfs2_devices:
return
gfs2_manager = cluster_fs.ClusterFSManager(_context)
gfs2_manager.init()


def init_cluster():
Expand Down Expand Up @@ -2513,6 +2524,7 @@ def bootstrap_init(context):
init_admin()
init_qdevice()
init_ocfs2()
init_gfs2()
except lock.ClaimLockError as err:
utils.fatal(err)

Expand Down Expand Up @@ -2610,7 +2622,7 @@ def bootstrap_join(context):
join_csync2(cluster_node, remote_user)
join_ssh_merge(cluster_node, remote_user)
probe_partitions()
join_ocfs2(cluster_node, remote_user)
join_cluster_fs(cluster_node, remote_user)
join_cluster(cluster_node, remote_user)
except (lock.SSHError, lock.ClaimLockError) as err:
utils.fatal(err)
Expand All @@ -2622,12 +2634,12 @@ def bootstrap_finished():
logger.info("Done (log saved to %s on %s)", log.CRMSH_LOG_FILE, utils.this_node())


def join_ocfs2(peer_host, peer_user):
def join_cluster_fs(peer_host, peer_user):
"""
If init node configured OCFS2 device, verify that device on join node
If init node configured OCFS2/GFS2 device, verify that device on join node
"""
ocfs2_inst = ocfs2.OCFS2Manager(_context)
ocfs2_inst.join_ocfs2(peer_host)
inst = cluster_fs.ClusterFSManager(_context)
inst.join(peer_host)


def remove_qdevice():
Expand Down
Loading