This patch enables to use the agent_ipmitool deploy driver to
deploy the ironic on real hardware, instead of virtual machine.
It also append the deploy driver name to the kernel/ramdisk
path, so that if developer switch the deploy driver after
./unstack.sh, devstack will use the correct kernel/ramdisk.
Change-Id: Iac0415f6895d037c876e137aa4f2bf2990eb47c5
| ... | ... |
@@ -93,7 +93,7 @@ IRONIC_AGENT_KERNEL_URL=${IRONIC_AGENT_KERNEL_URL:-http://tarballs.openstack.org
|
| 93 | 93 |
IRONIC_AGENT_RAMDISK_URL=${IRONIC_AGENT_RAMDISK_URL:-http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem.cpio.gz}
|
| 94 | 94 |
|
| 95 | 95 |
# Which deploy driver to use - valid choices right now |
| 96 |
-# are 'pxe_ssh', 'pxe_ipmitool' and 'agent_ssh'. |
|
| 96 |
+# are 'pxe_ssh', 'pxe_ipmitool', 'agent_ssh' and 'agent_ipmitool'. |
|
| 97 | 97 |
IRONIC_DEPLOY_DRIVER=${IRONIC_DEPLOY_DRIVER:-pxe_ssh}
|
| 98 | 98 |
|
| 99 | 99 |
#TODO(agordeev): replace 'ubuntu' with host distro name getting |
| ... | ... |
@@ -152,6 +152,11 @@ function is_ironic_hardware {
|
| 152 | 152 |
return 1 |
| 153 | 153 |
} |
| 154 | 154 |
|
| 155 |
+function is_deployed_by_agent {
|
|
| 156 |
+ [[ -z "${IRONIC_DEPLOY_DRIVER%%agent*}" ]] && return 0
|
|
| 157 |
+ return 1 |
|
| 158 |
+} |
|
| 159 |
+ |
|
| 155 | 160 |
# install_ironic() - Collect source and prepare |
| 156 | 161 |
function install_ironic {
|
| 157 | 162 |
# make sure all needed service were enabled |
| ... | ... |
@@ -307,7 +312,7 @@ function configure_ironic_conductor {
|
| 307 | 307 |
if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then |
| 308 | 308 |
iniset $IRONIC_CONF_FILE pxe pxe_append_params "nofb nomodeset vga=normal console=ttyS0" |
| 309 | 309 |
fi |
| 310 |
- if [[ "$IRONIC_DEPLOY_DRIVER" == "agent_ssh" ]] ; then |
|
| 310 |
+ if is_deployed_by_agent; then |
|
| 311 | 311 |
if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]] ; then |
| 312 | 312 |
iniset $IRONIC_CONF_FILE glance swift_temp_url_key $SWIFT_TEMPURL_KEY |
| 313 | 313 |
else |
| ... | ... |
@@ -510,7 +515,7 @@ function enroll_nodes {
|
| 510 | 510 |
if [[ "$IRONIC_DEPLOY_DRIVER" == "pxe_ssh" ]] ; then |
| 511 | 511 |
local _IRONIC_DEPLOY_KERNEL_KEY=pxe_deploy_kernel |
| 512 | 512 |
local _IRONIC_DEPLOY_RAMDISK_KEY=pxe_deploy_ramdisk |
| 513 |
- elif [[ "$IRONIC_DEPLOY_DRIVER" == "agent_ssh" ]] ; then |
|
| 513 |
+ elif is_deployed_by_agent; then |
|
| 514 | 514 |
local _IRONIC_DEPLOY_KERNEL_KEY=deploy_kernel |
| 515 | 515 |
local _IRONIC_DEPLOY_RAMDISK_KEY=deploy_ramdisk |
| 516 | 516 |
fi |
| ... | ... |
@@ -552,6 +557,10 @@ function enroll_nodes {
|
| 552 | 552 |
# we create the bare metal flavor with minimum value |
| 553 | 553 |
local node_options="-i ipmi_address=$ipmi_address -i ipmi_password=$ironic_ipmi_passwd\ |
| 554 | 554 |
-i ipmi_username=$ironic_ipmi_username" |
| 555 |
+ if is_deployed_by_agent; then |
|
| 556 |
+ node_options+=" -i $_IRONIC_DEPLOY_KERNEL_KEY=$IRONIC_DEPLOY_KERNEL_ID" |
|
| 557 |
+ node_options+=" -i $_IRONIC_DEPLOY_RAMDISK_KEY=$IRONIC_DEPLOY_RAMDISK_ID" |
|
| 558 |
+ fi |
|
| 555 | 559 |
fi |
| 556 | 560 |
|
| 557 | 561 |
local node_id=$(ironic node-create --chassis_uuid $chassis_id \ |
| ... | ... |
@@ -589,7 +598,7 @@ function configure_iptables {
|
| 589 | 589 |
# nodes boot from TFTP and callback to the API server listening on $HOST_IP |
| 590 | 590 |
sudo iptables -I INPUT -d $HOST_IP -p udp --dport 69 -j ACCEPT || true |
| 591 | 591 |
sudo iptables -I INPUT -d $HOST_IP -p tcp --dport $IRONIC_SERVICE_PORT -j ACCEPT || true |
| 592 |
- if [ "$IRONIC_DEPLOY_DRIVER" == "agent_ssh" ]; then |
|
| 592 |
+ if is_deployed_by_agent; then |
|
| 593 | 593 |
# agent ramdisk gets instance image from swift |
| 594 | 594 |
sudo iptables -I INPUT -d $HOST_IP -p tcp --dport ${SWIFT_DEFAULT_BIND_PORT:-8080} -j ACCEPT || true
|
| 595 | 595 |
fi |
| ... | ... |
@@ -665,8 +674,8 @@ function upload_baremetal_ironic_deploy {
|
| 665 | 665 |
fi |
| 666 | 666 |
|
| 667 | 667 |
if [ -z "$IRONIC_DEPLOY_KERNEL" -o -z "$IRONIC_DEPLOY_RAMDISK" ]; then |
| 668 |
- local IRONIC_DEPLOY_KERNEL_PATH=$TOP_DIR/files/ir-deploy.kernel |
|
| 669 |
- local IRONIC_DEPLOY_RAMDISK_PATH=$TOP_DIR/files/ir-deploy.initramfs |
|
| 668 |
+ local IRONIC_DEPLOY_KERNEL_PATH=$TOP_DIR/files/ir-deploy-$IRONIC_DEPLOY_DRIVER.kernel |
|
| 669 |
+ local IRONIC_DEPLOY_RAMDISK_PATH=$TOP_DIR/files/ir-deploy-$IRONIC_DEPLOY_DRIVER.initramfs |
|
| 670 | 670 |
else |
| 671 | 671 |
local IRONIC_DEPLOY_KERNEL_PATH=$IRONIC_DEPLOY_KERNEL |
| 672 | 672 |
local IRONIC_DEPLOY_RAMDISK_PATH=$IRONIC_DEPLOY_RAMDISK |
| ... | ... |
@@ -677,17 +686,17 @@ function upload_baremetal_ironic_deploy {
|
| 677 | 677 |
if [ "$IRONIC_BUILD_DEPLOY_RAMDISK" = "True" ]; then |
| 678 | 678 |
# we can build them only if we're not offline |
| 679 | 679 |
if [ "$OFFLINE" != "True" ]; then |
| 680 |
- if [ "$IRONIC_DEPLOY_DRIVER" == "agent_ssh" ]; then |
|
| 680 |
+ if is_deployed_by_agent; then |
|
| 681 | 681 |
build_ipa_coreos_ramdisk $IRONIC_DEPLOY_KERNEL_PATH $IRONIC_DEPLOY_RAMDISK_PATH |
| 682 | 682 |
else |
| 683 | 683 |
ramdisk-image-create $IRONIC_DEPLOY_FLAVOR \ |
| 684 |
- -o $TOP_DIR/files/ir-deploy |
|
| 684 |
+ -o $TOP_DIR/files/ir-deploy-$IRONIC_DEPLOY_DRIVER |
|
| 685 | 685 |
fi |
| 686 | 686 |
else |
| 687 | 687 |
die $LINENO "Deploy kernel+ramdisk files don't exist and cannot be build in OFFLINE mode" |
| 688 | 688 |
fi |
| 689 | 689 |
else |
| 690 |
- if [ "$IRONIC_DEPLOY_DRIVER" == "agent_ssh" ]; then |
|
| 690 |
+ if is_deployed_by_agent; then |
|
| 691 | 691 |
# download the agent image tarball |
| 692 | 692 |
wget "$IRONIC_AGENT_KERNEL_URL" -O $IRONIC_DEPLOY_KERNEL_PATH |
| 693 | 693 |
wget "$IRONIC_AGENT_RAMDISK_URL" -O $IRONIC_DEPLOY_RAMDISK_PATH |
| ... | ... |
@@ -751,7 +760,7 @@ function cleanup_baremetal_basic_ops {
|
| 751 | 751 |
restart_service xinetd |
| 752 | 752 |
sudo iptables -D INPUT -d $HOST_IP -p udp --dport 69 -j ACCEPT || true |
| 753 | 753 |
sudo iptables -D INPUT -d $HOST_IP -p tcp --dport $IRONIC_SERVICE_PORT -j ACCEPT || true |
| 754 |
- if [ "$IRONIC_DEPLOY_DRIVER" == "agent_ssh" ]; then |
|
| 754 |
+ if is_deployed_by_agent; then |
|
| 755 | 755 |
# agent ramdisk gets instance image from swift |
| 756 | 756 |
sudo iptables -D INPUT -d $HOST_IP -p tcp --dport ${SWIFT_DEFAULT_BIND_PORT:-8080} -j ACCEPT || true
|
| 757 | 757 |
fi |