Bug 710094

Summary: Building image from Image fails
Product: [Retired] CloudForms Cloud Engine Reporter: wes hayutin <whayutin>
Component: imagefactoryAssignee: jrd <jrd>
Status: CLOSED CURRENTRELEASE QA Contact: wes hayutin <whayutin>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.3.1CC: cpelland, dajohnso, deltacloud-maint, jtomasek, ssachdev
Target Milestone: alpha   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 710033 Environment:
Last Closed: 2011-06-16 18:20:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 710033    
Bug Blocks:    

Description wes hayutin 2011-06-02 12:47:18 UTC
+++ This bug was initially created as a clone of Bug #710033 +++

Description of problem:
When building image via conductor, imagefactory creates new uuid for template instead of taking one sent from conductor. Image then doesng gen updated in conductor.
  

2011-06-02 09:18:23,865 DEBUG imagefactory.qmfagent.ImageFactoryAgent.ImageFactoryAgent pid(26176) Message: Method called: name = image
 args = {'target': 'ec2', 'template': 'http://localhost:9090/templates/74a742b8-8ce8-11e0-ac84-f0def13e79e3'}
 handle = <cqmf2.AgentEvent; proxy of <Swig Object of type 'qmf::AgentEvent *' at 0x1bceae0> >
 addr = redhat.com:imagefactory:00e11f60-590b-4029-a52b-6eb5f0def04d:image_factory
 subtypes = {}
 userId = anonymous
2011-06-02 09:18:23,879 DEBUG imagefactory.ImageWarehouse.ImageWarehouse pid(26176) Message: Created Image Warehouse instance http://localhost:9090 - buckets(images, templates, icicles, provider_images)
2011-06-02 09:18:23,909 DEBUG imagefactory.ImageWarehouse.ImageWarehouse pid(26176) Message: Created Image Warehouse instance http://localhost:9090 - buckets(images, templates, icicles, provider_images)
2011-06-02 09:18:23,934 DEBUG imagefactory.ImageWarehouse.ImageWarehouse pid(26176) Message: Created Image Warehouse instance http://localhost:9090 - buckets(images, templates, icicles, provider_images)
2011-06-02 09:18:23,938 DEBUG imagefactory.builders.BaseBuilder.FedoraBuilder pid(26176) Message: Building Linux for non-upload cloud (ec2)
2011-06-02 09:18:23,940 DEBUG imagefactory.builders.BaseBuilder.FedoraBuilder pid(26176) Message: Storing placeholder object for non upload cloud image
2011-06-02 09:18:23,943 INFO imagefactory.ImageWarehouse.ImageWarehouse pid(26176) Message: Creating a bucket returned status 500.  If only iwhd would provide a sane way to know if a bucket exists so we wouldn't have to try and create one every time...
2011-06-02 09:18:23,946 DEBUG imagefactory.ImageWarehouse.ImageWarehouse pid(26176) Message: Setting metadata ({'object_type': 'template', 'uuid': 'e4365164-f46c-4907-9170-6f7e587831e9'}) for http://localhost:9090/templates/e4365164-f46c-4907-9170-6f7e587831e9





# curl http://localhost:9090/templates/e4365164-f46c-4907-9170-6f7e587831e9
<?xml version="1.0"?>
<template>
  <name>test1</name>
  <description>Template Description</description>
  <os>
    <name>Fedora</name>
    <arch>x86_64</arch>
    <version>13</version>
    <install type="url">
      <url>http://download.fedoraproject.org/pub/fedora/linux/releases/13/Fedora/x86_64/os/</url>
    </install>
  </os>
</template>
[root@dhcp-29-28 aeolus-conductor]# curl http://localhost:9090/templates/74a742b8-8ce8-11e0-ac84-f0def13e79e3
<?xml version="1.0"?>
<template>
  <name>test1</name>
  <description>Template Description</description>
  <os>
    <name>Fedora</name>
    <arch>x86_64</arch>
    <version>13</version>
    <install type="url">
      <url>http://download.fedoraproject.org/pub/fedora/linux/releases/13/Fedora/x86_64/os/</url>
    </install>
  </os>
</template>

--- Additional comment from jtomasek on 2011-06-02 06:13:33 EDT ---

Also tried with this patch:

diff --git a/imagefactory/builders/BaseBuilder.py b/imagefactory/builders/BaseBuilder.py
index b9546fa..11d5144 100644
--- a/imagefactory/builders/BaseBuilder.py
+++ b/imagefactory/builders/BaseBuilder.py
@@ -225,7 +225,10 @@ class BaseBuilder(object):
         raise NotImplementedError
 
     def store_image(self, target_parameters=None):
-        template_id = self.warehouse.store_template(self.template.xml, self.template.identifier)
+        if self.template.identifier:
+            template_id = self.template.identifier
+        else:
+            template_id = self.warehouse.store_template(self.template.xml, self.template.identifier)
         icicle_id = self.warehouse.store_icicle(self.output_descriptor)
         metadata = dict(template=template_id, target=self.target, icicle=icicle_id, target_parameters=target_parameters)
         self.warehouse.store_image(self.image_id, self.image, metadata=metadata)

Comment 1 wes hayutin 2011-06-16 18:20:45 UTC

*** This bug has been marked as a duplicate of bug 710033 ***

Comment 2 wes hayutin 2011-07-11 00:32:30 UTC
removing from tracker

Comment 3 wes hayutin 2011-12-08 13:59:11 UTC
perm close