From 8c32e0df7bf35e860ce95e5db3c78e5d6dd33ff6 Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Wed, 4 Mar 2015 14:53:05 -0800 Subject: [PATCH] Set rootfstype=ramfs for low memory Ironic nodes When running with low memory (<1024), we need to switch from the default rootfstype from tmpfs to ramfs to ensure nodes can decompress deployment ramdisks. Change-Id: I1b9dd614e592d99b2f59dea899b1ed3859ae0811 --- lib/ironic | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/ironic b/lib/ironic index bc30cdbeba..325bee9060 100644 --- a/lib/ironic +++ b/lib/ironic @@ -343,13 +343,24 @@ function configure_ironic_conductor { iniset $IRONIC_CONF_FILE pxe tftp_server $IRONIC_TFTPSERVER_IP iniset $IRONIC_CONF_FILE pxe tftp_root $IRONIC_TFTPBOOT_DIR iniset $IRONIC_CONF_FILE pxe tftp_master_path $IRONIC_TFTPBOOT_DIR/master_images + + local pxe_params="" if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then - local pxe_params="nofb nomodeset vga=normal console=ttyS0" + pxe_params+="nofb nomodeset vga=normal console=ttyS0" if is_deployed_with_ipa_ramdisk; then pxe_params+=" systemd.journald.forward_to_console=yes" fi + fi + # When booting with less than 1GB, we need to switch from default tmpfs + # to ramfs for ramdisks to decompress successfully. + if (is_ironic_hardware && [[ "$IRONIC_HW_NODE_RAM" -lt 1024 ]]) || + (! is_ironic_hardware && [[ "$IRONIC_VM_SPECS_RAM" -lt 1024 ]]); then + pxe_params+=" rootfstype=ramfs" + fi + if [[ -n "$pxe_params" ]]; then iniset $IRONIC_CONF_FILE pxe pxe_append_params "$pxe_params" fi + if is_deployed_by_agent; then if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]] ; then iniset $IRONIC_CONF_FILE glance swift_temp_url_key $SWIFT_TEMPURL_KEY