Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/buildomat/jobs/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ tar xf out/omicron-sled-agent.tar pkg/config-rss.toml pkg/config.toml
sed -E -i~ "s/(m2|u2)(.*\.vdev)/\/scratch\/\1\2/g" pkg/config.toml
diff -u pkg/config.toml{~,} || true

EXPECTED_ZPOOL_COUNT=$(grep -c -E 'u2.*\.vdev' pkg/config.toml)
echo "expected number of zpools is ${EXPECTED_ZPOOL_COUNT}"

SILO_NAME="$(sed -n 's/silo_name = "\(.*\)"/\1/p' pkg/config-rss.toml)"
EXTERNAL_DNS_DOMAIN="$(sed -n 's/external_dns_zone_name = "\(.*\)"/\1/p' pkg/config-rss.toml)"

Expand Down Expand Up @@ -397,6 +400,47 @@ until zoneadm list | grep nexus; do
done
echo "Waited for nexus: ${retry}s"

# Wait for handoff, as zpools as inserted into the database during
# `rack_initialize`, and the next omdb command requires them to exist in the
# db.
retry=0
until grep "Handoff to Nexus is complete" /var/svc/log/oxide-sled-agent:default.log; do
if [[ $retry -gt 300 ]]; then
echo "Failed to handoff to Nexus after 300 seconds"
exit 1
fi
sleep 1
retry=$((retry + 1))
done
echo "Waited for handoff: ${retry}s"

# Wait for the number of expected U2 zpools
retry=0
ACTUAL_ZPOOL_COUNT=$(pfexec zlogin oxz_switch /opt/oxide/omdb/bin/omdb db zpool list -i | wc -l)
until [[ "${ACTUAL_ZPOOL_COUNT}" -eq "${EXPECTED_ZPOOL_COUNT}" ]];
do
pfexec zlogin oxz_switch /opt/oxide/omdb/bin/omdb db zpool list
if [[ $retry -gt 300 ]]; then
echo "Failed to wait for ${EXPECTED_ZPOOL_COUNT} zpools after 300 seconds"
exit 1
fi
sleep 1
retry=$((retry + 1))
ACTUAL_ZPOOL_COUNT=$(pfexec zlogin oxz_switch /opt/oxide/omdb/bin/omdb db zpool list -i | wc -l)
done

# The bootstrap command creates a disk, so before that: adjust the control plane
# storage buffer to 0 as the virtual hardware only creates 20G pools

pfexec zlogin oxz_switch /opt/oxide/omdb/bin/omdb db zpool list

for ZPOOL in $(pfexec zlogin oxz_switch /opt/oxide/omdb/bin/omdb db zpool list -i);
do
pfexec zlogin oxz_switch /opt/oxide/omdb/bin/omdb -w db zpool set-storage-buffer "${ZPOOL}" 0
done

pfexec zlogin oxz_switch /opt/oxide/omdb/bin/omdb db zpool list

export RUST_BACKTRACE=1
export E2E_TLS_CERT IPPOOL_START IPPOOL_END
eval "$(./target/debug/bootstrap)"
Expand Down
Loading
Loading