1
0
mirror of synced 2026-01-30 21:16:31 +00:00

Merge branch 'maxmem' of gitorious.org:xen-tools/aseques-xen-tools

This commit is contained in:
Axel Beckert
2013-10-23 13:59:16 +02:00
6 changed files with 42 additions and 0 deletions

View File

@@ -134,6 +134,13 @@ and EVMS EXAMPLE.
"MB", "G" and "GB" (case does not matter). If there's
no unit given, megabytes are assumed.
--maxmem=size
Setup the maximum amount of memory that can be allocated
to the new instance. As suffix recognized size units are "M",
"MB", "G" and "GB" (case does not matter). If there's
no unit given, megabytes are assumed.
Required for dynamic memory ballooning.
--modules=/path/to/modules
Set the path to the kernel modules to use for domU.
If modules are specified they must exist.
@@ -418,6 +425,7 @@ Create a Xen configuration file in so that xm/xl can start the new domain.
size = 2Gb # Disk image size.
image = full # Allocate the full disk size immediately.
memory = 128Mb # Memory size
maxmem = 512Mb # Memory size
swap = 128Mb # Swap size
fs = ext3 # use EXT3 filesystems
dist = stable # Default distribution to install.
@@ -1511,6 +1519,7 @@ sub checkOption
swap => 'integerWithSuffix',
image => 'imageType',
memory => 'integerWithSuffix',
maxmem => 'integerWithSuffix',
kernel => 'existingFile',
initrd => 'existingFile',
modules => 'existingDir',
@@ -1609,6 +1618,7 @@ sub parseCommandLineArguments
"noswap", \&checkOption,
"image=s", \&checkOption,
"memory=s", \&checkOption,
"maxmem=s", \&checkOption,
"vcpus=i", \&checkOption,
# Locations
@@ -2641,6 +2651,11 @@ sub showSummary
logprint("Image type : $CONFIG{'image'}\n");
logprint("Memory size : $CONFIG{'memory'}\n");
if ( defined( $CONFIG{ 'maxmem' } ) )
{
logprint("Max mem size : $CONFIG{'maxmem'}\n");
}
if ( defined( $CONFIG{ 'kernel' } ) && length( $CONFIG{ 'kernel' } ) )
{
logprint("Kernel path : $CONFIG{'kernel'}\n");

View File

@@ -374,6 +374,21 @@ sub createXenConfig
$ENV{ 'memory' } = $1;
}
#
# The maxmem size: Convert Gb -> Mb.
#
if ( $ENV{ 'maxmem' } =~ /^(\d+)Gb?.*$/i )
{
$ENV{ 'maxmem' } = $1 * 1024;
}
#
# Remove any trailing Mb.
#
if ( $ENV{ 'maxmem' } =~ /^(\d+)Mb?.*$/i )
{
$ENV{ 'maxmem' } = $1;
}
#
# Images as presented to Xen - either loopback images, or LVM partitions.

1
debian/changelog vendored
View File

@@ -1,5 +1,6 @@
xen-tools (4.4~dev-1) UNRELEASED; urgency=low
* Added --maxmem flag to set a maximum value for dynamic memory ballooning
* Also switch from cdn.debian.net to http.debian.net in xen-tools.conf
* Do not run "passwd" via runCommand as that one captures STDOUT for
logging. Makes --passwd usable again. Thanks to Christian Herzog for

View File

@@ -127,6 +127,7 @@ install-method = debootstrap
#
size = 4G # Root disk, suffix (G, M, k) required
memory = 128M # Suffix (G, M, k) required
#maxmem = 256M # Suffix (G, M, k) optional
swap = 128M # Suffix (G, M, k) required
# noswap = 1 # Don't use swap at all for new systems.
fs = ext3 # Default file system for any disk

View File

@@ -17,6 +17,11 @@
}
}
memory = '{$memory}'
{ if ( $maxmem )
{
$OUT .= "maxmem = '$maxmem'\n";
}
}
# Name

View File

@@ -37,6 +37,11 @@
}
vcpus = '{$vcpus}'
memory = '{$memory}'
{ if ( $maxmem )
{
$OUT .= "maxmem = '$maxmem'\n";
}
}
#
# Disk device(s).