-
-
Notifications
You must be signed in to change notification settings - Fork 249
Allow draid in ZFS #1049
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
base: master
Are you sure you want to change the base?
Allow draid in ZFS #1049
Conversation
name = "zpoolMode"; | ||
description = "valid modes for a zpool"; | ||
descriptionClass = "noun"; | ||
check = (x: lib.isString x && (builtins.elem x modeOptions || lib.strings.hasPrefix "draid" x)); |
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.
What does example configuration for this looks like? Should we extend zfs-with-vdevs.nix ?
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.
it looks very similar to raidz, but the mode would look something like draid2:16d:27c:2s
.
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.
Can you provide a more complete configuration that I can use for testing?
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.
{
lib,
...
}:
let
in
{
disko.devices = {
disk = {
"disk0" = {
type = "disk";
device = "/dev/mapper/disk0";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk1" = {
type = "disk";
device = "/dev/mapper/disk1";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk2" = {
type = "disk";
device = "/dev/mapper/disk2";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk3" = {
type = "disk";
device = "/dev/mapper/disk3";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk4" = {
type = "disk";
device = "/dev/mapper/disk4";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk5" = {
type = "disk";
device = "/dev/mapper/disk5";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk6" = {
type = "disk";
device = "/dev/mapper/disk6";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk7" = {
type = "disk";
device = "/dev/mapper/disk7";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk8" = {
type = "disk";
device = "/dev/mapper/disk8";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk9" = {
type = "disk";
device = "/dev/mapper/disk9";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk10" = {
type = "disk";
device = "/dev/mapper/disk10";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk11" = {
type = "disk";
device = "/dev/mapper/disk11";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk12" = {
type = "disk";
device = "/dev/mapper/disk12";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk13" = {
type = "disk";
device = "/dev/mapper/disk13";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk14" = {
type = "disk";
device = "/dev/mapper/disk14";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk15" = {
type = "disk";
device = "/dev/mapper/disk15";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk16" = {
type = "disk";
device = "/dev/mapper/disk16";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk17" = {
type = "disk";
device = "/dev/mapper/disk17";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk18" = {
type = "disk";
device = "/dev/mapper/disk18";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk19" = {
type = "disk";
device = "/dev/mapper/disk19";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk20" = {
type = "disk";
device = "/dev/mapper/disk20";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk21" = {
type = "disk";
device = "/dev/mapper/disk21";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk22" = {
type = "disk";
device = "/dev/mapper/disk22";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk23" = {
type = "disk";
device = "/dev/mapper/disk23";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk24" = {
type = "disk";
device = "/dev/mapper/disk24";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk25" = {
type = "disk";
device = "/dev/mapper/disk25";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
"disk26" = {
type = "disk";
device = "/dev/mapper/disk26";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "tank";
};
};
};
};
};
};
zpool = {
tank = {
type = "zpool";
mode = {
topology = {
type = "topology";
vdev = [
{
mode = "draid2:16d:27c:2s"; # according to my calculations, this is pretty optimal. Read the README for more info
members = [
"disk0"
"disk1"
"disk2"
"disk3"
"disk4"
"disk5"
"disk6"
"disk7"
"disk8"
"disk9"
"disk10"
"disk11"
"disk12"
"disk13"
"disk14"
"disk15"
"disk16"
"disk17"
"disk18"
"disk19"
"disk20"
"disk21"
"disk22"
"disk23"
"disk24"
"disk25"
"disk26"
];
}
];
};
};
datasets = {
mirror = {
type = "zfs_fs";
mountpoint = "/srv/mirror";
};
};
};
};
};
}
I'm not quite sure how to have the tests pass if the type is set to a function. |
Previously, creating a draid pool in disko would fail with a type error. This simple patch should resolve that.