Skip to content
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

CP-45750 Allow for alternative local storage SR types #681

Merged
merged 3 commits into from
Mar 27, 2024
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
31 changes: 6 additions & 25 deletions scripts/storage-init
Original file line number Diff line number Diff line change
Expand Up @@ -167,41 +167,25 @@ mk_non_spanning_local_srs()
done
}


mk_ext_sr()
{
local partitions="$1"

for p in $partitions
do
diskprep "$p"
done

local partitions_cs=$(echo "$partitions" | sed "s/ /,/g")
sr_create "Local storage" "" "ext" "user" "local-storage" "" \
"device-config:device=$partitions_cs"
}


##
# mk_lvm_sr partitions
# mk_local_sr_from_partitions type partitions
#
# Create a single "Local storage" SR, with a single LVM volume spanning
# the given partitions.
#
# partitions should be an IFS-separated string of partition names.
#
mk_lvm_sr()
mk_local_sr_from_partitions()
{
local partitions="$1"
local type="$1"
local partitions="$2"

for p in $partitions
do
diskprep "$p"
done

local partitions_cs=$(echo "$partitions" | sed "s/ /,/g")
sr_create "Local storage" "" "lvm" "user" "local-storage" "" \
sr_create "Local storage" "" "$type" "user" "local-storage" "" \
"device-config:device=$partitions_cs"
}

Expand All @@ -212,10 +196,7 @@ create_local_sr() {
# the configuration file exists - load it and create storage
# as required:
source "$CONFIGURATION"
case "$TYPE" in
ext) mk_ext_sr "$PARTITIONS" ;;
lvm) mk_lvm_sr "$PARTITIONS" ;;
esac
mk_local_sr_from_partitions "$TYPE" "$PARTITIONS"
else
# CA-13146: upgrade Rio local storage
uuid=`xe sr-list name-label="Local storage on $(hostname)" | sed -ne 's/^uuid .*: //p'`
Expand Down
Loading
Loading