From 26c86a40fdac6ace4635b484f94f5a86f5d3743d Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 6 Jul 2022 20:05:28 +0000 Subject: [PATCH] Add replcfg option to pool creation --- bootstrap-daemon/pvcbootstrapd/lib/hooks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bootstrap-daemon/pvcbootstrapd/lib/hooks.py b/bootstrap-daemon/pvcbootstrapd/lib/hooks.py index 54a8c24..d5167dc 100755 --- a/bootstrap-daemon/pvcbootstrapd/lib/hooks.py +++ b/bootstrap-daemon/pvcbootstrapd/lib/hooks.py @@ -111,14 +111,15 @@ def run_hook_pool(config, targets, args): name = args["name"] pgs = args.get("pgs", "64") tier = args.get("tier", "default") # Does nothing yet + replcfg = args.get("replcfg", "copies=3,mincopies=2") logger.info( - f"Creating storage pool on node {node_name} name {name} pgs {pgs} tier {tier}" + f"Creating storage pool on node {node_name} name {name} pgs {pgs} tier {tier} replcfg {replcfg}" ) # Using a direct command on the target here is somewhat messy, but avoids many # complexities of determining a valid API listen address, etc. - pvc_cmd_string = f"pvc storage pool add {name} {pgs}" + pvc_cmd_string = f"pvc storage pool add {name} {pgs} --replcfg {replcfg}" with run_paramiko(config, node_address) as c: stdin, stdout, stderr = c.exec_command(pvc_cmd_string)