Bug 761160

Summary: import then push fails
Product: [Retired] CloudForms Cloud Engine Reporter: wes hayutin <whayutin>
Component: aeolus-conductorAssignee: Matt Wagner <matt.wagner>
Status: CLOSED NOTABUG QA Contact: wes hayutin <whayutin>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0.0CC: akarol, athomas, deltacloud-maint, matt.wagner, ssachdev
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://dhcp231-79.rdu.redhat.com/conductor/images/a23c1b6f-f662-4ba3-aa86-5ff5b140c617
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-10 15:17:30 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:    
Bug Blocks: 744194    

Description wes hayutin 2011-12-07 19:41:23 UTC
import RHEL 6.1 us-east-1 ami ami-31d41658
0. configure ec2, us-east-1
1. import works.. 
2. moves to a images window.. 
3. push to us-east-1

500 error


2011-12-07 14:36:38,506 DEBUG paste.httpserver.ThreadPool pid(48161) Message: Added task (0 tasks queued)
2011-12-07 14:36:58,485 DEBUG paste.httpserver.ThreadPool pid(48161) Message: Added task (0 tasks queued)
2011-12-07 14:36:58,531 DEBUG imgfac.ImageWarehouse.ImageWarehouse pid(48161) Message: Querying (http://localhost:9090/target_images/_query) with expression ($build == "e273a7ca-95d9-41dc-81f0-b90bd80105c2" && $target == "ec2")
2011-12-07 14:36:58,573 DEBUG imgfac.ImageWarehouse.ImageWarehouse pid(48161) Message: Getting metadata (['template']) from http://localhost:9090/target_images/6a9883e0-a195-455c-9414-7a7150ed9bb8
2011-12-07 14:36:58,575 DEBUG imgfac.ImageWarehouse.ImageWarehouse pid(48161) Message: Image Warehouse returned status (404) with message: 
2011-12-07 14:36:58,575 DEBUG imgfac.ImageWarehouse.ImageWarehouse pid(48161) Message: Created Image Warehouse instance http://localhost:9090 - buckets(target_images, templates, icicles, provider_images)
2011-12-07 14:36:58,575 ERROR imgfac.rest.imagefactory pid(48161) Message: 'template' must be a UUID, URL, XML string or XML document path...
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/imgfac/rest/imagefactory.py", line 191, in push_image
    job = BuildDispatcher().push_image_to_providers(image_id, build_id, (provider, ), credentials)[0]
  File "/usr/lib/python2.6/site-packages/imgfac/BuildDispatcher.py", line 83, in push_image_to_providers
    job = job_cls(template, target, image_id, build_id, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/imgfac/BuildJob.py", line 49, in __init__
    self.template = template if isinstance(template, Template) else Template(template)
  File "/usr/lib/python2.6/site-packages/imgfac/Template.py", line 79, in __init__
    raise ValueError("'template' must be a UUID, URL, XML string or XML document path...")
ValueError: 'template' must be a UUID, URL, XML string or XML document path...
2011-12-07 14:36:58,577 ERROR imgfac.rest.imagefactory pid(48161) Message: HTTP Response 500
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/imgfac/rest/imagefactory.py", line 212, in create_provider_image
    return push_image(image_id, build_id, target_image_id)
  File "/usr/lib/python2.6/site-packages/imgfac/rest/imagefactory.py", line 60, in decorated_function
    return f(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/imgfac/rest/imagefactory.py", line 202, in push_image
    raise HTTPResponse(status=500, output=e)
HTTPResponse: HTTP Response 500

Comment 1 Matt Wagner 2011-12-07 20:06:45 UTC
FWIW, this appears to be the case whether you import with Conductor or with aeolus-cli. It appears that it's choking on the lack of a template:

2011-12-07 14:36:58,573 DEBUG imgfac.ImageWarehouse.ImageWarehouse pid(48161)
Message: Getting metadata (['template']) from
http://localhost:9090/target_images/6a9883e0-a195-455c-9414-7a7150ed9bb8
2011-12-07 14:36:58,575 DEBUG imgfac.ImageWarehouse.ImageWarehouse pid(48161)
Message: Image Warehouse returned status (404) with message:

Comment 2 Matt Wagner 2011-12-07 20:49:28 UTC
You're not supposed to be able to push an imported image, since an 'imported image' is just a reference to an image already living in the cloud. We don't have metadata sufficient to build another copy.

However, we shouldn't prompt you in Conductor to build it. I think the real bug here is that we're not doing anything to detect if the image was imported and prevent you from building it.

Comment 3 Matt Wagner 2011-12-08 15:09:51 UTC
Looking into this more, it looks like creating an Image in Factory is causing an empty Template ("<template></template>") to appear in iwhd and become associated with the Image. This prevents us from simply defining an "imported?" method that checks whether a template UUID is present or not.

Comment 4 wes hayutin 2011-12-10 15:17:30 UTC

(In reply to comment #2)
> You're not supposed to be able to push an imported image, since an 'imported
> image' is just a reference to an image already living in the cloud. We don't
> have metadata sufficient to build another copy.
> 
> However, we shouldn't prompt you in Conductor to build it. I think the real bug
> here is that we're not doing anything to detect if the image was imported and
> prevent you from building it.

yup.. Matt you are right.. I went through this too quickly

opened
https://bugzilla.redhat.com/show_bug.cgi?id=766137