Commit 7bd23fb1 authored by Mike Hibler's avatar Mike Hibler

Various Linux local blockstore changes:

Most important: if a <2TB blockstore has an ext4 filesystem, make sure we
create it without the 64bit and huge_file features. The former will make
it impossible (currently) to take a snapshot since imagezip does not handle
64-bit blocknumbers (working on it...)

Don't stripe an LVM LV over more than 8 devices. Some of the Clemson nodes
have 20+ disks and we won't buy much (and it might even be counterproductive)
to try to stripe writes over all devices all the time.

Still trying to get lvcreate to not prompt when one of the devices has an
old metadata prompt. -Zy is supposed to prevent that, but it doesn't. Try
adding -y as well.

Not related: in the BEGIN block, don't cat $ETCDIR/genvmtype unless it
actually exists. Not everything is a docker container ya know...
parent c587ef68
...@@ -58,9 +58,12 @@ BEGIN ...@@ -58,9 +58,12 @@ BEGIN
$VARDIR = "/etc/rc.d/testbed"; $VARDIR = "/etc/rc.d/testbed";
$BOOTDIR = "/etc/rc.d/testbed"; $BOOTDIR = "/etc/rc.d/testbed";
} }
my $genvmtype = `cat $ETCDIR/genvmtype`; my $genvmtype = "";
chomp($genvmtype); if (-e "$ETCDIR/genvmtype") {
$genvmtype = `cat $ETCDIR/genvmtype`;
chomp($genvmtype);
}
$VGNAME = "emulab"; $VGNAME = "emulab";
if (GENVNODEHOST() && GENVNODETYPE() eq 'docker') { if (GENVNODEHOST() && GENVNODETYPE() eq 'docker') {
...@@ -89,6 +92,7 @@ my $UMOUNT = "/bin/umount"; ...@@ -89,6 +92,7 @@ my $UMOUNT = "/bin/umount";
my $MKDIR = "/bin/mkdir"; my $MKDIR = "/bin/mkdir";
my $MKFS = "/sbin/mke2fs"; my $MKFS = "/sbin/mke2fs";
my $FSCK = "/sbin/e2fsck"; my $FSCK = "/sbin/e2fsck";
my $DUMPFS = "/sbin/dumpe2fs";
my $DOSTYPE = "$BINDIR/dostype"; my $DOSTYPE = "$BINDIR/dostype";
my $ISCSI = "/sbin/iscsiadm"; my $ISCSI = "/sbin/iscsiadm";
my $ISCSI_ALT = "/usr/bin/iscsiadm"; my $ISCSI_ALT = "/usr/bin/iscsiadm";
...@@ -1490,6 +1494,17 @@ sub os_create_storage($$) ...@@ -1490,6 +1494,17 @@ sub os_create_storage($$)
if ($failed) { if ($failed) {
$fstype = "ext4"; $fstype = "ext4";
$fsopts = "-F -q -E lazy_itable_init=1,nodiscard"; $fsopts = "-F -q -E lazy_itable_init=1,nodiscard";
#
# XXX temporary hack for 32-bit only imagezip.
# If the dataset size is less than 2TB, we make sure that
# the 64bit feature is not set. Otherwise, we cannot take
# a snapshot of the dataset (until imagezip is enhanced!)
#
my $vsize = $href->{'VOLSIZE'};
if ($vsize < (2 * 1024 * 1024)) {
warn(" $lv: removing 64-bit feature from FS on $mdev\n");
$fsopts .= " -O ^64bit,^huge_file";
}
$failed = mysystem("$MKFS -t $fstype $fsopts $mdev $redir"); $failed = mysystem("$MKFS -t $fstype $fsopts $mdev $redir");
} }
if ($failed) { if ($failed) {
...@@ -1831,13 +1846,25 @@ sub os_create_storage_slice($$$) ...@@ -1831,13 +1846,25 @@ sub os_create_storage_slice($$$)
} }
} }
# try a striped LV first # try a striped LV first
# XXX don't stripe over an excess number of devices
my $pvs = $so->{'LVM_VGDEVS'}; my $pvs = $so->{'LVM_VGDEVS'};
if (defined($pvs) && $pvs > 8) {
warn(" $lv: limiting striping to 8 PV devices\n");
$pvs = 8;
}
#
# XXX supposedly, using -Zy will wipe (zero) all signatures
# without prompting for confirmation, but that doesn't seem
# to be the case under Ubuntu18. So let's throw in the -y
# option as well!
#
my $wipeopts = "-Zy -y";
if (defined($pvs) && $pvs > 1 && if (defined($pvs) && $pvs > 1 &&
!mysystem("lvcreate -Zy -i $pvs -n $lv -L ${lvsize}m $VGNAME $redir")) { !mysystem("lvcreate $wipeopts -i $pvs -n $lv -L ${lvsize}m $VGNAME $redir")) {
$href->{'LVDEV'} = "/dev/$VGNAME/$lv"; $href->{'LVDEV'} = "/dev/$VGNAME/$lv";
return 1; return 1;
} }
if (mysystem("lvcreate -Zy -n $lv -L ${lvsize}m $VGNAME $redir")) { if (mysystem("lvcreate $wipeopts -n $lv -L ${lvsize}m $VGNAME $redir")) {
warn("*** $lv: could not create LV$logmsg\n"); warn("*** $lv: could not create LV$logmsg\n");
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment