Browse code

Merge "Set rootfstype=ramfs for low memory Ironic nodes"

Jenkins authored on 2015/03/09 21:04:49
Showing 1 changed files
... ...
@@ -343,13 +343,24 @@ function configure_ironic_conductor {
343 343
     iniset $IRONIC_CONF_FILE pxe tftp_server $IRONIC_TFTPSERVER_IP
344 344
     iniset $IRONIC_CONF_FILE pxe tftp_root $IRONIC_TFTPBOOT_DIR
345 345
     iniset $IRONIC_CONF_FILE pxe tftp_master_path $IRONIC_TFTPBOOT_DIR/master_images
346
+
347
+    local pxe_params=""
346 348
     if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then
347
-        local pxe_params="nofb nomodeset vga=normal console=ttyS0"
349
+        pxe_params+="nofb nomodeset vga=normal console=ttyS0"
348 350
         if is_deployed_with_ipa_ramdisk; then
349 351
             pxe_params+=" systemd.journald.forward_to_console=yes"
350 352
         fi
353
+    fi
354
+    # When booting with less than 1GB, we need to switch from default tmpfs
355
+    # to ramfs for ramdisks to decompress successfully.
356
+    if (is_ironic_hardware && [[ "$IRONIC_HW_NODE_RAM" -lt 1024 ]]) ||
357
+        (! is_ironic_hardware && [[ "$IRONIC_VM_SPECS_RAM" -lt 1024 ]]); then
358
+        pxe_params+=" rootfstype=ramfs"
359
+    fi
360
+    if [[ -n "$pxe_params" ]]; then
351 361
         iniset $IRONIC_CONF_FILE pxe pxe_append_params "$pxe_params"
352 362
     fi
363
+
353 364
     if is_deployed_by_agent; then
354 365
         if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]] ; then
355 366
             iniset $IRONIC_CONF_FILE glance swift_temp_url_key $SWIFT_TEMPURL_KEY