-
Notifications
You must be signed in to change notification settings - Fork 1.5k
baremetal: stop ironic on bootstrap after masters are booted #3075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,6 +123,12 @@ sudo podman run -d --net host --privileged --name ironic-api \ | |
| --entrypoint /bin/runironic-api \ | ||
| -v $IRONIC_SHARED_VOLUME:/shared:z ${IRONIC_IMAGE} | ||
|
|
||
| # See if Ironic API is up | ||
| while true; do | ||
| curl http://localhost:6385/v1 && break | ||
| sleep 10 | ||
| done | ||
|
|
||
| # Now loop so the service remains active and restart everything should one of the containers exit unexpectedly. | ||
| # The alternative would be RemainAfterExit=yes but then we lose the ability to restart if something crashes. | ||
| while true; do | ||
|
|
@@ -137,5 +143,15 @@ while true; do | |
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| # See if all 3 masters are up yet - if so we can bring down Ironic. If the masters are brought up, and | ||
| # machine-api is started in the cluster, there can end up being 2 DHCP servers running on the network. | ||
| # We must ensure we stop the bootstrap's Ironic before that can happen. | ||
| ACTIVE_NODES=$(curl -H "X-OpenStack-Ironic-API-Version: 1.9" 'http://localhost:6385/v1/nodes?provision_state=active' | jq '.nodes | length') | ||
| if [[ "$ACTIVE_NODES" == "3" ]]; then | ||
| sleep 60 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have to wait for the hosts to be active, and give enough time for the installer to see that as well via it's polling |
||
| stopironic.sh | ||
| sleep infinity | ||
| fi | ||
| sleep 10 | ||
| done | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we go with this approach we'll need to template the number of nodes as I know some folks have tested with a single master