Skip to content

Commit 6b0b73f

Browse files
committed
Unpause hosts once bootstrap finishes
1 parent 02dc0d5 commit 6b0b73f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

data/data/bootstrap/baremetal/files/usr/local/bin/master-bmh-update.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ echo Nodes are all active
3636
BAREMETAL_OPERATOR_IMAGE=$(image_for baremetal-operator)
3737

3838
for node in $(curl -s "${ironic_url}/nodes" | jq -r '.nodes[] | .uuid'); do
39-
name=$(curl -H "X-OpenStack-Ironic-API-Version: 1.9" -s "${ironic_url}/nodes/${node}" | jq -r .name)
39+
name=$(curl -H "X-OpenStack-Ironic-API-Version: 1.9" -s "${ironic_url}/nodes/${node}" | jq -r .name | cut -d "~" -f 2)
4040
echo "Host $name, UUID: $node"
4141
# And use the baremetal operator tool to load the introspection data into
4242
# the BareMetalHost CRs as annotations, which BMO then picks up.
@@ -49,10 +49,13 @@ for node in $(curl -s "${ironic_url}/nodes" | jq -r '.nodes[] | .uuid'); do
4949
oc annotate --overwrite -n openshift-machine-api baremetalhosts "$name" 'baremetalhost.metal3.io/status'="$HARDWARE_DETAILS" 'baremetalhost.metal3.io/paused-'
5050
done
5151

52-
# This delay is needed to ensure that Terraform sees that the hosts are
53-
# deployed before we stop ironic. Terraform is polling every 10s.
54-
sleep 30
5552
# Shut down ironic containers so that the API VIP can fail over to the control
5653
# plane.
5754
echo "Stopping provisioning services..."
5855
systemctl stop ironic.service
56+
57+
echo "Wait for control plane to fail over"
58+
sleep 30
59+
60+
echo "Unpause all baremetal hosts"
61+
oc annotate --overwrite -n openshift-machine-api baremetalhosts --all "baremetalhost.metal3.io/paused-"

0 commit comments

Comments
 (0)