From 7b1771e4987adaa8e60738d4069cd7a5424c3406 Mon Sep 17 00:00:00 2001 From: Digimer Date: Mon, 15 Aug 2022 13:59:35 -0400 Subject: [PATCH] Updated anvil-provision-server to wait until the local machine is a full cluster member before proceeding. Signed-off-by: Digimer --- tools/anvil-provision-server | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/tools/anvil-provision-server b/tools/anvil-provision-server index 6375cf9d..4584ab42 100755 --- a/tools/anvil-provision-server +++ b/tools/anvil-provision-server @@ -11,7 +11,7 @@ # TODO: Support cloning; Example # - virt-clone --original-xml /mnt/shared/definitions/.xml --name --file --check path_exists=off # - Make VNC default -# +# - Don't provision until in the cluster! use strict; use warnings; @@ -168,12 +168,26 @@ sub run_jobs } else { - $waiting = 0; - $anvil->Job->update_progress({ - progress => 8, - message => "job_0276", - }); - $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "job_0276"}); + # Make sure we're actually in the cluster now. + if ($anvil->data->{cib}{parsed}{'local'}{ready}) + { + # We're ready! + $waiting = 0; + $anvil->Job->update_progress({ + progress => 8, + message => "job_0276", + }); + $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "job_0276"}); + } + else + { + # Cluster is coming up, but it's not up yet. + $anvil->Job->update_progress({ + progress => 6, + message => "job_0278", + }); + $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "job_0278"}); + } } }