From 29c3d63b28503a06b15daecdf584753e0c0aafe8 Mon Sep 17 00:00:00 2001
From: Adam Gandelman <adamg@ubuntu.com>
Date: Thu, 17 Jul 2014 12:53:21 -0700
Subject: [PATCH] Set flavor id for Ironic's baremetal flavor

An existing trove bug prevents it from functioning when Nova flavors exist
with an id that is a UUID instead of an integer, causing Tempest failures.
This sets an integer ID when creating the baremetal flavor for Ironic's use.

Change-Id: Ic090f61a9a47421117dc86b640422f00f468112c
Related-bug: #1333852
---
 lib/ironic | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/ironic b/lib/ironic
index 469f3a3cb9..56dcd8cb35 100644
--- a/lib/ironic
+++ b/lib/ironic
@@ -495,8 +495,12 @@ function enroll_vms {
     done < $IRONIC_VM_MACS_CSV_FILE
 
     # create the nova flavor
+    # NOTE(adam_g): Attempting to use an autogenerated UUID for flavor id here uncovered
+    # bug (LP: #1333852) in Trove.  This can be changed to use an auto flavor id when the
+    # bug is fixed in Juno.
     local 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
+    nova flavor-create --ephemeral $IRONIC_VM_EPHEMERAL_DISK baremetal 551 $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