diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 8bef112419..a0c4c7707b 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -95,6 +95,10 @@ IRONIC_VM_LOG_ROTATE=$(trueorfalse True IRONIC_VM_LOG_ROTATE) # Use DIB to create deploy ramdisk and kernel. IRONIC_BUILD_DEPLOY_RAMDISK=$(trueorfalse True IRONIC_BUILD_DEPLOY_RAMDISK) + +# Ironic IPA ramdisk type, supported types are: coreos, tinyipa. +IRONIC_RAMDISK_TYPE=${IRONIC_RAMDISK_TYPE:-coreos} + # If not use DIB, these files are used as deploy ramdisk/kernel. # (The value must be an absolute path) IRONIC_DEPLOY_RAMDISK=${IRONIC_DEPLOY_RAMDISK:-} @@ -791,6 +795,20 @@ function build_ipa_coreos_ramdisk { cd - } +function build_tinyipa_ramdisk { + echo "Building ironic-python-agent deploy ramdisk" + local kernel_path=$1 + local ramdisk_path=$2 + git_clone $IRONIC_PYTHON_AGENT_REPO $IRONIC_PYTHON_AGENT_DIR $IRONIC_PYTHON_AGENT_BRANCH + cd $IRONIC_PYTHON_AGENT_DIR/imagebuild/tinyipa + export BUILD_AND_INSTALL_TINYIPA=true + make + cp tinyipa.gz $ramdisk_path + cp tinyipa.vmlinuz $kernel_path + make clean + cd - +} + # build deploy kernel+ramdisk, then upload them to glance # this function sets ``IRONIC_DEPLOY_KERNEL_ID``, ``IRONIC_DEPLOY_RAMDISK_ID`` function upload_baremetal_ironic_deploy { @@ -816,7 +834,13 @@ function upload_baremetal_ironic_deploy { # we can build them only if we're not offline if [ "$OFFLINE" != "True" ]; then if is_deployed_with_ipa_ramdisk; then - build_ipa_coreos_ramdisk $IRONIC_DEPLOY_KERNEL_PATH $IRONIC_DEPLOY_RAMDISK_PATH + if [ "$IRONIC_RAMDISK_TYPE" == "coreos" ]; then + build_ipa_coreos_ramdisk $IRONIC_DEPLOY_KERNEL_PATH $IRONIC_DEPLOY_RAMDISK_PATH + elif [ "$IRONIC_RAMDISK_TYPE" == "tinyipa" ]; then + build_tinyipa_ramdisk $IRONIC_DEPLOY_KERNEL_PATH $IRONIC_DEPLOY_RAMDISK_PATH + else + die $LINENO "Unrecognised IRONIC_RAMDISK_TYPE: $IRONIC_RAMDISK_TYPE. Expected 'coreos' or 'tinyipa'" + fi else ramdisk-image-create $IRONIC_DEPLOY_FLAVOR \ -o $TOP_DIR/files/ir-deploy-$IRONIC_DEPLOY_DRIVER