Browse code

Add support for using IPA with iSCSI

This patch is adding a new boolean that can be toggled to indicate
that we should use the IPA ramdisk instead of the normal ramdisk when
deploying a node with the iSCSI methodology. Defaults to False.

Depends-On: Iaabc6ada729461f18d69ee12d01b9f1465944454
Change-Id: If4004078866d833eb946be40b6dfb204aa4a6840

Lucas Alvares Gomes authored on 2015/02/25 21:38:47
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
... ...
@@ -310,7 +325,11 @@ function configure_ironic_conductor {
310 310
     iniset $IRONIC_CONF_FILE pxe tftp_root $IRONIC_TFTPBOOT_DIR
311 311
     iniset $IRONIC_CONF_FILE pxe tftp_master_path $IRONIC_TFTPBOOT_DIR/master_images
312 312
     if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then
313
-        iniset $IRONIC_CONF_FILE pxe pxe_append_params "nofb nomodeset vga=normal console=ttyS0"
313
+        local pxe_params="nofb nomodeset vga=normal console=ttyS0"
314
+        if is_deployed_with_ipa_ramdisk; then
315
+            pxe_params+=" systemd.journald.forward_to_console=yes"
316
+        fi
317
+        iniset $IRONIC_CONF_FILE pxe pxe_append_params "$pxe_params"
314 318
     fi
315 319
     if is_deployed_by_agent; then
316 320
         if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]] ; then
... ...
@@ -325,9 +344,6 @@ function configure_ironic_conductor {
325 325
         iniset $IRONIC_CONF_FILE glance swift_container glance
326 326
         iniset $IRONIC_CONF_FILE glance swift_temp_url_duration 3600
327 327
         iniset $IRONIC_CONF_FILE agent heartbeat_timeout 30
328
-        if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then
329
-            iniset $IRONIC_CONF_FILE agent agent_pxe_append_params "nofb nomodeset vga=normal console=ttyS0 systemd.journald.forward_to_console=yes"
330
-        fi
331 328
     fi
332 329
 
333 330
     if [[ "$IRONIC_IPXE_ENABLED" == "True" ]] ; then
... ...
@@ -698,7 +714,7 @@ function upload_baremetal_ironic_deploy {
698 698
         if [ "$IRONIC_BUILD_DEPLOY_RAMDISK" = "True" ]; then
699 699
             # we can build them only if we're not offline
700 700
             if [ "$OFFLINE" != "True" ]; then
701
-                if is_deployed_by_agent; then
701
+                if is_deployed_with_ipa_ramdisk; then
702 702
                     build_ipa_coreos_ramdisk $IRONIC_DEPLOY_KERNEL_PATH $IRONIC_DEPLOY_RAMDISK_PATH
703 703
                 else
704 704
                     ramdisk-image-create $IRONIC_DEPLOY_FLAVOR \
... ...
@@ -708,7 +724,7 @@ function upload_baremetal_ironic_deploy {
708 708
                 die $LINENO "Deploy kernel+ramdisk files don't exist and cannot be build in OFFLINE mode"
709 709
             fi
710 710
         else
711
-            if is_deployed_by_agent; then
711
+            if is_deployed_with_ipa_ramdisk; then
712 712
                 # download the agent image tarball
713 713
                 wget "$IRONIC_AGENT_KERNEL_URL" -O $IRONIC_DEPLOY_KERNEL_PATH
714 714
                 wget "$IRONIC_AGENT_RAMDISK_URL" -O $IRONIC_DEPLOY_RAMDISK_PATH