Browse code

Merge "Add support for using IPA with iSCSI"

Jenkins authored on 2015/03/05 02:22:50
Showing 1 changed files
... ...
@@ -121,6 +121,16 @@ IRONIC_HTTP_DIR=${IRONIC_HTTP_DIR:-$IRONIC_DATA_DIR/httpboot}
121 121
 IRONIC_HTTP_SERVER=${IRONIC_HTTP_SERVER:-$HOST_IP}
122 122
 IRONIC_HTTP_PORT=${IRONIC_HTTP_PORT:-8088}
123 123
 
124
+# NOTE(lucasagomes): This flag is used to differentiate the nodes that
125
+# uses IPA as their deploy ramdisk from nodes that uses the agent_* drivers
126
+# (which also uses IPA but depends on Swift Temp URLs to work). At present,
127
+# all drivers that uses the iSCSI approach for their deployment supports
128
+# using both, IPA or bash ramdisks for the deployment. In the future we
129
+# want to remove the support for the bash ramdisk in favor of IPA, once
130
+# we get there this flag can be removed, and all conditionals that uses
131
+# it should just run by default.
132
+IRONIC_DEPLOY_DRIVER_ISCSI_WITH_IPA=$(trueorfalse False IRONIC_DEPLOY_DRIVER_ISCSI_WITH_IPA)
133
+
124 134
 # get_pxe_boot_file() - Get the PXE/iPXE boot file path
125 135
 function get_pxe_boot_file {
126 136
     local relpath=syslinux/pxelinux.0
... ...
@@ -162,6 +172,11 @@ function is_deployed_by_agent {
162 162
     return 1
163 163
 }
164 164
 
165
+function is_deployed_with_ipa_ramdisk {
166
+    is_deployed_by_agent || [[ "$IRONIC_DEPLOY_DRIVER_ISCSI_WITH_IPA" == "True" ]] && return 0
167
+    return 1
168
+}
169
+
165 170
 # install_ironic() - Collect source and prepare
166 171
 function install_ironic {
167 172
     # make sure all needed service were enabled
... ...
@@ -329,7 +344,11 @@ function configure_ironic_conductor {
329 329
     iniset $IRONIC_CONF_FILE pxe tftp_root $IRONIC_TFTPBOOT_DIR
330 330
     iniset $IRONIC_CONF_FILE pxe tftp_master_path $IRONIC_TFTPBOOT_DIR/master_images
331 331
     if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then
332
-        iniset $IRONIC_CONF_FILE pxe pxe_append_params "nofb nomodeset vga=normal console=ttyS0"
332
+        local pxe_params="nofb nomodeset vga=normal console=ttyS0"
333
+        if is_deployed_with_ipa_ramdisk; then
334
+            pxe_params+=" systemd.journald.forward_to_console=yes"
335
+        fi
336
+        iniset $IRONIC_CONF_FILE pxe pxe_append_params "$pxe_params"
333 337
     fi
334 338
     if is_deployed_by_agent; then
335 339
         if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]] ; then
... ...
@@ -344,9 +363,6 @@ function configure_ironic_conductor {
344 344
         iniset $IRONIC_CONF_FILE glance swift_container glance
345 345
         iniset $IRONIC_CONF_FILE glance swift_temp_url_duration 3600
346 346
         iniset $IRONIC_CONF_FILE agent heartbeat_timeout 30
347
-        if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then
348
-            iniset $IRONIC_CONF_FILE agent agent_pxe_append_params "nofb nomodeset vga=normal console=ttyS0 systemd.journald.forward_to_console=yes"
349
-        fi
350 347
     fi
351 348
 
352 349
     if [[ "$IRONIC_IPXE_ENABLED" == "True" ]] ; then
... ...
@@ -717,7 +733,7 @@ function upload_baremetal_ironic_deploy {
717 717
         if [ "$IRONIC_BUILD_DEPLOY_RAMDISK" = "True" ]; then
718 718
             # we can build them only if we're not offline
719 719
             if [ "$OFFLINE" != "True" ]; then
720
-                if is_deployed_by_agent; then
720
+                if is_deployed_with_ipa_ramdisk; then
721 721
                     build_ipa_coreos_ramdisk $IRONIC_DEPLOY_KERNEL_PATH $IRONIC_DEPLOY_RAMDISK_PATH
722 722
                 else
723 723
                     ramdisk-image-create $IRONIC_DEPLOY_FLAVOR \
... ...
@@ -727,7 +743,7 @@ function upload_baremetal_ironic_deploy {
727 727
                 die $LINENO "Deploy kernel+ramdisk files don't exist and cannot be build in OFFLINE mode"
728 728
             fi
729 729
         else
730
-            if is_deployed_by_agent; then
730
+            if is_deployed_with_ipa_ramdisk; then
731 731
                 # download the agent image tarball
732 732
                 wget "$IRONIC_AGENT_KERNEL_URL" -O $IRONIC_DEPLOY_KERNEL_PATH
733 733
                 wget "$IRONIC_AGENT_RAMDISK_URL" -O $IRONIC_DEPLOY_RAMDISK_PATH