From 01488938cf3be19b0d1a357543299e48f87a5a58 Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Wed, 11 Apr 2012 20:56:45 -0400 Subject: [PATCH] Add 32-bit tdls for Fedora 16,17 jeos (gold and cfntools) fixes #26 Note that the templates have been adjusted and the naming of the 32-bit versions to i386 instead of i686. The install really is i686, but making the arch match what is listed in the install ISO seems less confusing. Signed-off-by: Jeff Peeler Although the 32-bit version of Fedora (and others) ISOs are labeled with i386, --- bin/heat | 36 +++++------ heat/engine/resources.py | 1 + heat/jeos/F16-i386-cfntools-jeos.tdl | 61 +++++++++++++++++++ heat/jeos/F16-i386-gold-jeos.tdl | 61 +++++++++++++++++++ heat/jeos/F17-i386-cfntools-jeos.tdl | 61 +++++++++++++++++++ heat/jeos/F17-i386-gold-jeos.tdl | 61 +++++++++++++++++++ templates/WordPress_2_Instances.template | 12 ++-- ...Press_2_Instances_With_EBS_Volume.template | 12 ++-- templates/WordPress_Single_Instance.template | 12 ++-- ...s_Single_Instance_With_EBS_Volume.template | 12 ++-- ...ordPress_Single_Instance_cfntools.template | 12 ++-- 11 files changed, 294 insertions(+), 47 deletions(-) create mode 100644 heat/jeos/F16-i386-cfntools-jeos.tdl create mode 100644 heat/jeos/F16-i386-gold-jeos.tdl create mode 100644 heat/jeos/F17-i386-cfntools-jeos.tdl create mode 100644 heat/jeos/F17-i386-gold-jeos.tdl diff --git a/bin/heat b/bin/heat index 9bc81710..7c547301 100755 --- a/bin/heat +++ b/bin/heat @@ -17,6 +17,7 @@ import time import json import base64 import libxml2 +import re from urlparse import urlparse # If ../heat/__init__.py exists, add ../ to Python search path, so that @@ -249,34 +250,35 @@ def jeos_create(options, arguments): arch = arguments.pop(0) instance_type = arguments.pop(0) - if not arch in ['x86_64', 'i686']: + arches = ('x86_64', 'i386', 'amd64') + arches_str = " | ".join(arches) + instance_types = ('gold', 'cfntools') + instances_str = " | ".join(instance_types) + + if not arch in arches: print 'arch %s not supported' % arch - print 'try: x86_64 or i686' + print 'try: heat jeos_create %s [ %s ]' % (distro, arches_str) sys.exit(1) - if not instance_type in ('gold', 'cfntools'): + if not instance_type in instance_types: print 'A JEOS instance type of %s not supported' % instance_type - print 'try: gold or cfntools' + print 'try: heat jeos_create %s %s [ %s ]' % (distro, arch, instances_str) sys.exit(1) - iso = None - if distro == 'F16': - iso = '/var/lib/libvirt/images/Fedora-16-x86_64-DVD.iso' - elif distro == 'F15': - iso = '/var/lib/libvirt/images/Fedora-15-x86_64-DVD.iso' - elif distro == 'F17': - iso = '/var/lib/libvirt/images/Fedora-17-x86_64-DVD.iso' + fedora_match = re.match('F(1[6-7])', distro) + if fedora_match: + version = fedora_match.group(1) + iso = '/var/lib/libvirt/images/Fedora-%s-%s-DVD.iso' % (version, arch) elif distro == 'U10': - iso = '/var/lib/libvirt/images/ubuntu-10.04.3-server-amd64.iso' + iso = '/var/lib/libvirt/images/ubuntu-10.04.3-server-%s.iso' % arch else: print 'distro %s not supported' % distro - print 'try: F15, F16, F17 or U10' + print 'try: F16, F17 or U10' sys.exit(1) - if iso: - if not os.access(iso, os.R_OK): - print '*** %s does not exist.' % (iso) - sys.exit(1) + if not os.access(iso, os.R_OK): + print '*** %s does not exist.' % (iso) + sys.exit(1) tdl_path = '%s%s-%s-%s-jeos.tdl' % (jeos_path, distro, arch, instance_type) diff --git a/heat/engine/resources.py b/heat/engine/resources.py index f84734b0..8b94492b 100644 --- a/heat/engine/resources.py +++ b/heat/engine/resources.py @@ -392,6 +392,7 @@ class Instance(Resource): image_id = o.id if image_id is None: + print "Image %s was not found in glance" % image_name raise exception.ImageNotFound(image_name=image_name) flavor_list = self.nova().flavors.list() diff --git a/heat/jeos/F16-i386-cfntools-jeos.tdl b/heat/jeos/F16-i386-cfntools-jeos.tdl new file mode 100644 index 00000000..656a7411 --- /dev/null +++ b/heat/jeos/F16-i386-cfntools-jeos.tdl @@ -0,0 +1,61 @@ + diff --git a/heat/jeos/F16-i386-gold-jeos.tdl b/heat/jeos/F16-i386-gold-jeos.tdl new file mode 100644 index 00000000..18564856 --- /dev/null +++ b/heat/jeos/F16-i386-gold-jeos.tdl @@ -0,0 +1,61 @@ + diff --git a/heat/jeos/F17-i386-cfntools-jeos.tdl b/heat/jeos/F17-i386-cfntools-jeos.tdl new file mode 100644 index 00000000..78310a94 --- /dev/null +++ b/heat/jeos/F17-i386-cfntools-jeos.tdl @@ -0,0 +1,61 @@ + diff --git a/heat/jeos/F17-i386-gold-jeos.tdl b/heat/jeos/F17-i386-gold-jeos.tdl new file mode 100644 index 00000000..13c14b88 --- /dev/null +++ b/heat/jeos/F17-i386-gold-jeos.tdl @@ -0,0 +1,61 @@ + diff --git a/templates/WordPress_2_Instances.template b/templates/WordPress_2_Instances.template index bd031c3a..1f5fe372 100644 --- a/templates/WordPress_2_Instances.template +++ b/templates/WordPress_2_Instances.template @@ -82,12 +82,12 @@ "cc1.4xlarge" : { "Arch" : "64" } }, "DistroArch2AMI": { - "F16" : { "32" : "F16-i686", "64" : "F16-x86_64-gold" }, - "F17" : { "32" : "F17-i686", "64" : "F17-x86_64-gold" }, - "U10" : { "32" : "U10-i686", "64" : "U10-x86_64-gold" }, - "RHEL-6.1" : { "32" : "rhel61-i686", "64" : "rhel61-x86_64-gold" }, - "RHEL-6.2" : { "32" : "rhel62-i686", "64" : "rhel62-x86_64-gold" }, - "RHEL-6.3" : { "32" : "rhel63-i686", "64" : "rhel63-x86_64-gold" } + "F16" : { "32" : "F16-i386-gold", "64" : "F16-x86_64-gold" }, + "F17" : { "32" : "F17-i386-gold", "64" : "F17-x86_64-gold" }, + "U10" : { "32" : "U10-i386-gold", "64" : "U10-x86_64-gold" }, + "RHEL-6.1" : { "32" : "rhel61-i386-gold", "64" : "rhel61-x86_64-gold" }, + "RHEL-6.2" : { "32" : "rhel62-i386-gold", "64" : "rhel62-x86_64-gold" }, + "RHEL-6.3" : { "32" : "rhel63-i386-gold", "64" : "rhel63-x86_64-gold" } } }, diff --git a/templates/WordPress_2_Instances_With_EBS_Volume.template b/templates/WordPress_2_Instances_With_EBS_Volume.template index 8401d072..986bec20 100644 --- a/templates/WordPress_2_Instances_With_EBS_Volume.template +++ b/templates/WordPress_2_Instances_With_EBS_Volume.template @@ -49,12 +49,12 @@ "cc1.4xlarge" : { "Arch" : "64" } }, "DistroArch2AMI": { - "F16" : { "32" : "F16-i686", "64" : "F16-x86_64-gold" }, - "F17" : { "32" : "F17-i686", "64" : "F17-x86_64-gold" }, - "U10" : { "32" : "U10-i686", "64" : "U10-x86_64-gold" }, - "RHEL-6.1" : { "32" : "rhel61-i686", "64" : "rhel61-x86_64-gold" }, - "RHEL-6.2" : { "32" : "rhel62-i686", "64" : "rhel62-x86_64-gold" }, - "RHEL-6.3" : { "32" : "rhel63-i686", "64" : "rhel63-x86_64-gold" } + "F16" : { "32" : "F16-i386-gold", "64" : "F16-x86_64-gold" }, + "F17" : { "32" : "F17-i386-gold", "64" : "F17-x86_64-gold" }, + "U10" : { "32" : "U10-i386-gold", "64" : "U10-x86_64-gold" }, + "RHEL-6.1" : { "32" : "rhel61-i386-gold", "64" : "rhel61-x86_64-gold" }, + "RHEL-6.2" : { "32" : "rhel62-i386-gold", "64" : "rhel62-x86_64-gold" }, + "RHEL-6.3" : { "32" : "rhel63-i386-gold", "64" : "rhel63-x86_64-gold" } } }, diff --git a/templates/WordPress_Single_Instance.template b/templates/WordPress_Single_Instance.template index 2102c969..b3d06afe 100644 --- a/templates/WordPress_Single_Instance.template +++ b/templates/WordPress_Single_Instance.template @@ -82,12 +82,12 @@ "cc1.4xlarge" : { "Arch" : "64" } }, "DistroArch2AMI": { - "F16" : { "32" : "F16-i686", "64" : "F16-x86_64-gold" }, - "F17" : { "32" : "F17-i686", "64" : "F17-x86_64-gold" }, - "U10" : { "32" : "U10-i686", "64" : "U10-x86_64-gold" }, - "RHEL-6.1" : { "32" : "rhel61-i686", "64" : "rhel61-x86_64-gold" }, - "RHEL-6.2" : { "32" : "rhel62-i686", "64" : "rhel62-x86_64-gold" }, - "RHEL-6.3" : { "32" : "rhel63-i686", "64" : "rhel63-x86_64-gold" } + "F16" : { "32" : "F16-i386-gold", "64" : "F16-x86_64-gold" }, + "F17" : { "32" : "F17-i386-gold", "64" : "F17-x86_64-gold" }, + "U10" : { "32" : "U10-i386-gold", "64" : "U10-x86_64-gold" }, + "RHEL-6.1" : { "32" : "rhel61-i386-gold", "64" : "rhel61-x86_64-gold" }, + "RHEL-6.2" : { "32" : "rhel62-i386-gold", "64" : "rhel62-x86_64-gold" }, + "RHEL-6.3" : { "32" : "rhel63-i386-gold", "64" : "rhel63-x86_64-gold" } } }, diff --git a/templates/WordPress_Single_Instance_With_EBS_Volume.template b/templates/WordPress_Single_Instance_With_EBS_Volume.template index 829119d9..f14141d2 100644 --- a/templates/WordPress_Single_Instance_With_EBS_Volume.template +++ b/templates/WordPress_Single_Instance_With_EBS_Volume.template @@ -49,12 +49,12 @@ "cc1.4xlarge" : { "Arch" : "64" } }, "DistroArch2AMI": { - "F16" : { "32" : "F16-i686", "64" : "F16-x86_64-gold" }, - "F17" : { "32" : "F17-i686", "64" : "F17-x86_64-gold" }, - "U10" : { "32" : "U10-i686", "64" : "U10-x86_64-gold" }, - "RHEL-6.1" : { "32" : "rhel61-i686", "64" : "rhel61-x86_64-gold" }, - "RHEL-6.2" : { "32" : "rhel62-i686", "64" : "rhel62-x86_64-gold" }, - "RHEL-6.3" : { "32" : "rhel63-i686", "64" : "rhel63-x86_64-gold" } + "F16" : { "32" : "F16-i386-gold", "64" : "F16-x86_64-gold" }, + "F17" : { "32" : "F17-i386-gold", "64" : "F17-x86_64-gold" }, + "U10" : { "32" : "U10-i386-gold", "64" : "U10-x86_64-gold" }, + "RHEL-6.1" : { "32" : "rhel61-i386-gold", "64" : "rhel61-x86_64-gold" }, + "RHEL-6.2" : { "32" : "rhel62-i386-gold", "64" : "rhel62-x86_64-gold" }, + "RHEL-6.3" : { "32" : "rhel63-i386-gold", "64" : "rhel63-x86_64-gold" } } }, diff --git a/templates/WordPress_Single_Instance_cfntools.template b/templates/WordPress_Single_Instance_cfntools.template index b9cd8770..895f0d70 100644 --- a/templates/WordPress_Single_Instance_cfntools.template +++ b/templates/WordPress_Single_Instance_cfntools.template @@ -82,12 +82,12 @@ "cc1.4xlarge" : { "Arch" : "64" } }, "DistroArch2AMI": { - "F16" : { "32" : "F16-i686", "64" : "F16-x86_64-cfntools" }, - "F17" : { "32" : "F17-i686", "64" : "F17-x86_64-cfntools" }, - "U10" : { "32" : "U10-i686", "64" : "U10-x86_64-cfntools" }, - "RHEL-6.1" : { "32" : "rhel61-i686", "64" : "rhel61-x86_64-cfntools" }, - "RHEL-6.2" : { "32" : "rhel62-i686", "64" : "rhel62-x86_64-cfntools" }, - "RHEL-6.3" : { "32" : "rhel63-i686", "64" : "rhel63-x86_64-cfntools" } + "F16" : { "32" : "F16-i386-cfntools", "64" : "F16-x86_64-cfntools" }, + "F17" : { "32" : "F17-i386-cfntools", "64" : "F17-x86_64-cfntools" }, + "U10" : { "32" : "U10-i386-cfntools", "64" : "U10-x86_64-cfntools" }, + "RHEL-6.1" : { "32" : "rhel61-i386-cfntools", "64" : "rhel61-x86_64-cfntools" }, + "RHEL-6.2" : { "32" : "rhel62-i386-cfntools", "64" : "rhel62-x86_64-cfntools" }, + "RHEL-6.3" : { "32" : "rhel63-i386-cfntools", "64" : "rhel63-x86_64-cfntools" } } }, -- 2.45.2