Bug 745491 - Need schema version in definition xml
Summary: Need schema version in definition xml
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: CloudForms Cloud Engine
Classification: Retired
Component: imagefactory
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
Assignee: Ian McLeod
QA Contact: dgao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-12 14:05 UTC by jrd
Modified: 2016-04-26 22:25 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-15 20:17:04 UTC


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2012:0588 0 normal SHIPPED_LIVE new packages: imagefactory 2012-05-15 22:31:27 UTC

Description jrd 2011-10-12 14:05:41 UTC
Description of problem:

We're about to let this code out into the wild, in a form which exposes xml for templates and things to users.  It is therefore absolutely imperative that there be some kind of a version field at the top level of a template (and an icicle) designating what the schema version is.

I advocate that we set the version to 1, and check it in IF, though one could argue that "no version" implies "version 1.

This should be added prior to declaring feature-complete for 1.0.

Comment 2 wes hayutin 2012-01-12 16:53:23 UTC
adding to sprint tracker

Comment 3 Ian McLeod 2012-01-17 14:41:36 UTC
This was added here:

https://github.com/aeolusproject/oz/commit/5be16e92c981c2d0c46cfbbf7c9314fbd740a3ce#oz/TDL.py

This commit is from November and is present in the most recent Oz RPMs in brew.

The version is specified as a property of the top level <template> tag.  That is:

<template version="1.0">
stuff
</template>

If the version property is not present, no check is done.  If it is, we check it.

The version in Oz is currently set to 1.0.  We'll need to actively manage this in the future.

Setting to ON_QA.

Comment 5 wes hayutin 2012-02-10 22:18:49 UTC
[root@qeblade32 ~]# aeolus-image build --target ec2 --template RHEL62.tpl 

ERROR:  Service Temporarily Unavailable => Please check that Conductor is running.
[root@qeblade32 ~]# aeolus-check-services 

Checking mongod ...
 Success: mongod (pid 4112) is running...

Checking iwhd ...
 Success: iwhd (pid  4146) is running...

Checking postgresql ...
 Success: postmaster (pid  455) is running...

Checking httpd ...
 Success: httpd (pid  4197) is running...

Checking qpidd ...
 Success: qpidd (pid  4015) is running...

Checking deltacloud-core ...
 Success: deltacloud-core (pid  3983) is running...

Checking libvirtd ...
 Success: libvirtd (pid  576) is running...

Checking aeolus-conductor ...
 Success: thin (pid  9093) is running...

Checking conductor-dbomatic ...
 Success: dbomatic (pid  4405) is running...

Checking imagefactory ...
 Success: imagefactory (pid  4438) is running...

Checking ntpd ...
 Success: ntpd (pid  7806) is running...
[root@qeblade32 ~]# vi RHEL62.tpl 
[root@qeblade32 ~]# ps -ef | grep thin
nobody    3983     1  0 11:52 ?        00:01:06 thin server (localhost:3002) [deltacloud-mock]                                                                                                                 
aeolus    9093     1  0 15:03 ?        00:00:27 thin server (127.0.0.1:3000)                                                                                                                                                                                                                                         
root     14180 16622  0 17:18 pts/0    00:00:00 grep thin
[root@qeblade32 ~]# aeolus-image build --target ec2 --template RHEL62.tpl 

ERROR:  Service Temporarily Unavailable => Please check that Conductor is running.
[root@qeblade32 ~]# cat RHEL62.tpl 
<template version="1.0">
  <name>RHEL6-2Basic version</name>
  <os>    
    <name>RHEL-6</name>    
    <version>2</version>
    <arch>x86_64</arch>
    <rootpw>redhat</rootpw>
    <install type="url">
      <url>http://download.lab.bos.redhat.com/released/RHEL-6/6.2/Server/x86_64/os/</url>
    </install>
  </os>
  <description>RHEL62 x86_64 </description>
</template>
[root@qeblade32 ~]#

Comment 6 wes hayutin 2012-02-13 14:41:48 UTC
IMHO this is not an urgent bug.. bumping down to high

Comment 7 Brad P. Crochet 2012-02-14 17:18:58 UTC
Log entry:


2012-02-14 11:27:42,456 ERROR imgfac.rest.imagefactory thread(worker 0) Message: 'template_string' must be a UUID, URL, or XML document...
--- TEMPLATE STRING ---
<template version='1.0'>
  <name>RHEL_62</name>
  <os>
    <name>RHEL-6</name>
    <version>2</version>
    <arch>x86_64</arch>
    <rootpw>REDACTED</rootpw>
    <install type='url'>
      <url>http://REDACTED/released/RHEL-6/6.2/Server/x86_64/os/</url>
    </install>
  </os>
  <description>RHEL 6.2 x86_64</description>
</template>
-----------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/imgfac/rest/imagefactory.py", line 118, in build_image
    jobs = BuildDispatcher().build_image_for_targets(image_id, build_id, template, targets.split(','))
  File "/usr/lib/python2.6/site-packages/imgfac/BuildDispatcher.py", line 52, in build_image_for_targets
    template = self._load_template(image_id, build_id, template)
  File "/usr/lib/python2.6/site-packages/imgfac/BuildDispatcher.py", line 177, in _load_template
    return Template(template)
  File "/usr/lib/python2.6/site-packages/imgfac/Template.py", line 50, in __init__
    template_string_type = self.__template_string_type(template_string)
  File "/usr/lib/python2.6/site-packages/imgfac/Template.py", line 94, in __template_string_type
    raise ValueError("'template_string' must be a UUID, URL, or XML document...\n--- TEMPLATE STRING ---\n%s\n-----------------" % (template_string, ))

Comment 8 Ian McLeod 2012-02-22 15:59:28 UTC
That traceback implies that the template in your comment is not what is being passed to Factory.

Please double-check your command line invocation and try to reproduce.

Comment 9 dgao 2012-02-23 18:59:43 UTC
Reproduced:

[root@dell-pem600-01 ~]# rpm -qa | egrep "imagefactory|aeolus-cli"
rubygem-aeolus-cli-0.3.0-10.el6.noarch
imagefactory-1.0.0rc6-1.el6.noarch
imagefactory-jeosconf-ec2-rhel-1.0.0rc6-1.el6.noarch
rubygem-imagefactory-console-0.4.0-1.el6.noarch
imagefactory-jeosconf-ec2-fedora-1.0.0rc6-1.el6.noarch



[root@dell-pem600-01 ~]# aeolus image build --target ec2 --template rhel_template --environment default

ERROR:  Service Temporarily Unavailable => Please check that Conductor is running.

[root@dell-pem600-01 ~]# aeolus-check-services 

Checking mongod ...
 Success: mongod (pid 3677) is running...

Checking iwhd ...
 Success: iwhd (pid  3696) is running...

Checking postgresql ...
 Success: postmaster (pid  3735) is running...

Checking httpd ...
 Success: httpd (pid  3756) is running...

Checking qpidd ...
 Success: qpidd (pid  3771) is running...

Checking deltacloud-core ...
 Success: deltacloud-core (pid  3836) is running...

Checking libvirtd ...
 Success: libvirtd (pid  3854) is running...

Checking aeolus-conductor ...
 Success: thin (pid  3916) is running...

Checking conductor-dbomatic ...
 Success: dbomatic (pid  3960) is running...

Checking imagefactory ...
 Success: imagefactory (pid  3977) is running...

Checking ntpd ...
 Success: ntpd (pid  3994) is running...


[root@dell-pem600-01 ~]# cat rhel_template 
<template version="1.0">
  <name>RHEL6_2 configserver</name>
  <os>
    <name>RHEL-6</name>
    <version>2</version>
    <arch>x86_64</arch>
    <install type='url'>
      <url>http://download.devel.redhat.com/released/RHEL-6/6.2/Server/x86_64/os/</url>
    </install>
    <rootpw>dog8code</rootpw>
  </os>
  <repositories>
    <repository name="rhel">
      <url>http://download.devel.redhat.com/released/RHEL-6/6.2/Server/x86_64/os/</url>
    </repository>
    <repository name="aeolus">
      <url>http://repos.fedorapeople.org/repos/aeolus/conductor/testing/6Server/x86_64/</url>
    </repository>
  </repositories>
  <packages>
    <package name="aeolus-audrey-agent"/>
  </packages>
  <description>RHEL 6.2 w/ Audrey Client for ec2</description>
</template>

Comment 10 dgao 2012-02-23 19:01:06 UTC
By removing version="1.0" from <template>, the build kicks off fine.

Comment 11 Hugh Brock 2012-02-24 15:46:38 UTC
Ian, we believe this is just a Factory docs issue, can you confirm, fix the docs, and deal with the BZ appropriately?

Comment 12 Ian McLeod 2012-02-24 16:36:54 UTC
Oz supports adding a version string.  This is a factory bug,
not a doc bug.

Fixed here:

https://github.com/aeolusproject/imagefactory/pull/91

Comment 13 Ian McLeod 2012-02-24 19:21:17 UTC
OK.  This required one additional change:

https://github.com/aeolusproject/imagefactory/commit/780f209b3d99bf8ec6b81dcc12f6f7a465cfc72f

And it is now brewed as part of 1.0.0rc7

You can now use this syntax:

<template version="1.0">

Note that 1.0 is the one and only valid "version" of TDL at the moment.

Comment 14 Shveta 2012-02-27 09:54:34 UTC
 
================    Working fine with version = 1.0 ===========================

aeolus image build --target ec2 --template rhel_temp.tpl --environment default
Image                                    Build                                    Target Image                             Target     Status       
------------------------------------     ------------------------------------     ------------------------------------     ------     --------     
14a7f0a0-6128-11e1-91ad-001e4ffbdd3c     8caeba92-abb5-4fbb-a027-1e281f065188     b2c5bb97-257b-470b-8ba5-27f64d2d313c     ec2        BUILDING     



=============   When version is something other than 1.0 ===================

[root@dell-per805-01 ~]# aeolus image build --target ec2 --template rhel_tempp.tpl --environment default

ERROR:  Service Temporarily Unavailable => Please check that Conductor is running.


========================= In log file ===========================
  self._validate_tdl_version()
  File "/usr/lib/python2.6/site-packages/oz/TDL.py", line 369, in _validate_tdl_version
    raise oz.OzException.OzException("TDL version (%s) is higher than our known version (%s)" % (self.version, self.schema_version))


Cane we have the log file error at the cli command execution as well instead of "Service unavilable"

=====================================

rpm -qa|grep aeolus
aeolus-conductor-0.8.0-36.el6.noarch
rubygem-aeolus-cli-0.3.0-10.el6.noarch
aeolus-conductor-daemons-0.8.0-36.el6.noarch
aeolus-configure-2.5.0-15.el6.noarch
rubygem-aeolus-image-0.3.0-10.el6.noarch
aeolus-all-0.8.0-36.el6.noarch
aeolus-conductor-doc-0.8.0-36.el6.noarch

Comment 15 Ian McLeod 2012-02-27 14:57:58 UTC
Due to the way the build is executed, we cannot currently have the error reported at the time you run the CLI tool.  Improving this is on the top of our list for post 1.0 feature improvements.

The error you are now seeing is this:

    raise oz.OzException.OzException("TDL version (%s) is higher than our known
version (%s)" % (self.version, self.schema_version))

This is, in fact, the version checking code doing its job.  This indicates that the TDL you have passed in had a version other than 1.0.  I cannot confirm this because you have not provided the TDL string passed to Factory.

To be clear, the expected behaviour is success if you have an opening tag like this:

<template version="1.0">

And failure for any other version string.

Please test again with both a 1.0 version string and, for completeness, a version string other than 1.0 and see if you get the behaviour described above (I do).

Please provide the full TDL for any further reports against this bug.

Please also include the version of the "oz" RPM in any further reports.

Comment 16 Shveta 2012-02-27 15:36:21 UTC
Yea , i provided version other than 1.0 when i got this error.
The error is right , i was just saying if we can get the same in UI while executing the command .
You have answered that :)

Thanks .
Verifying the bug.

Comment 18 errata-xmlrpc 2012-05-15 20:17:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2012-0588.html


Note You need to log in before you can comment on or make changes to this bug.