Skip to content

Commit

Permalink
.github/actions/setup-microceph: Setup microceph with 3 OSDs
Browse files Browse the repository at this point in the history
Signed-off-by: Max Asnaashari <[email protected]>
  • Loading branch information
masnax committed Oct 22, 2024
1 parent 7034630 commit 283088d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/actions/setup-microceph/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ runs:
}
trap cleanup ERR HUP INT TERM
ephemeral_disk="${{ steps.free_ephemeral_disk.outputs.ephemeral_disk }}"
sudo parted "${ephemeral_disk}" --script mklabel gpt
sudo parted "${ephemeral_disk}" --script mkpart primary 0% 33%
sudo parted "${ephemeral_disk}" --script mkpart primary 33% 66%
sudo parted "${ephemeral_disk}" --script mkpart primary 66% 100%
disk1="$(losetup -f)"
sudo losetup "${disk1}" "${ephemeral_disk}1"
disk2="$(losetup -f)"
sudo losetup "${disk2}" "${ephemeral_disk}2"
disk3="$(losetup -f)"
sudo losetup "${disk3}" "${ephemeral_disk}3"
sudo snap install microceph --channel "${{ inputs.microceph-channel }}"
sudo microceph cluster bootstrap
sudo microceph.ceph config set global osd_pool_default_size 1
Expand All @@ -62,7 +75,9 @@ runs:
for flag in nosnaptrim nobackfill norebalance norecover noscrub nodeep-scrub; do
sudo microceph.ceph osd set $flag
done
sudo microceph disk add --wipe "${{ steps.free_ephemeral_disk.outputs.ephemeral_disk }}"
sudo microceph disk add --wipe "${disk1}"
sudo microceph disk add --wipe "${disk2}"
sudo microceph disk add --wipe "${disk3}"
sudo rm -rf /etc/ceph
sudo ln -s /var/snap/microceph/current/conf/ /etc/ceph
sudo microceph enable rgw
Expand Down

0 comments on commit 283088d

Please sign in to comment.