Ironic: Add deploy kernel and deploy ramdisk to driver_info

Pass deploy kernel and deploy ramdisk as parameters to the driver
to enable Ironic to support different deploy provisioning
methods using the same flavor. This patch is part of the
https://blueprints.launchpad.net/ironic/+spec/add-node-instance-info
work which is separating the instance-level data from the driver-leval
data in the Node's resource of Ironic, once it's finished another patch
will be submitted to DevStack to remove the part of the code which is
adding the deploy kernel and deploy ramdisk parameters to the flavor,
for now a TODO was left inline as a reminder.

Change-Id: Id7cfb17cc6f6133964be139bfedbca1dc644b9cd
Implements: blueprint add-node-instance-info
This commit is contained in:
Lucas Alvares Gomes 2014-05-26 14:58:37 +01:00
parent 1469a04f18
commit cd7cfef429

View File

@ -357,6 +357,8 @@ function enroll_vms {
while read MAC; do
NODE_ID=$(ironic node-create --chassis_uuid $CHASSIS_ID --driver pxe_ssh \
-i pxe_deploy_kernel=$IRONIC_DEPLOY_KERNEL_ID \
-i pxe_deploy_ramdisk=$IRONIC_DEPLOY_RAMDISK_ID \
-i ssh_virt_type=$IRONIC_SSH_VIRT_TYPE \
-i ssh_address=$IRONIC_VM_SSH_ADDRESS \
-i ssh_port=$IRONIC_VM_SSH_PORT \
@ -377,6 +379,10 @@ function enroll_vms {
# create the nova flavor
adjusted_disk=$(($IRONIC_VM_SPECS_DISK - $IRONIC_VM_EPHEMERAL_DISK))
nova flavor-create --ephemeral $IRONIC_VM_EPHEMERAL_DISK baremetal auto $IRONIC_VM_SPECS_RAM $adjusted_disk $IRONIC_VM_SPECS_CPU
# TODO(lucasagomes): Remove the 'baremetal:deploy_kernel_id'
# and 'baremetal:deploy_ramdisk_id' parameters
# from the flavor after the completion of
# https://blueprints.launchpad.net/ironic/+spec/add-node-instance-info
nova flavor-key baremetal set "cpu_arch"="x86_64" "baremetal:deploy_kernel_id"="$IRONIC_DEPLOY_KERNEL_ID" "baremetal:deploy_ramdisk_id"="$IRONIC_DEPLOY_RAMDISK_ID"
# intentional sleep to make sure the tag has been set to port