From eaf93cdf965721c151d2ca09d2e59d7ef3291714 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 27 Nov 2023 13:32:47 -0500 Subject: [PATCH] Readd missing subsystem configurations --- node-daemon/pvcnoded/util/config.py | 11 +++++++++++ node-daemon/pvcnoded/util/services.py | 10 ++++++---- pvc.sample.conf | 20 ++++++++++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/node-daemon/pvcnoded/util/config.py b/node-daemon/pvcnoded/util/config.py index ff81a979..e191b86a 100644 --- a/node-daemon/pvcnoded/util/config.py +++ b/node-daemon/pvcnoded/util/config.py @@ -174,6 +174,16 @@ def get_configuration_current(config_file): } config = {**config, **config_path} + o_subsystem = o_config["subsystem"] + config_subsystem = { + "enable_hypervisor": o_subsystem.get("enable_hypervisor", True), + "enable_networking": o_subsystem.get("enable_networking", True), + "enable_storage": o_subsystem.get("enable_storage", True), + "enable_worker": o_subsystem.get("enable_worker", True), + "enable_api": o_subsystem.get("enable_api", True), + } + config = {**config, **config_subsystem} + o_cluster = o_config["cluster"] config_cluster = { "cluster_name": o_cluster["name"], @@ -397,6 +407,7 @@ def get_configuration_legacy(pvcnoded_config_file): "enable_hypervisor": o_functions.get("enable_hypervisor", False), "enable_networking": o_functions.get("enable_networking", False), "enable_storage": o_functions.get("enable_storage", False), + "enable_worker": o_functions.get("enable_worker", True), "enable_api": o_functions.get("enable_api", False), } diff --git a/node-daemon/pvcnoded/util/services.py b/node-daemon/pvcnoded/util/services.py index b761480d..f2f12888 100644 --- a/node-daemon/pvcnoded/util/services.py +++ b/node-daemon/pvcnoded/util/services.py @@ -70,14 +70,16 @@ def start_ceph_mgr(logger, config): def start_keydb(logger, config): - if config["enable_api"] and config["daemon_mode"] == "coordinator": + if (config["enable_api"] or config["enable_worker"]) and config[ + "daemon_mode" + ] == "coordinator": logger.out("Starting KeyDB daemon", state="i") # TODO: Move our handling out of Systemd and integrate it directly as a subprocess? common.run_os_command("systemctl start keydb-server.service") -def start_api_worker(logger, config): - if config["enable_api"]: +def start_worker(logger, config): + if config["enable_worker"]: logger.out("Starting Celery Worker daemon", state="i") # TODO: Move our handling out of Systemd and integrate it directly as a subprocess? common.run_os_command("systemctl start pvcworkerd.service") @@ -91,7 +93,7 @@ def start_system_services(logger, config): start_ceph_mon(logger, config) start_ceph_mgr(logger, config) start_keydb(logger, config) - start_api_worker(logger, config) + start_worker(logger, config) logger.out("Waiting 10 seconds for daemons to start", state="s") sleep(10) diff --git a/pvc.sample.conf b/pvc.sample.conf index 9f99c313..9db3ead8 100644 --- a/pvc.sample.conf +++ b/pvc.sample.conf @@ -28,6 +28,26 @@ path: # Ceph configuration directory (set by Ceph/Ansible) ceph_directory: "/etc/ceph" +# Subsystem configuration +# Changing these values can be used to turn on or off various parts of PVC +# Normally, all should be enabled ("yes") except in very custom clusters +subsystem: + + # Enable or disable hypervisor functionality + enable_hypervisor: yes + + # Enable or disable virtual networking and routing functionality + enable_networking: yes + + # Enable or disable Ceph storage management functionality + enable_storage: yes + + # Enable or disable the worker client + enable_worker: yes + + # Enable or disable the API client, if installed, when node is Primary + enable_api: yes + # Cluster configuration cluster: