-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lvm-driver): enable RAID support
Add support for LVM2 RAID types and parameters, with sane defaults for backwards compatibility. lvm-driver now assumes that a non- specified RAID type corresponds to the previous default of linear RAID, where data is packed onto disk until it runs out of space, continuing to the next as necessary. Tests have been added to cover the main supported RAID types (e.g. raid0, raid1, raid5, raid6, and raid10), but technically any valid LVM RAID type should work as well. Fixes #164 Signed-off-by: Nicholas Cioli <[email protected]>
- Loading branch information
1 parent
45ebdf6
commit 5111243
Showing
15 changed files
with
504 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
add support for LVM raid options |
This file contains 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 |
---|---|---|
|
@@ -33,6 +33,9 @@ fi | |
LVM_SYSTEMID="openebs-ci-test-system" | ||
LVM_CONFIG="global{system_id_source=lvmlocal}local{system_id=${LVM_SYSTEMID}}" | ||
|
||
# RAID info for corresponding tests | ||
RAID_COUNT=5 | ||
|
||
# Clean up generated resources for successive tests. | ||
cleanup_loopdev() { | ||
sudo losetup -l | grep '(deleted)' | awk '{print $1}' \ | ||
|
@@ -60,13 +63,28 @@ cleanup_foreign_lvmvg() { | |
cleanup_loopdev | ||
} | ||
|
||
cleanup_raidvg() { | ||
sudo vgremove raidvg -y || true | ||
|
||
for IMG in `seq ${RAID_COUNT}` | ||
Check failure on line 69 in ci/ci-test.sh GitHub Actions / lint
|
||
do | ||
if [ -f /tmp/openebs_ci_raid_disk_${IMG}.img ] | ||
then | ||
rm /tmp/openebs_ci_raid_disk_${IMG}.img | ||
fi | ||
done | ||
|
||
cleanup_loopdev | ||
} | ||
|
||
cleanup() { | ||
set +e | ||
|
||
echo "Cleaning up test resources" | ||
|
||
cleanup_lvmvg | ||
cleanup_foreign_lvmvg | ||
cleanup_raidvg | ||
|
||
kubectl delete pvc -n openebs lvmpv-pvc | ||
kubectl delete -f "${SNAP_CLASS}" | ||
|
@@ -93,10 +111,27 @@ foreign_disk="$(sudo losetup -f /tmp/openebs_ci_foreign_disk.img --show)" | |
sudo pvcreate "${foreign_disk}" | ||
sudo vgcreate foreign_lvmvg "${foreign_disk}" --systemid="${LVM_SYSTEMID}" | ||
|
||
# setup a RAID volume group | ||
cleanup_raidvg | ||
raid_disks=() | ||
for IMG in `seq ${RAID_COUNT}` | ||
Check failure on line 117 in ci/ci-test.sh GitHub Actions / lint
|
||
do | ||
truncate -s 1024G /tmp/openebs_ci_raid_disk_${IMG}.img | ||
raid_disk="$(sudo losetup -f /tmp/openebs_ci_raid_disk_${IMG}.img --show)" | ||
sudo pvcreate "${raid_disk}" | ||
|
||
raid_disks+=("${raid_disk}") | ||
done | ||
sudo vgcreate raidvg "${raid_disks[@]}" | ||
|
||
# install snapshot and thin volume module for lvm | ||
sudo modprobe dm-snapshot | ||
sudo modprobe dm_thin_pool | ||
|
||
# install RAID modules for lvm | ||
sudo modprobe dm_raid | ||
sudo modprobe dm_integrity | ||
|
||
# Prepare env for running BDD tests | ||
# Minikube is already running | ||
kubectl apply -f "${LVM_OPERATOR}" | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.