Perry Myers
2009-Jan-25 22:37 UTC
[Ovirt-devel] [PATCH node] Allow user to force firstboot even on already installed Nodes
Signed-off-by: Perry Myers <pmyers at redhat.com> --- scripts/ovirt-early | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 6a59605..c61fe3b 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -120,6 +120,7 @@ start() { # ovirt_overcommit=<overcommit_ratio> # ovirt_local_boot # ovirt_standalone + # ovirt_firstboot # pxelinux format: ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask> # anaconda format: ip=<client-ip> netmask=<netmask> gateway=<gw-ip> # ipv6=dhcp|auto @@ -171,6 +172,10 @@ start() { # force oVirt Node standalone mode standalone=0 + # ovirt_firstboot + # force firstboot configuration even if it has already been run + firstboot+ # pxelinux format: ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask> # anaconda format: ip=<client-ip> netmask=<netmask> gateway=<gw-ip> # ipv6=dhcp|auto @@ -263,6 +268,9 @@ start() { standalone=1 bootparams="$bootparams $i" ;; + ovirt_firstboot*) + firstboot=1 + ;; ovirt_overcommit*) i=${i#ovirt_overcommit=} @@ -309,7 +317,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 vol_data_size local_boot standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns syslog_server syslog_port collectd_server collectd_port bootparams hostname" + params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size local_boot standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot" mount_config if [ -e $OVIRT_DEFAULTS ]; then log "update ovirt defaults" -- 1.6.0.6
Perry Myers
2009-Jan-25 22:37 UTC
[Ovirt-devel] [PATCH node] Only set parameters in defaults/ovirt for params that have been explicitly set on kernel commandline
Signed-off-by: Perry Myers <pmyers at redhat.com> --- scripts/ovirt-config-storage | 6 +++++- scripts/ovirt-early | 37 ++++++++++++++----------------------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 9912118..45355fd 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -15,6 +15,8 @@ die() { warn "$*"; exit 1; } trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 +default_overcommit=0.5 + default_boot_size=50 default_root_size=256 default_config_size=5 @@ -427,9 +429,11 @@ case $MEM_SIZE_MB in ''|*[^0-9]*) die failed to get system memory size;; esac MEM_SIZE_MB=$(echo "scale=0; $MEM_SIZE_MB / 1024;" | bc -l) + +overcommit=${OVIRT_OVERCOMMIT:-$default_overcommit} # we multiply the overcommit coefficient by 10 then divide the # product by 10 to avoid decimals in the result -OVERCOMMIT_SWAP_SIZE=$(echo "scale=0; (${MEM_SIZE_MB} * (${OVIRT_OVERCOMMIT} * 10))/10;" | bc -l) +OVERCOMMIT_SWAP_SIZE=$(echo "scale=0; (${MEM_SIZE_MB} * (${overcommit} * 10))/10;" | bc -l) # add to the swap the amounts from kbase.redhat.com/faq/docs/DOC-15252 MEM_SIZE_GB=$(echo "scale=0; $MEM_SIZE_MB/1024;" | bc -l) diff --git a/scripts/ovirt-early b/scripts/ovirt-early index c61fe3b..0f5bb27 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -162,15 +162,15 @@ start() { # ovirt_local_boot # install/update oVirt Node image on the local installation target disk - local_boot=0 + local_boot # ovirt_overcommit=<overcommit_ratio> # set the swap size coefficient - overcommit=0.5 + overcommit # ovirt_standalone # force oVirt Node standalone mode - standalone=0 + standalone # ovirt_firstboot # force firstboot configuration even if it has already been run @@ -319,34 +319,25 @@ start() { # 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 vol_data_size local_boot standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot" mount_config - if [ -e $OVIRT_DEFAULTS ]; then - log "update ovirt defaults" - tmpaug=$(mktemp) - for p in $params; do - PARAM=$(uc $p) - value=$(ptr $p) + log "Updating $OVIRT_DEFAULTS" + tmpaug=$(mktemp) + for p in $params; do + PARAM=$(uc $p) + value=$(ptr $p) + if [ -n "$value" ]; then + log "Updating OVIRT_$PARAM to '$value'" echo "set /files$OVIRT_DEFAULTS/OVIRT_$PARAM '\"$value\"'" \ >> $tmpaug - done - augtool $tmpaug - else - log "initial startup" - # dump all ovirt bootparams - mkdir -p $(dirname $OVIRT_DEFAULTS) - echo > $OVIRT_DEFAULTS - for p in $params; do - PARAM=$(uc $p) - echo "OVIRT_$PARAM='$(ptr $p)'" >> $OVIRT_DEFAULTS - done - ovirt_store_config $OVIRT_DEFAULTS - fi + fi + done + augtool $tmpaug if [ -f /etc/sysconfig/network ]; then . /etc/sysconfig/network hostname $HOSTNAME fi - if [ $standalone = 0 ]; then + if [ ! $standalone = 1 ]; then configure_from_network $bootif if [ -n "$init" ]; then ovirt-config-storage AUTO -- 1.6.0.6