[Ovirt-devel] [PATCH node] Changed max swap size to allow for overcommitting.
Darryl L. Pierce
dpierce at redhat.com
Tue Jan 13 22:33:41 UTC 2009
If the ovirt_overcommit kernel argument is passed, the value supplied
will override the default value, which is 2GB.
Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
---
scripts/ovirt-config-storage | 3 +--
scripts/ovirt-early | 14 +++++++++++++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage
index b3d87ae..71e5575 100755
--- a/scripts/ovirt-config-storage
+++ b/scripts/ovirt-config-storage
@@ -289,8 +289,7 @@ MEM_SIZE=$(cat /proc/meminfo | awk '/MemTotal:/ { print $2 }')
case $MEM_SIZE in
''|*[^0-9]*) die failed to get system memory size;;
esac
-
-MEM_SIZE=$(echo "scale=0; m=($MEM_SIZE / 1024 * 2); if (m < 2048) { m } else { 2048 }" | bc -l)
+MEM_SIZE=$(echo "scale=0; m=($MEM_SIZE / 1024 * 2); if (m < ${OVIRT_OVERCOMMIT}) { m } else { ${OVIRT_OVERCOMMIT} }" | bc -l)
SWAP_SIZE=${OVIRT_VOL_SWAP_SIZE:-$MEM_SIZE}
BOOT_SIZE=${OVIRT_VOL_BOOT_SIZE:-$default_boot_size}
diff --git a/scripts/ovirt-early b/scripts/ovirt-early
index 153c0c7..9031ad8 100755
--- a/scripts/ovirt-early
+++ b/scripts/ovirt-early
@@ -117,6 +117,7 @@ start() {
# BOOTIF=link|eth*|<MAC> (appended by pxelinux)
# ovirt_init=usb|scsi[:serial#]
# ovirt_vol=BOOT_MB:SWAP_MB:ROOT_MB:CONFIG_MB:LOGGING_MB
+ # ovirt_overcommit
# ovirt_local_boot
# ovirt_standalone
# pxelinux format: ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask>
@@ -156,6 +157,11 @@ start() {
# install/update oVirt Node image on the local installation target disk
local_boot=0
+ # ovirt_overcommit
+ # set the overcommit size for the swap partition, in megabytes
+ # default is 2204 maximum
+ overcommit=2048
+
# ovirt_standalone
# force oVirt Node standalone mode
standalone=0
@@ -245,6 +251,12 @@ start() {
standalone=1
bootparams="$bootparams $i"
;;
+
+ ovirt_overcommit*)
+ i=${i#ovirt_overcommit=}
+ eval $(printf $i|awk -F: '{print "overcommit="$1;}')
+ ;;
+
ip=*)
i=${i#ip=}
eval $(printf $i|awk -F: '{print "ip_address="$1; print "ip_gateway="$3; print "ip_netmask="$4}')
@@ -278,7 +290,7 @@ start() {
ip_gateway=$gateway
fi
# save boot parameters as defaults for ovirt-config-*
- params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size local_boot standalone ip_address ip_netmask ip_gateway ipv6 syslog_server syslog_port bootparams hostname"
+ params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size local_boot standalone overcommit ip_address ip_netmask ip_gateway ipv6 syslog_server syslog_port bootparams hostname"
mount_config
if [ -e $OVIRT_DEFAULTS ]; then
echo "update ovirt defaults"
--
1.6.0.6
More information about the ovirt-devel
mailing list