From 693532b324e87dcc03e1b93871d380937990bbd1 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Thu, 21 Feb 2019 10:53:26 +0100 Subject: [PATCH] Adding host sync with rsync ONE 5.6.1 is affected by this bug : https://github.com/OpenNebula/one/issues/2962 Fixed in 5.6.2 but we don't have packages for this version. --- postservice/30-one-mng | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/postservice/30-one-mng b/postservice/30-one-mng index 99018f8..757afb5 100755 --- a/postservice/30-one-mng +++ b/postservice/30-one-mng @@ -69,6 +69,21 @@ function check_host() return ${res} } +# Fix host creation error from 5.6.1 with sync methode rsync +function sync_host() +{ + CMD="onehost" + OPT="sync -f --rsync" + AUTH=$(get_one_auth) + res=$(su - oneadmin -c "${CMD} ${OPT} --user ${AUTH%:*} --password ${AUTH#*:}") + if [[ ${?} -ne 0 ]] + then + error "Hosts sync failed" + else + echo "Hosts sync OK" + fi +} + function manage_host() { NAME=${1} @@ -441,7 +456,7 @@ function init_ha() { function main() { wait_true_retcode "Wait for oned to be started" "onecluster show 0 > /dev/null" - if [ $(CreoleGet one_ha_role) = "leader" ]; then + if [ "$(CreoleGet one_ha_role none)" = "leader" ]; then init_ha fi # @@ -466,6 +481,11 @@ function main() # attach_host ${host} "${clst_name}" + # + # Force host synchronisation + # + sync_host + # # Création des Datastores #