Bug 720062 - installing custom packages on RHEL via oz fails
Summary: installing custom packages on RHEL via oz fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: CloudForms Cloud Engine
Classification: Retired
Component: oz
Version: 0.3.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
Assignee: Mike Orazi
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks: ce-p2-beta
TreeView+ depends on / blocked
 
Reported: 2011-07-08 22:16 UTC by wes hayutin
Modified: 2011-12-08 14:11 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-11 18:24:45 UTC
Embargoed:


Attachments (Terms of Use)

Description wes hayutin 2011-07-08 22:16:36 UTC
Description of problem:

not sure if this is just a time out or a bad key..


07-08 18:13:18,196 DEBUG oz.Guest.RHEL6Guest pid(12241) Message: Resetting announcement to host
2011-07-08 18:13:18,205 DEBUG oz.Guest.RHEL6Guest pid(12241) Message: Removing icicle-nc binary
2011-07-08 18:13:18,205 DEBUG oz.Guest.RHEL6Guest pid(12241) Message: Resetting crond service
2011-07-08 18:13:18,230 DEBUG oz.Guest.RHEL6Guest pid(12241) Message: Teardown step 5
2011-07-08 18:13:18,255 INFO oz.Guest.RHEL6Guest pid(12241) Message: Cleaning up guestfs handle for RHEL02_postgres
2011-07-08 18:13:18,255 DEBUG oz.Guest.RHEL6Guest pid(12241) Message: Syncing
2011-07-08 18:13:18,330 DEBUG oz.Guest.RHEL6Guest pid(12241) Message: Unmounting all
2011-07-08 18:13:18,344 DEBUG oz.Guest.RHEL6Guest pid(12241) Message: Killing guestfs subprocess
2011-07-08 18:13:18,395 DEBUG imagefactory.builders.BaseBuilder.RHEL6Builder pid(12241) Message: Exception caught in ImageFactory
2011-07-08 18:13:18,451 DEBUG imagefactory.builders.BaseBuilder.RHEL6Builder pid(12241) Message: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/imagefactory/builders/FedoraBuilder.py", line 177, in build_upload
    self.guest.customize(libvirt_xml)
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 565, in customize
    self.do_customize(guestaddr)
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 537, in do_customize
    'yum -y install %s' % (packstr))
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 365, in guest_execute_command
    "root@" + guestaddr, command])
  File "/usr/lib/python2.6/site-packages/oz/Guest.py", line 77, in subprocess_check_output
    stderr))
OzException: 'ssh -i /etc/oz/id_rsa-icicle-gen -o ServerAliveInterval=30 -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null -o PasswordAuthentication=no root.122.7 yum -y install postgresql-server ' failed(1): Warning: Permanently added '192.168.122.7' (RSA) to the list of known hosts.
Error: Nothing to do


2011-07-08 18:13:18,452 INFO oz.Guest.RHEL6Guest pid(12241) Message: Cleaning up guest named RHEL02_postgres
2011-07-08 18:13:18,647 DEBUG imagefactory.BuildJob.BuildAdaptor pid(12241) Message: Raising event with agent handler (<ImageFactoryAgent(Thread-1, initial)>), changed status from BUILDING to FAILED
2011-07-08 18:13:18,648 INFO oz.Guest.RHEL6Guest pid(12241) Message: Cleaning up after install
2011-07-08 18:13:18,648 DEBUG oz.Guest.RHEL6Guest pid(12241) Message: Removing modified ISO
2011-07-08 18:13:18,680 DEBUG imagefactory.builders.BaseBuilder.RHEL6Builder pid(12241) Message: Exception caught in ImageFactory
2011-07-08 18:13:18,680 DEBUG imagefactory.builders.BaseBuilder.RHEL6Builder pid(12241) Message: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/imagefactory/builders/FedoraBuilder.py", line 125, in build_image
    self.build_upload(build_id)
  File "/usr/lib/python2.6/site-packages/imagefactory/builders/FedoraBuilder.py", line 177, in build_upload
    self.guest.customize(libvirt_xml)
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 565, in customize
    self.do_customize(guestaddr)
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 537, in do_customize
    'yum -y install %s' % (packstr))
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 365, in guest_execute_command
    "root@" + guestaddr, command])
  File "/usr/lib/python2.6/site-packages/oz/Guest.py", line 77, in subprocess_check_output
    stderr))
OzException: 'ssh -i /etc/oz/id_rsa-icicle-gen -o ServerAliveInterval=30 -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null -o PasswordAuthentication=no root.122.7 yum -y install postgresql-server ' failed(1): Warning: Permanently added '192.168.122.7' (RSA) to the list of known hosts.
Error: Nothing to do


2011-07-08 18:13:18,680 DEBUG imagefactory.BuildJob.BuildAdaptor pid(12241) Message: Raising event with agent handler (<ImageFactoryAgent(Thread-1, initial)>), changed status from FAILED to FAILED

Comment 1 wes hayutin 2011-07-08 22:18:30 UTC
[root@hp-xw6600-02 ~]# aeolus-image build --target vmware --template /root/templateRHEL61.tpl 

Target Image: 8f993f30-fa0d-4564-bac6-b6c32b839d7c
Image: 452c5e2c-ac4e-4def-9015-3177230501e3
Build: 656b7fc7-74fe-4d6e-a61e-d1516b0ed517
Status: BUILDING
Percent Complete: 0



[root@hp-xw6600-02 ~]# rpm -qa | grep aeolus
rubygem-aeolus-cli-0.0.1-1.el6.20110708135911gitdb1097c.noarch
aeolus-all-0.3.0-0.el6.20110708135911gitdb1097c.noarch
aeolus-configure-2.0.1-0.el6.20110707131907gitfaa220b.noarch
aeolus-conductor-0.3.0-0.el6.20110708135911gitdb1097c.noarch
aeolus-conductor-daemons-0.3.0-0.el6.20110708135911gitdb1097c.noarch
aeolus-conductor-doc-0.3.0-0.el6.20110708135911gitdb1097c.noarch
[root@hp-xw6600-02 ~]# rpm -q oz
oz-0.5.0-1.el6.noarch
[root@hp-xw6600-02 ~]# rpm -q imagefactory
imagefactory-0.2.3-1.el6.noarch
[root@hp-xw6600-02 ~]#

Comment 2 Chris Lalancette 2011-07-11 13:42:25 UTC
(In reply to comment #0)
> Description of problem:
> 
> not sure if this is just a time out or a bad key..

It is neither...

> OzException: 'ssh -i /etc/oz/id_rsa-icicle-gen -o ServerAliveInterval=30 -o
> StrictHostKeyChecking=no -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null
> -o PasswordAuthentication=no root.122.7 yum -y install
> postgresql-server ' failed(1): Warning: Permanently added '192.168.122.7' (RSA)
> to the list of known hosts.
> Error: Nothing to do

The problem here is that oz tried to run the command:

yum -y install postgresql-server

in the guest, but yum couldn't find that package.  My guess is that either the package name is different on RHEL-6, or you didn't add appropriate <repository> sections in the TDL.  What does the full TDL look like?

Comment 3 wes hayutin 2011-07-11 13:55:45 UTC
I can try with simple package like zsh..
/me looking @ http://download.devel.redhat.com/released/RHEL-6/6.1/Server/x86_64/os/Server/listing

postgresql-8.4.7-2.el6.i686.rpm
postgresql-8.4.7-2.el6.x86_64.rpm
postgresql-contrib-8.4.7-2.el6.x86_64.rpm
postgresql-devel-8.4.7-2.el6.i686.rpm
postgresql-devel-8.4.7-2.el6.x86_64.rpm
postgresql-docs-8.4.7-2.el6.x86_64.rpm
postgresql-jdbc-8.4.701-3.el6.x86_64.rpm
postgresql-libs-8.4.7-2.el6.i686.rpm
postgresql-libs-8.4.7-2.el6.x86_64.rpm
postgresql-odbc-08.04.0200-1.el6.x86_64.rpm
postgresql-plperl-8.4.7-2.el6.x86_64.rpm
postgresql-plpython-8.4.7-2.el6.x86_64.rpm
postgresql-pltcl-8.4.7-2.el6.x86_64.rpm
postgresql-server-8.4.7-2.el6.x86_64.rpm
postgresql-test-8.4.7-2.el6.x86_64.rpm
pothana2000-fonts-1.3.2-3.el6.noarch.rpm

Comment 4 wes hayutin 2011-07-11 13:57:36 UTC
[root@sgi-xe310-02 ~]# cat templateRHEL61.tpl
<template>
  <name>RHEL_postgres</name>
  <os>    
    <name>RHEL</name>    
    <version>6.1</version>
    <arch>x86_64</arch>
    <install type="url">
      <url>http://download.devel.redhat.com/released/RHEL-6-Server/6.1/x86_64/os/</url>
    </install>
  </os>
  <description>RHEL61 x86_64 with postgres</description>
  <packages>
    <package name='postgresql-server'/> 
  </packages>
</template>

Comment 5 Chris Lalancette 2011-07-11 14:00:29 UTC
OK, right.  The problem is that RHEL-6 doesn't ship with any pre-configured repositories, though, which is why you get the "Nothing to do" error.

That is, for RHEL-6 (and actually, probably RHEL in general) it is *required* that you specify a <repository> section when specifying <packages>.  We should probably enforce this in the code, but we don't at present.

Comment 6 wes hayutin 2011-07-11 14:12:38 UTC
I think this is the right snippet to retry for RHEL6, hopefully I'll get to that today 

    <optional>
          <element name='packages'>
            <zeroOrMore>
              <element name='package'>
                <attribute name='name'>
                  <text/>
                </attribute>
                <interleave>
                  <optional>
                    <element name='repository'>
                      <text/>
                    </element>
                  </optional>
                  <optional>
                    <element name='file'>
                      <text/>
                    </element>
                  </optional>
                  <optional>
                    <element name='arguments'>
                      <text/>
                    </element>
                  </optional>
                </interleave>
              </element>
            </zeroOrMore>
          </element>
        </optional>

Comment 7 Chris Lalancette 2011-07-11 14:27:10 UTC
No, not quite.  That stuff is really to support Windows (I know, it is confusing).  Here's what you need:

<template>
  <name>RHEL_postgres</name>
  <os>    
    <name>RHEL</name>    
    <version>6.1</version>
    <arch>x86_64</arch>
    <install type="url">
     
<url>http://download.devel.redhat.com/released/RHEL-6-Server/6.1/x86_64/os/</url>
    </install>
  </os>
  <description>RHEL61 x86_64 with postgres</description>
  <repositories>
    <repository name='myrepo'>
      <url>http://path/to/my/repo</url>
      <signed>True</signed>
    </repository>
  </repositories>
  <packages>
    <package name='postgresql-server'/> 
  </packages>
</template>

Comment 8 wes hayutin 2011-07-11 16:28:24 UTC
geez.. I see my mistake.. this should work
Chris thanks for your help and patience

Comment 9 wes hayutin 2011-07-11 16:41:53 UTC
[root@sgi-xe310-02 ~]# cat /root/templateRHEL61_norepo.tpl 
<template>
  <name>RHEL_postgres</name>
  <os>    
    <name>RHEL-6</name>    
    <version>1</version>
    <arch>x86_64</arch>
    <install type="url">
      <url>http://download.devel.redhat.com/released/RHEL-6-Server/6.1/x86_64/os/</url>
    </install>
  </os>
  <description>RHEL61 x86_64 with postgres</description>
  <packages>
    <package name='postgresql-server'/> 
  </packages>
</template>


[root@sgi-xe310-02 ~]# cat /root/templateRHEL61_norepo.tpl 
<template>
  <name>RHEL_postgres</name>
  <os>    
    <name>RHEL-6</name>    
    <version>1</version>
    <arch>x86_64</arch>
    <install type="url">
      <url>http://download.devel.redhat.com/released/RHEL-6-Server/6.1/x86_64/os/</url>
    </install>
  </os>
  <description>RHEL61 x86_64 with postgres</description>
  <packages>
    <package name='postgresql-server'/> 
  </packages>
</template>



[root@sgi-xe310-02 ~]# diff templateRHEL61_norepo.tpl templateRHEL61.tpl 
11a12,16
>  <repositories>
>     <repository name='myRHEL6Repo'>
>       <url>http://download.devel.redhat.com/released/RHEL-6-Server/6.1/x86_64/os/</url>
>       <signed>True</signed>
>     </repository>
13a19
>     <package name='zsh'/> 
[root@sgi-xe310-02 ~]# 





[root@sgi-xe310-02 ~]# aeolus-image build --target vmware --template /root/templateRHEL61.tpl
/usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.0.1/lib/build_command.rb:31:in `run': undefined method `each' for #<Qmf2::QmfAgentException:0x7f4bf3a96168> (NoMethodError)
	from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.0.1/lib/config_parser.rb:194:in `build'
	from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.0.1/lib/config_parser.rb:30:in `send'
	from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.0.1/lib/config_parser.rb:30:in `process'
	from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.0.1/bin/aeolus-image:6
	from /usr/bin/aeolus-image:19:in `load'
	from /usr/bin/aeolus-image:19
2011-07-11 12:37:34 warning Connection [60945 localhost:5672] closed
[root@sgi-xe310-02 ~]# aeolus-image build --target vmware --template /root/templateRHEL61
templateRHEL61_norepo.tpl  templateRHEL61.tpl         
[root@sgi-xe310-02 ~]# aeolus-image build --target vmware --template /root/templateRHEL61_norepo.tpl 

Target Image: a67cc2df-6fd0-4f74-b32b-c11ac88e620a
Image: 21d9aefb-f534-4083-a4cf-e76fbfeeb511
Build: 7f70f23d-747f-45ab-8de0-203e48af0a48
Status: BUILDING
Percent Complete: 0


my templateRHEL61.tpl has xml errors, but templateRHEL61_norepo.tpl passes xml checks and appears to be building.

Comment 10 Chris Lalancette 2011-07-11 18:00:16 UTC
OK.  So the TDL looks mostly correct now, but there is something else going wrong.  Ian, does the above error look familiar to you?  I would ask jayg normally, but he is on vacation this week.

Thanks.

Comment 11 Ian McLeod 2011-07-11 18:20:22 UTC
Chris.  I'm afraid I don't recognize the aeolus-image error messages, no.

However, the diff above suggests to me that the XML is missing a closing </repositories>

Wes,

It seems you meant to show both files in the comment above but ended up showing two copies of the "norepo" version.

Can you paste in the "with repo" version and we can take a closer look?

Comment 12 wes hayutin 2011-07-11 18:24:45 UTC
ugh. my apologies.. I hit yet another typo

Comment 13 wes hayutin 2011-12-08 14:11:57 UTC
perm close


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