From 7c177bda6ccd1c3e7a7c070eb2ab0dc5e6b32a5c Mon Sep 17 00:00:00 2001 From: darshan n Date: Wed, 4 Mar 2015 19:18:10 +0530 Subject: geo-rep-cli: added a new option "no-verify" to geo-rep create. This patch adds a new option called as "no-verify" to geo-rep create command. With no-verify option, following checks does not take place before session creation: * if ssh port 22 is open in slave * has proper passwordless ssh login setup * slave volume is created and is empty * if slave has enough memory This option is needed by ovirt-engine as the tasks done by push-pem is taken care by ovirt-engine and also the above checks are done. Thus creation of password-less ssh can be avoided when geo-replication is managed through ovirt. Usage: volume geo-replication [] [] { create [[no-verify]|[push-pem]] [force]| start [force]|stop [force]|pause [force]| resume [force]|config|status [detail]| delete } [options...] Change-Id: I975265f27d6434be5409438257d09cd4190c9159 BUG: 1198615 Signed-off-by: darshan n Reviewed-on: http://review.gluster.org/9799 Reviewed-by: Aravinda VK Reviewed-by: Kotresh HR Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 40 ++++++++++++++++------------ 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index 5efd232554e..8dff3d9e419 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -2205,6 +2205,7 @@ glusterd_op_stage_gsync_create (dict_t *dict, char **op_errstr) int ret = -1; int is_pem_push = -1; gf_boolean_t is_force = -1; + gf_boolean_t is_no_verify = -1; gf_boolean_t is_force_blocker = -1; gf_boolean_t exists = _gf_false; gf_boolean_t is_template_in_use = _gf_false; @@ -2289,23 +2290,28 @@ glusterd_op_stage_gsync_create (dict_t *dict, char **op_errstr) down_peerstr = NULL; } - /* Checking if slave host is pingable, has proper passwordless - * ssh login setup, slave volume is created, slave vol is empty, - * and if it has enough memory and bypass in case of force if - * the error is not a force blocker */ - ret = glusterd_verify_slave (volname, slave_url, slave_vol, - op_errstr, &is_force_blocker); - if (ret) { - if (is_force && !is_force_blocker) { - gf_log ("", GF_LOG_INFO, "%s is not a valid slave" - " volume. Error: %s. Force creating geo-rep" - " session.", slave, *op_errstr); - } else { - gf_log ("", GF_LOG_ERROR, - "%s is not a valid slave volume. Error: %s", - slave, *op_errstr); - ret = -1; - goto out; + is_no_verify = dict_get_str_boolean (dict, "no_verify", _gf_false); + + if (!is_no_verify) { + /* Checking if slave host is pingable, has proper passwordless + * ssh login setup, slave volume is created, slave vol is empty, + * and if it has enough memory and bypass in case of force if + * the error is not a force blocker */ + ret = glusterd_verify_slave (volname, slave_url, slave_vol, + op_errstr, &is_force_blocker); + if (ret) { + if (is_force && !is_force_blocker) { + gf_log ("", GF_LOG_INFO, "%s is not a valid slave" + " volume. Error: %s. Force creating geo-rep" + " session.", slave, *op_errstr); + } else { + gf_log ("", GF_LOG_ERROR, + "%s is not a valid slave volume. Error: %s", + slave, *op_errstr); + ret = -1; + + goto out; + } } } -- cgit