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-devel
Commits
17460587
Commit
17460587
authored
May 21, 2012
by
Leigh B Stoller
Browse files
Allow boss to override the disk size via the VDSIZE jailconfig
variable.
parent
b1a64f50
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/linux/openvz/libvnode_openvz.pm
View file @
17460587
...
...
@@ -818,10 +818,10 @@ sub vz_vnodeCreate {
return
-
1
;
}
if
(
$DOLVM
)
{
my
$MIN_ROOT_LVM_VOL_SIZE
=
1024
;
my
$MIN_ROOT_LVM_VOL_SIZE
=
2
*
2048
;
my
$MAX_ROOT_LVM_VOL_SIZE
=
8
*
1024
;
my
$MIN_SNAPSHOT_VOL_SIZE
=
512
;
my
$MAX_SNAPSHOT_VOL_SIZE
=
$MAX_ROOT_LVM_VOL_SIZE
;
my
$MAX_SNAPSHOT_VOL_SIZE
=
8
*
1024
;
# XXX size our snapshots to assume 50 VMs on the node.
my
$MAX_NUM_VMS
=
50
;
...
...
@@ -849,7 +849,7 @@ sub vz_vnodeCreate {
close
(
VFD
);
if
(
defined
(
$vgSize
))
{
$vgSize
/=
50
;
$vgSize
/=
$MAX_NUM_VMS
;
if
(
$vgSize
<
$MIN_ROOT_LVM_VOL_SIZE
)
{
$rootSize
=
int
(
$MIN_ROOT_LVM_VOL_SIZE
);
...
...
@@ -865,6 +865,22 @@ sub vz_vnodeCreate {
}
}
#
# Lastly, allow the server to override the snapshot size,
# although we enforce the minimum, and do not allow it to be
# greater then the underlying size since that would break things.
#
if
(
exists
(
$vnconfig
->
{'
config
'}
->
{'
VDSIZE
'}))
{
#
# Value in MB.
#
my
$vdsize
=
$vnconfig
->
{'
config
'}
->
{'
VDSIZE
'};
$snapSize
=
$vdsize
if
(
$vdsize
>
$MIN_SNAPSHOT_VOL_SIZE
&&
$vdsize
<=
$rootSize
);
}
print
STDERR
"
Using LVM with root size
$rootSize
MB, snapshot size
$snapSize
MB.
\n
";
# we must have the lock, so if we need to return right away, unlock
...
...
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