Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-stable
Commits
500d6719
Commit
500d6719
authored
Dec 02, 2014
by
Leigh B Stoller
Browse files
Add "striping" support, to strip LVMs across physical volumes.
Do not remove iscsi startup files in the guest on XEN44.
parent
e2c09d94
Changes
2
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/linux/libvnode.pm
View file @
500d6719
...
...
@@ -31,6 +31,7 @@ use Exporter;
existsBridge findBridge findBridgeIfaces
downloadImage getKernelVersion createExtraFS
forwardPort removePortForward lvSize DoIPtables restartDHCP
computeStripeSize
)
;
use
Data::
Dumper
;
...
...
@@ -318,6 +319,30 @@ isdisk:
return
%retval
;
}
#
# Attempt to compute a stripe size, based on physical number of
# devices in the volume group.
#
sub
computeStripeSize
($)
{
my
(
$vgname
)
=
@_
;
my
$command
=
"
vgdisplay -v
$vgname
2>/dev/null |
"
.
"
awk '/PV Name/ {print
\$
3}'
";
my
%devices
=
();
my
$count
=
1
;
if
(
open
(
PFD
,
"
$command
|
"))
{
while
(
my
$line
=
<
PFD
>
)
{
if
(
$line
=~
/\/dev\/(\w{2,3})/
)
{
$devices
{
$
1
}
=
$
1
;
}
}
close
(
PFD
);
$count
=
scalar
(
keys
(
%devices
));
}
return
$count
;
}
my
%if2mac
=
();
my
%mac2if
=
();
my
%ip2if
=
();
...
...
clientside/tmcc/linux/xen/libvnode_xen.pm
View file @
500d6719
...
...
@@ -222,6 +222,9 @@ my $RTTABLES = "/etc/iproute2/rt_tables";
# Temporary; later kernel version increases this.
my
$MAXROUTETTABLE
=
255
;
# Striping
my
$STRIPE_COUNT
=
1
;
# Whether or not to use only unpartitioned (unused) disks to form the Xen VG.
my
$LVM_FULLDISKONLY
=
0
;
...
...
@@ -310,16 +313,10 @@ sub init($)
}
getXenInfo
();
#
# The 4.4 image has to use the openvswitch package instead of building
# from source since the current release does not support the kernel.
# And the package is installed in a different place.
#
if
(
$xeninfo
{
xen_minor
}
>=
4
)
{
$OVSCTL
=
"
/usr/bin/ovs-vsctl
";
$OVSSTART
=
"
/usr/share/openvswitch/scripts/ovs-ctl
";
# Compute the strip size for new lvms.
if
(
-
e
"
/var/run/xen.ready
")
{
$STRIPE_COUNT
=
computeStripeSize
(
$VGNAME
);
}
return
0
;
}
...
...
@@ -470,9 +467,9 @@ sub rootPreConfig($)
}
#
# Make sure pieces are at least a GiB.
# Make sure pieces are at least a
5
GiB.
#
my
%devs
=
libvnode::
findSpareDisks
(
1
*
1024
);
my
%devs
=
libvnode::
findSpareDisks
(
5
*
1024
);
#
# Turn on write caching. Hacky.
...
...
@@ -580,7 +577,8 @@ sub rootPreConfig($)
"
$MAX_VNODES
VMs (
$size
<
$XEN_MIN_VGSIZE
)
\n
";
}
}
$STRIPE_COUNT
=
computeStripeSize
(
$VGNAME
);
#
# Make sure our volumes are active -- they seem to become inactive
# across reboots
...
...
@@ -1484,8 +1482,10 @@ sub vnodePreConfig($$$$$){
# Testing a theory; remove all this iscsi stuff to see if that
# is causing problems with the control network interface going
# offline after boot.
mysystem2
("
/bin/rm -vf
$vnoderoot
/etc/init/*iscsi*
");
mysystem2
("
/bin/rm -vf
$vnoderoot
/etc/init.d/*iscsi*
");
if
(
$xeninfo
{
xen_minor
}
<
4
)
{
mysystem2
("
/bin/rm -vf
$vnoderoot
/etc/init/*iscsi*
");
mysystem2
("
/bin/rm -vf
$vnoderoot
/etc/init.d/*iscsi*
");
}
}
else
{
#
...
...
@@ -2467,7 +2467,8 @@ sub CreatePrimaryDisk($$$$)
$lv_size
+=
$extrafs
*
(
1024
*
1024
);
}
}
if
(
mysystem2
("
lvcreate -L
${lv_size}
k -n
$target
$VGNAME
"))
{
if
(
mysystem2
("
lvcreate -i
${STRIPE_COUNT}
"
.
"
-L
${lv_size}
k -n
$target
$VGNAME
"))
{
print
STDERR
"
libvnode_xen: could not create disk for
$target
\n
";
return
-
1
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment