]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Add U10 JEOS support to heat jeos_create
authorSteven Dake <sdake@redhat.com>
Wed, 23 May 2012 23:09:00 +0000 (16:09 -0700)
committerSteven Dake <sdake@redhat.com>
Thu, 24 May 2012 18:12:48 +0000 (11:12 -0700)
This requires oz 0.9.0 (or latest master).  0.8.0 shipped with
most distros does not have customization support for Ubuntu
images.

fixes issue #23

Change-Id: I854aaf9657353b3fdb4768a277b527304e88ac8e
Signed-off-by: Steven Dake <sdake@redhat.com>
MANIFEST.in
heat/jeos/U10-amd64-cfntools-jeos.tdl [new file with mode: 0644]
heat/utils.py

index a7ed2ca1b807543aab578d87c36d06d93751cfd3..3e981ef6269a8f7df6cffbba0662a75776ff1c71 100644 (file)
@@ -15,6 +15,7 @@ include heat/jeos/F16-x86_64-gold-jeos.tdl
 include heat/jeos/F17-x86_64-gold-jeos.tdl
 include heat/jeos/F16-x86_64-cfntools-jeos.tdl
 include heat/jeos/F17-x86_64-cfntools-jeos.tdl
+include heat/jeos/U10-amd64-cfntools-jeos.tdl
 include heat/cfntools/cfn-init
 include heat/cfntools/cfn-hup
 include heat/cfntools/cfn-signal
diff --git a/heat/jeos/U10-amd64-cfntools-jeos.tdl b/heat/jeos/U10-amd64-cfntools-jeos.tdl
new file mode 100644 (file)
index 0000000..0440e36
--- /dev/null
@@ -0,0 +1,24 @@
+<template>
+  <name>U10-x86_64-cfntools-jeos</name>
+  <os>
+    <name>Ubuntu</name>
+    <version>10.04</version>
+    <arch>x86_64</arch>
+    <install type='iso'>
+      <iso>file:/var/lib/libvirt/images/ubuntu-10.04.3-server-amd64.iso</iso>
+    </install>
+  </os>
+  <description>Ubuntu 10.04</description>
+  <commands>
+    <command name='commands'>
+apt-get -y upgrade;apt-get -y install cloud-init;/usr/sbin/useradd ec2-user;echo -e 'ec2-user\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers;chmod +x /opt/aws/bin/cfn-*
+    </command>
+  </commands>
+  <files>
+    <file name='/opt/aws/bin/cfn-init'  type='base64'></file>
+    <file name='/opt/aws/bin/cfn-hup'  type='base64'></file>
+    <file name='/opt/aws/bin/cfn-signal'  type='base64'></file>
+    <file name='/opt/aws/bin/cfn_helper.py'  type='base64'></file>
+    <file name='/opt/aws/bin/cfn-get-metadata'  type='base64'></file>
+  </files>
+</template>
index 1212f0f6a491e16b2ed8a47692b04fae8b194bd0..d008a10d4401a4ac0719a4690c5aedac68b79a3e 100644 (file)
@@ -112,11 +112,16 @@ def jeos_create(options, arguments, jeos_path, cfntools_path):
             (distro, arch, instances_str))
         sys.exit(1)
 
+    src_arch = 'i386'
     fedora_match = re.match('F(1[6-7])', distro)
     if fedora_match:
+        if arch == 'x86_64':
+            src_arch = 'x86_64'
         version = fedora_match.group(1)
         iso = '%s/Fedora-%s-%s-DVD.iso' % (images_dir, version, arch)
     elif distro == 'U10':
+        if arch == 'amd64':
+            src_arch = 'x86_64'
         iso = '%s/ubuntu-10.04.3-server-%s.iso' % (images_dir, arch)
     else:
         logging.error('distro %s not supported' % distro)
@@ -149,7 +154,7 @@ def jeos_create(options, arguments, jeos_path, cfntools_path):
         tdl_path = '/tmp/tdl'
 
     dsk_filename = '%s/%s-%s-%s-jeos.dsk' % (images_dir, distro,
-                                             arch, instance_type)
+                                             src_arch, instance_type)
     qcow2_filename = '%s/%s-%s-%s-jeos.qcow2' % (images_dir, distro,
                                                  arch, instance_type)
     image_name = '%s-%s-%s' % (distro, arch, instance_type)