OpenStack Compute Resource Fog error

There were a few fixes around openstack in foreman since that release.

  1. upgrade fog ( you can find 1.6 packaged in our development repo)
  2. consider using foreman nightly package instead.

Please let us know how it turns out.

Ohad

··· On Tue, Nov 6, 2012 at 5:47 PM, Rodrique Heron wrote:

Hi,

I installed Foreman from the yum repo, when I try to add a OpenStack
compute resource i received an error similar to the one here:
https://groups.google.com/forum/?fromgroups=#!topic/ruby-fog/00olP0_8dto,
and included below. What’s the stack of OpenStack support in the version
I’m running and should I be running the latest from git?

I am using rubygem-fog-1.4.0-1 and foreman-1.0.1-1.

Compute.new({:provider => :openstack, :openstack_api_key => “123456”,
:openstack_username => “admin”, :openstack_auth_url => “
http://10.117.0.24:5000/v2.0/**tokenshttp://10.117.0.24:5000/v2.0/tokens
”})
Excon::Errors::**InternalServerError: Expected([200, 204]) <=>
Actual(500 InternalServerError)
request => {:connect_timeout=>60,
:headers=>{“Content-Type”=>"**application/json",
“Host”=>“10.117.0.24:5000”, “Content-Length”=>71},
:instrumentor_name=>“excon”, :mock=>false, :read_timeout=>60,
:retry_limit=>4,
:ssl_ca_file=>"/usr/local/rvm/gems/ruby-1.9.3-p125@chef/
gems/excon-0.13.4/data/cacert.**pem",
:ssl_verify_peer=>true, :write_timeout=>60, :host=>“10.117.0.24”,
:path=>"/v2.0/tokens", :port=>“5000”, :query=>nil, :scheme=>“http”,
:expects=>[200, 204],
:body=>"{“auth”:{"**passwordCredentials":{"*username":“admin”,"
*password":123456}}}",
:method=>“POST”}
response => #<Excon::Response:**0x00000003367b28 @body="{“error”:
{“message”: “An unexpected error prevented the server from
fulfilling your request. object of type ‘int’ has no len()”,
“code”: 500, “title”: “Internal Server Error”}}",
@headers={“Content-Type”=>"**application/json", “Vary”=>“X-Auth-Token”,
“Content-Length”=>“177”, “Date”=>“Thu, 24 May 2012 22:39:55 GMT”},
@status=500>

Thanks


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/foreman-users/-/QNIDZIGB4SgJ.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

Did you ever figure out a resolution to your issue? I'm running into an
identical error here. Running foreman 1.0.2 on RHEL 5 with fog 1.4.0.

no such file to load – {"access": {"token": {"expires":
"2013-01-01T00:57:50Z", "id": "c718fe4bc7f34be3a138ca6ba9d40d89"},
"serviceCatalog": {}, "user": {"username": "[FILTERED]", "roles_links": [],
"id": "d58879f59a9a44df823bb7f0d2988362", "roles": [], "name":
"[FILTERED]"}}}

If you feel this is an error with Foreman itself, please open a new issue
with Foreman ticketing system<Issues - Foreman>,
You would probably need to attach the Full trace<https://hpmlx44d.hq.target.com/compute_resources#> and
relevant log entries.
LoadError
no such file to load – {"access": {"token": {"expires":
"2013-01-01T00:57:50Z", "id": "c718fe4bc7f34be3a138ca6ba9d40d89"},
"serviceCatalog": {}, "user": {"username": "
[FILTERED]", "roles_links":
[], "id": "d58879f59a9a44df823bb7f0d2988362", "roles": [], "name": "

[FILTERED]"}}}
lib/foreman/model/openstack.rb:36:in client&#39; lib/foreman/model/openstack.rb:39:insetup_key_pair'
app/controllers/compute_resources_controller.rb:35:in `create'
I am able to get a connection from fog to my openstack instance in irb:

irb(main):001:0> require 'rubygems'
e 'fog'=> true
irb(main):002:0> require 'fog'
=> true
irb(main):003:0> c=Fog::Compute.new({:provider => "OpenStack",
:openstack_api_key => "1234", :openstack_username => "myusername",
:openstack_auth_url => "myURL"})
=> #<Fog::Compute::OpenStack::Real:23469518014640
@current_tenant={"enabled"=>true, "name"=>"Puppet", "description"=>"A POC
project for Puppet.", "id"=>"a09d9b8e189d4763b22d940d085b49bf"} …

I'm really hoping to get past this issue without too much effort …
hacking code is OK. I have PoC I'm trying to prepare to demo this coming
Friday (1/4) and would like this integration to be a part of it, but if its
too much effort it may be time better spent on other things to PoC.

Thanks!
Jake

> Did you ever figure out a resolution to your issue? I'm running into an
> identical error here. Running foreman 1.0.2 on RHEL 5 with fog 1.4.0.
>
> can you try with fog 1.8 (part of our RC repo [1]) I think these issues
were solved.

I was never able to reproduce the problem, I'll try to spend some more time
with it today using RC3.

Ohad

[1] - http://yum.theforeman.org/rc

no such file to load – {"access": {"token": {"expires":

··· On Mon, Dec 31, 2012 at 3:16 AM, jmccann wrote: > "2013-01-01T00:57:50Z", "id": "c718fe4bc7f34be3a138ca6ba9d40d89"}, > "serviceCatalog": {}, "user": {"username": "[FILTERED]", "roles_links": [], > "id": "d58879f59a9a44df823bb7f0d2988362", "roles": [], "name": > "[FILTERED]"}}} > > If you feel this is an error with Foreman itself, please open a new issue > with Foreman ticketing system, > You would probably need to attach the Full trace and > relevant log entries. > *LoadError* > *no such file to load -- {"access": {"token": {"expires": > "2013-01-01T00:57:50Z", "id": "c718fe4bc7f34be3a138ca6ba9d40d89"}, > "serviceCatalog": {}, "user": {"username": "*[FILTERED]*", "roles_links": > [], "id": "d58879f59a9a44df823bb7f0d2988362", "roles": [], "name": "* > [FILTERED]*"}}}* > lib/foreman/model/openstack.rb:36:in `client' > > lib/foreman/model/openstack.rb:39:in `setup_key_pair' > app/controllers/compute_resources_controller.rb:35:in `create' > I am able to get a connection from fog to my openstack instance in irb: > > irb(main):001:0> require 'rubygems' > e 'fog'=> true > irb(main):002:0> require 'fog' > => true > irb(main):003:0> c=Fog::Compute.new({:provider => "OpenStack", > :openstack_api_key => "1234", :openstack_username => "myusername", > :openstack_auth_url => "myURL"}) > => # @current_tenant={"enabled"=>true, "name"=>"Puppet", "description"=>"A POC > project for Puppet.", "id"=>"a09d9b8e189d4763b22d940d085b49bf"} ... > > I'm really hoping to get past this issue without too much effort ... > hacking code is OK. I have PoC I'm trying to prepare to demo this coming > Friday (1/4) and would like this integration to be a part of it, but if its > too much effort it may be time better spent on other things to PoC. > > Thanks! > Jake > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/foreman-users/-/bJAT00KoR28J. > > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en. >

I switch to just running foreman devel branch and now the
release candidate tagged branch. This means I'm running the latest fog that
gets install from doing the bundle command to install the ruby gems.

Try the RC yum repo: http://yum.theforeman.org/rc

I'm going to try and post my notes on installing from foreman github, I
think this will be the best way to get the best of openstack until is
fulling supported by foreman.

··· On Sunday, December 30, 2012 8:16:57 PM UTC-5, jmccann wrote: > > Did you ever figure out a resolution to your issue? I'm running into an > identical error here. Running foreman 1.0.2 on RHEL 5 with fog 1.4.0. > > no such file to load -- {"access": {"token": {"expires": > "2013-01-01T00:57:50Z", "id": "c718fe4bc7f34be3a138ca6ba9d40d89"}, > "serviceCatalog": {}, "user": {"username": "[FILTERED]", "roles_links": [], > "id": "d58879f59a9a44df823bb7f0d2988362", "roles": [], "name": > "[FILTERED]"}}} > > If you feel this is an error with Foreman itself, please open a new issue > with Foreman ticketing system, > You would probably need to attach the Full trace and > relevant log entries. > *LoadError* > *no such file to load -- {"access": {"token": {"expires": > "2013-01-01T00:57:50Z", "id": "c718fe4bc7f34be3a138ca6ba9d40d89"}, > "serviceCatalog": {}, "user": {"username": "*[FILTERED]*", "roles_links": > [], "id": "d58879f59a9a44df823bb7f0d2988362", "roles": [], "name": "* > [FILTERED]*"}}}* > lib/foreman/model/openstack.rb:36:in `client' > lib/foreman/model/openstack.rb:39:in `setup_key_pair' > app/controllers/compute_resources_controller.rb:35:in `create' > I am able to get a connection from fog to my openstack instance in irb: > > irb(main):001:0> require 'rubygems' > e 'fog'=> true > irb(main):002:0> require 'fog' > => true > irb(main):003:0> c=Fog::Compute.new({:provider => "OpenStack", > :openstack_api_key => "1234", :openstack_username => "myusername", > :openstack_auth_url => "myURL"}) > => # @current_tenant={"enabled"=>true, "name"=>"Puppet", "description"=>"A POC > project for Puppet.", "id"=>"a09d9b8e189d4763b22d940d085b49bf"} ... > > I'm really hoping to get past this issue without too much effort ... > hacking code is OK. I have PoC I'm trying to prepare to demo this coming > Friday (1/4) and would like this integration to be a part of it, but if its > too much effort it may be time better spent on other things to PoC. > > Thanks! > Jake > >

That repo seems to not be working? When I edited the URL in my
foreman.repo file to the RC path
http://yum.theforeman.org/rc/el5/$basearch'' I get:

http://yum.theforeman.org/rc/el5/x86_64/repodata/primary.xml.gz: [Errno -3]
Error performing checksum

I then removed the foreman-release and tried to install the one for RC
(http://yum.theforeman.org/rc/el5/foreman-release.rpm which I found @
RPM's distribution based installation - Foreman)
and got:

[root@HOSTNAME yum.repos.d]# rpm -Uvh
http://yum.theforeman.org/rc/el5/foreman-release.rpm
Retrieving http://yum.theforeman.org/rc/el5/foreman-release.rpm
error: skipping http://yum.theforeman.org/rc/el5/foreman-release.rpm -
transfer failed - Unknown or unexpected error
warning: u 0x1d616710 ctrl 0x1d617b00 nrefs != 0 (yum.theforeman.org http)
[root@HOSTNAME yum.repos.d]# wget
http://yum.theforeman.org/rc/el5/foreman-release.rpm
–2012-12-31 09:41:52–
http://yum.theforeman.org/rc/el5/foreman-release.rpm
Resolving yum.theforeman.org… 173.255.232.203
Connecting to yum.theforeman.org|173.255.232.203|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2012-12-31 09:41:52 ERROR 404: Not Found.

I wanted to not only upgrade fog but also all foreman as I would also like
to try paramaterized classes which I believe is a part of 1.1 RC, correct?

I did try to update just fog from your rc repo, but after upgrading fog I
started getting phusion errors and foreman wouldn't load anymore. Seems it
was looking for 1.4 still even though bundler.d/fog.rb had 'gem "fog", ">=
1.4"'. I tried to 'fix' this by putting in 1.8, then got a new error that
Gemfile.lock couldn't be accessed. After going back to 1.4 for fog and
reverting bundler.d/fog.rb I was able to get foreman to start again.

Thanks,
Jake

> That repo seems to not be working? When I edited the URL in my
> foreman.repo file to the RC path
> http://yum.theforeman.org/rc/el5/$basearch'' I get:
>
> http://yum.theforeman.org/rc/el5/x86_64/repodata/primary.xml.gz: [Errno
> -3] Error performing checksum
>
>
Oh, it seems like the el5 repo was created using SHA256 and older version
of yum supports only sha1.
I've manually updated the repo data, so a yum clean all, yum install should
solve that.

I then removed the foreman-release and tried to install the one for RC (
> http://yum.theforeman.org/rc/el5/foreman-release.rpm which I found @
> RPM's distribution based installation - Foreman)
> and got:
>
> [root@HOSTNAME yum.repos.d]# rpm -Uvh
> http://yum.theforeman.org/rc/el5/foreman-release.rpm
> Retrieving http://yum.theforeman.org/rc/el5/foreman-release.rpm
> error: skipping http://yum.theforeman.org/rc/el5/foreman-release.rpm -
> transfer failed - Unknown or unexpected error
> warning: u 0x1d616710 ctrl 0x1d617b00 nrefs != 0 (yum.theforeman.org http)
>
same as the above

> [root@HOSTNAME yum.repos.d]# wget
> http://yum.theforeman.org/rc/el5/foreman-release.rpm
>

oh, you are right, it looks like RC3 was updated for el6, not for el5

–2012-12-31 09:41:52–
> http://yum.theforeman.org/rc/el5/foreman-release.rpm
> Resolving yum.theforeman.org… 173.255.232.203
> Connecting to yum.theforeman.org|173.255.232.203|:80… connected.
> HTTP request sent, awaiting response… 404 Not Found
> 2012-12-31 09:41:52 ERROR 404: Not Found.
>
> I wanted to not only upgrade fog but also all foreman as I would also like
> to try paramaterized classes which I believe is a part of 1.1 RC, correct?
>
correct.

>
> I did try to update just fog from your rc repo, but after upgrading fog I
> started getting phusion errors and foreman wouldn't load anymore. Seems it
> was looking for 1.4 still even though bundler.d/fog.rb had 'gem "fog", ">=
> 1.4"'. I tried to 'fix' this by putting in 1.8, then got a new error that
> Gemfile.lock couldn't be accessed. After going back to 1.4 for fog and
> reverting bundler.d/fog.rb I was able to get foreman to start again.
>

if you updated a depended gem you would need to:

su - foreman -s /bin/bash
bundle
exit

Ohad

··· On Mon, Dec 31, 2012 at 6:05 PM, jmccann wrote:

Thanks,
Jake


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/foreman-users/-/Obmgnn37eX8J.

To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

I was able to get the latest version of fog installed. I followed your
instructions, but when running 'bundle' as foreman got:

[root@HOSTNAME ~]# su - foreman -s /bin/bash
-bash-3.2$ bundle
Your Gemfile doesn't have any sources. You can add one with a line like
'source :rubygems'
Could not find fog-1.4.0 in any of the sources

So I editted bundle.d/fog.rb and changed from:

group :fog do
#gem "fog", :git => "https://github.com/fog/fog.git"
gem "fog", ">= 1.4"
end

to:

group :fog do
#gem "fog", :git => "https://github.com/fog/fog.git"
gem "fog", ">= 1.8"
end

Then ran 'bundle' as foreman again and got:

Using will_paginate (3.0.3)
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/definition.rb:194:in
`initialize': Permission denied - /usr/share/foreman/Gemfile.lock
(Errno::EACCES)

I ended up making foreman owner of '/usr/share/foreman/Gemfile.lock' and
then 'bundle' was able to complete successfully.

I tried adding a Compute resource again and get the same error as before.

Also, even after adding the RC repo it seems I can update some packages in
foreman repo but not all of them. Like fog I was able to grab from the
foreman RC repo, but package 'foreman' itself I am not.

[root@HOSTNAME foreman]# rpm -qa | grep foreman
foreman-1.0.2-1.el5
foreman-libvirt-1.0.2-1.el5
foreman-postgresql-1.0.2-1.el5
foreman-ec2-1.0.2-1.el5
foreman-ovirt-1.0.2-1.el5
[root@HOSTNAME foreman]# yum update foreman
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Excluding Packages in global exclude list
Finished
Skipping security plugin, no data
Setting up Update Process
No Packages marked for Update
[root@HOSTNAME foreman]# repoquery -i foreman
[root@HOSTNAME foreman]# repoquery -i rubygem-fog

Name : rubygem-fog
Version : 1.8.0
Release : 1.el5
Architecture: noarch
Size : 6498079
Packager : None
Group : Development/Ruby
URL : http://github.com/fog/fog
Repository : foreman
Summary : brings clouds to you
Description :
The Ruby cloud services library. Supports all major cloud providers
including
AWS, Rackspace, Linode, Blue Box, StormOnDemand, and many others. Full
support
for most AWS services including EC2, S3, CloudWatch, SimpleDB, ELB, and RDS.

Checking the filelist from the foreman RC repodata I do not see that
package listed as well…

Thanks,
Jake

So I got foreman running from develop branch. This is what it took.

I first ran into issues with version of pg gem trying to be installed
(latest I think). I ran into the following when trying to get the pg gem:

checking for pg_config_manual.h… yes
checking for PQconnectdb() in -lpq… yes
checking for PQconnectionUsedPassword()… no
Your PostgreSQL is too old. Either install an older version of this gem or
upgrade your database.

It seems the latest version of the gem was trying to be installed, but the
version of postgresql installed for RHEL 5 was too old. So I had to edit
bundler.d/postgresql.rb with the following to get a version of the gem
installed that would be old enough to work:

group :postgresql do
gem 'pg', '< 0.13'
end

So then I was able to get past this gem issue.

The next issue I was getting when when trying to access the /hosts page. I
would get an internal server error with trace in production.log looking
like:

Started GET "/hosts" for 10.117.208.158 at Wed Jan 02 21:09:25 -0600 2013
Processing by HostsController#index as HTML
Operation FAILED: PGError: ERROR: syntax error at or near "NULLS" at
character 60
: SELECT "hosts".* FROM "hosts" ORDER BY "hosts"."name" ASC NULLS FIRST
LIMIT 20 OFFSET 0
Rendered home/_topbar.rhtml (1.9ms)
Rendered home/_user_dropdown.rhtml (0.5ms)
Rendered common/500.rhtml within layouts/application (21.7ms)
Completed 500 Internal Server Error in 44ms

ActionView::Template::Error (undefined method to_label&#39; for nil:NilClass): 1: &lt;ul class=&quot;nav pull-right &quot;&gt; 2: &lt;li class=&quot;dropdown&quot;&gt; 3: &lt;%= user_header %&gt; 4: &lt;ul class=&quot;dropdown-menu pull-right&quot;&gt; 5: &lt;li&gt;&lt;%= link_to(&quot;Sign Out&quot;, logout_users_path) %&gt;&lt;/li&gt; 6: &lt;li&gt;&lt;%= link_to(&quot;My account&quot;, edit_user_path(User.current) )%&gt;&lt;/li&gt; app/helpers/home_helper.rb:96:inuser_header'
app/views/home/_user_dropdown.rhtml:3:in
_app_views_home__user_dropdown_rhtml__1004363033_23456318495540_4996990&#39; app/views/layouts/application.html.erb:31:in_app_views_layouts_application_html_erb___811713339_23456316872600_100830'
app/controllers/application_controller.rb:291:in `generic_exception'

What this ended up being was that the 'scoped_search' gem @ version =>
2.4.0 does not work with the version of postgresql I have installed with
RHEL 5. postgresql did not support 'NULLS FIRST' in the select statement.
So I editted Gemfile for the line defining scoped variable to not be >=
2.4.0 but be < 2.4.0:

gem 'scoped_search', '< 2.4'

I was then able to access the /hosts page without error. FYI on my
postgresql packages that caused me all these issues:

[root@HOSTNAME foreman]# rpm -qa | grep postgres
postgresql-8.1.23-5.el5_8
foreman-postgresql-1.0.2-1.el5
postgresql-server-8.1.23-5.el5_8
postgresql-devel-8.1.23-5.el5_8
postgresql84-libs-8.4.12-1.el5_8
postgresql-libs-8.1.23-5.el5_8
postgresql-libs-8.1.23-5.el5_8
postgresql-devel-8.1.23-5.el5_8

As part of my DB troubleshooting above I wiped my DB and recreated it as a
clean slate with rake. So now I had to resetup some of my puppet classes
in foreman (More => Configuration => Puppet Classes). What I usually do is
manually enter the classes I want people to be able to assign, and manually
control what environment those classes are in. Well, it seems in 1.1 I can
manually create classes, but can not specify what environments the class is
in. As far as I can tell this means I can't assign the class to any
systems then. The only way I could get classes with environments
associated to them was to import them from my puppet master (requiring
foreman-proxy integration). This forced me to import everything available
on my puppetmaster (I typically don't like everything that is actually on
my puppetmaster to necessarily be assignable through an ENC).

OK, so enough griping on that. I was able to get my compute resource
added!! It was able to see all the current instances I have.

I tried creating a new host. The first weird thing I encountered was when
assigning an OS. I chose and arch and OS I wanted. But the images list
still listed all images, including images that were a different OS. I
would think this dropdown should filter based on arch/OS to only show
images that are defined as the same arch/OS.

The second thing I encountered was an issue. When I try to create the host
it gets past 'completed - Settings up compute instance' Then it freezes
for a long while at 'running - Acquiring IP address for test.novalocal'. I
then see in my production.log something like the following repeating:

Started GET "/tasks/b3fb7575-1069-4661-af02-bfc600cbf8b8" for IPADDRESS at
Thu Jan 03 00:23:42 -0600 2013
Processing by TasksController#show as
Parameters: {"id"=>"b3fb7575-1069-4661-af02-bfc600cbf8b8"}
Rendered tasks/_list.rhtml (1.5ms)
Completed 200 OK in 7ms (Views: 2.7ms | ActiveRecord: 2.4ms)

Eventually I get error 'Unable to save: Failed to destroy a compute
OpenStackPOC (OpenStack) instance test.novalocal:
ActiveRecord::RecordNotFound'.

And logs look like:

Started POST "/hosts" for 10.117.208.158 at Thu Jan 03 00:20:57 -0600 2013
Processing by HostsController#create as
Parameters: {"utf8"=>"✓", "capabilities"=>"image", "host"=>{"mac"=>"",
"puppetclass_ids"=>[""], "disk"=>"", "overwrite"=>"false", "name"=>"test",
"domain_id"=>"1", "compute_resource_id"=>"1",
"compute_attributes"=>{"image_ref"=>"d8d100ea-52ba-435d-8895-e77535d73770",
"flavor_ref"=>"1", "security_groups"=>"default",
"tenant_id"=>"a09d9b8e189d4763b22d940d085b49bf"}, "environment_id"=>"1",
"root_pass"=>"[FILTERED]", "puppet_proxy_id"=>"1", "managed"=>"true",
"provision_method"=>"image", "comment"=>"", "operatingsystem_id"=>"1",
"build"=>"1", "enabled"=>"1", "hostgroup_id"=>"",
"progress_report_id"=>"[FILTERED]", "is_owned_by"=>"1-Users",
"architecture_id"=>"1"},
"authenticity_token"=>"9dXuTfm0AO2kvxM5WNeJcynC5ZiWlkSVVViXZOjBHjo="}
Adding Compute instance for test.novalocal
waiting for instance to acquire ip address
Rolling back due to a problem: Acquiring IP address for test.novalocal 2
failed test.novalocalsetComputeIP
Removing Compute instance for test.novalocal
Failed to destroy a compute OpenStackPOC (OpenStack) instance
test.novalocal:
ActiveRecord::RecordNotFound/opt/foreman/app/models/compute_resource.rb:104:in
find_vm_by_uuid&#39; /opt/foreman/app/models/compute_resource.rb:124:indestroy_vm'

I do see an instance created in my OpenStack environment, although foreman
doesn't get to the point of installing puppet onto it and beginning to
manage it. So it doesn't get fully created, and doesn't get cleaned up
after failure.

All of the above is information in the hopes it can help identify/fix
issues. I do have to say I like the new features and layouts being brought
in 1.1 (well, for me its really anything past 1.0 ;). Keep up the great
work!

Regards,
Jake

> So I got foreman running from develop branch. This is what it took.
>
> I first ran into issues with version of pg gem trying to be installed
> (latest I think). I ran into the following when trying to get the pg gem:
>
> checking for pg_config_manual.h… yes
> checking for PQconnectdb() in -lpq… yes
> checking for PQconnectionUsedPassword()… no
> Your PostgreSQL is too old. Either install an older version of this gem or
> upgrade your database.
>
> You could probably just install the rubygem rpms directly, but thats for
next time :slight_smile:

It seems the latest version of the gem was trying to be installed, but the
> version of postgresql installed for RHEL 5 was too old. So I had to edit
> bundler.d/postgresql.rb with the following to get a version of the gem
> installed that would be old enough to work:
>
> group :postgresql do
> gem 'pg', '< 0.13'
> end
>

good to know! /cc Sam :slight_smile:

>
> So then I was able to get past this gem issue.
>
> The next issue I was getting when when trying to access the /hosts page.
> I would get an internal server error with trace in production.log looking
> like:
>
> Started GET "/hosts" for 10.117.208.158 at Wed Jan 02 21:09:25 -0600 2013
> Processing by HostsController#index as HTML
> Operation FAILED: PGError: ERROR: syntax error at or near "NULLS" at
> character 60
> : SELECT "hosts".* FROM "hosts" ORDER BY "hosts"."name" ASC NULLS FIRST
> LIMIT 20 OFFSET 0
> Rendered home/_topbar.rhtml (1.9ms)
> Rendered home/_user_dropdown.rhtml (0.5ms)
> Rendered common/500.rhtml within layouts/application (21.7ms)
> Completed 500 Internal Server Error in 44ms
>
> ActionView::Template::Error (undefined method to_label&#39; for nil:NilClass): &gt; 1: &lt;ul class=&quot;nav pull-right &quot;&gt; &gt; 2: &lt;li class=&quot;dropdown&quot;&gt; &gt; 3: &lt;%= user_header %&gt; &gt; 4: &lt;ul class=&quot;dropdown-menu pull-right&quot;&gt; &gt; 5: &lt;li&gt;&lt;%= link_to(&quot;Sign Out&quot;, logout_users_path) %&gt;&lt;/li&gt; &gt; 6: &lt;li&gt;&lt;%= link_to(&quot;My account&quot;, edit_user_path(User.current) &gt; )%&gt;&lt;/li&gt; &gt; app/helpers/home_helper.rb:96:inuser_header'
> app/views/home/_user_dropdown.rhtml:3:in
> _app_views_home__user_dropdown_rhtml__1004363033_23456318495540_4996990&#39; &gt; app/views/layouts/application.html.erb:31:in &gt;_app_views_layouts_application_html_erb___811713339_23456316872600_100830'
> app/controllers/application_controller.rb:291:in `generic_exception'
>
> What this ended up being was that the 'scoped_search' gem @ version =>
> 2.4.0 does not work with the version of postgresql I have installed with
> RHEL 5. postgresql did not support 'NULLS FIRST' in the select statement.
> So I editted Gemfile for the line defining scoped variable to not be >=
> 2.4.0 but be < 2.4.0:
>
> gem 'scoped_search', '< 2.4'
>

Good to know again, Amos, can we somehow handle it differently in scoped
search internally?

>
> I was then able to access the /hosts page without error. FYI on my
> postgresql packages that caused me all these issues:
>
> [root@HOSTNAME foreman]# rpm -qa | grep postgres
> postgresql-8.1.23-5.el5_8
> foreman-postgresql-1.0.2-1.el5
> postgresql-server-8.1.23-5.el5_8
> postgresql-devel-8.1.23-5.el5_8
> postgresql84-libs-8.4.12-1.el5_8
> postgresql-libs-8.1.23-5.el5_8
> postgresql-libs-8.1.23-5.el5_8
> postgresql-devel-8.1.23-5.el5_8
>
> As part of my DB troubleshooting above I wiped my DB and recreated it as a
> clean slate with rake. So now I had to resetup some of my puppet classes
> in foreman (More => Configuration => Puppet Classes). What I usually do is
> manually enter the classes I want people to be able to assign, and manually
> control what environment those classes are in. Well, it seems in 1.1 I can
> manually create classes, but can not specify what environments the class is
> in. As far as I can tell this means I can't assign the class to any
> systems then. The only way I could get classes with environments
> associated to them was to import them from my puppet master (requiring
> foreman-proxy integration). This forced me to import everything available
> on my puppetmaster (I typically don't like everything that is actually on
> my puppetmaster to necessarily be assignable through an ENC).
>

What about maintaining a black list?
see config/ignored_environments.yml.sample, you can add both env names and
puppet class names to ignore (also via regexp).

> OK, so enough griping on that. I was able to get my compute resource
> added!! It was able to see all the current instances I have.
>
> I tried creating a new host. The first weird thing I encountered was when
> assigning an OS. I chose and arch and OS I wanted. But the images list
> still listed all images, including images that were a different OS. I
> would think this dropdown should filter based on arch/OS to only show
> images that are defined as the same arch/OS.
>

Thats odd, assuming you have assigned your OpenStack images to the OS, you
should only see the relevant images… if not, open a bug, I'll try to
reproduce later today.

>
> The second thing I encountered was an issue. When I try to create the
> host it gets past 'completed - Settings up compute instance' Then it
> freezes for a long while at 'running - Acquiring IP address for
> test.novalocal'. I then see in my production.log something like the
> following repeating:
>

In your env, do you let nova assign ipaddresses, or do the vm's are only in
the internal network? a known issue now is that we don't attach ips (just
yet).

>
> Started GET "/tasks/b3fb7575-1069-4661-af02-bfc600cbf8b8" for IPADDRESS at
> Thu Jan 03 00:23:42 -0600 2013
> Processing by TasksController#show as
> Parameters: {"id"=>"b3fb7575-1069-4661-af02-bfc600cbf8b8"}
> Rendered tasks/_list.rhtml (1.5ms)
> Completed 200 OK in 7ms (Views: 2.7ms | ActiveRecord: 2.4ms)
>

Thats normal --> thats what update the progress bar, however, you need to
passeger or a non webrick server to see it.

>
> Eventually I get error 'Unable to save: Failed to destroy a compute
> OpenStackPOC (OpenStack) instance test.novalocal:
> ActiveRecord::RecordNotFound'.
>
> And logs look like:
>
> Started POST "/hosts" for 10.117.208.158 at Thu Jan 03 00:20:57 -0600 2013
> Processing by HostsController#create as
> Parameters: {"utf8"=>"✓", "capabilities"=>"image", "host"=>{"mac"=>"",
> "puppetclass_ids"=>[""], "disk"=>"", "overwrite"=>"false", "name"=>"test",
> "domain_id"=>"1", "compute_resource_id"=>"1",
> "compute_attributes"=>{"image_ref"=>"d8d100ea-52ba-435d-8895-e77535d73770",
> "flavor_ref"=>"1", "security_groups"=>"default",
> "tenant_id"=>"a09d9b8e189d4763b22d940d085b49bf"}, "environment_id"=>"1",
> "root_pass"=>"[FILTERED]", "puppet_proxy_id"=>"1", "managed"=>"true",
> "provision_method"=>"image", "comment"=>"", "operatingsystem_id"=>"1",
> "build"=>"1", "enabled"=>"1", "hostgroup_id"=>"",
> "progress_report_id"=>"[FILTERED]", "is_owned_by"=>"1-Users",
> "architecture_id"=>"1"},
> "authenticity_token"=>"9dXuTfm0AO2kvxM5WNeJcynC5ZiWlkSVVViXZOjBHjo="}
> Adding Compute instance for test.novalocal
> waiting for instance to acquire ip address
> Rolling back due to a problem: Acquiring IP address for test.novalocal 2
> failed test.novalocalsetComputeIP
> Removing Compute instance for test.novalocal
> Failed to destroy a compute OpenStackPOC (OpenStack) instance
> test.novalocal:
> ActiveRecord::RecordNotFound/opt/foreman/app/models/compute_resource.rb:104:in
> find_vm_by_uuid&#39; &gt; /opt/foreman/app/models/compute_resource.rb:124:indestroy_vm'
>
> I do see an instance created in my OpenStack environment, although foreman
> doesn't get to the point of installing puppet onto it and beginning to
> manage it. So it doesn't get fully created, and doesn't get cleaned up
> after failure.
>

So it seems there are two issues here:

  1. ip address is not reachable to foreman
  2. foreman does not delete the instance correctly on failure.

>
> All of the above is information in the hopes it can help identify/fix
> issues. I do have to say I like the new features and layouts being brought
> in 1.1 (well, for me its really anything past 1.0 ;). Keep up the great
> work!
>
> Thanks, sorry it took you so long to set it up, on a side note, I hope now
it would be easier for you to get going, and hopefully one day you would
upgrade from rhel5 :wink:

Ohad

··· On Thu, Jan 3, 2013 at 8:38 AM, jmccann wrote:

Regards,
Jake


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/foreman-users/-/IeGy5dZaEDEJ.

To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

Thanks for the pointers on config/ignored_environments.yml.sample, that may
be what I need and I'll check it out.

In our nova environment a system gets a 'private' IP 'by default'. That's
to say when I launch a image into a new instance it'll automatically get a
DHCP addr on 192.168.x.x. We then have a pool of floating IPs that can be
assigned to the system as well. The IP that is automatically assigned to
the instance is not accessible externally, the floating IPs that can be
assigned are. So it sounds like when the instance is created foreman
assumes the IP automatically given should be reachable, and since its not
in my case I ran into the above issue? :frowning: But it also sounds like a
feature is in the works for assigning floating IPs. :slight_smile:

And I know RHEL5 is really old. OK, really really really old … but its
what I'm forced to work with currently. :frowning: But since RH supports it until
2017 I thought it was worth pointing out.

Thanks!
Jake

> Thanks for the pointers on config/ignored_**environments.yml.sample, that
> may be what I need and I'll check it out.
>
> In our nova environment a system gets a 'private' IP 'by default'. That's
> to say when I launch a image into a new instance it'll automatically get a
> DHCP addr on 192.168.x.x. We then have a pool of floating IPs that can be
> assigned to the system as well. The IP that is automatically assigned to
> the instance is not accessible externally, the floating IPs that can be
> assigned are. So it sounds like when the instance is created foreman
> assumes the IP automatically given should be reachable, and since its not
> in my case I ran into the above issue? :frowning: But it also sounds like a
> feature is in the works for assigning floating IPs. :slight_smile:
>
> Yes, I've seen that the support for it has been recently added to fog, and
that we now have multi nic support in foreman, it should be done, however,
I didnt not get to it yet.

there is a way for telling nova to auto assign floating ips, if thats an
acceptable workaround for now…

Ohad

··· On Thu, Jan 3, 2013 at 4:13 PM, jmccann wrote:

And I know RHEL5 is really old. OK, really really really old … but its
what I’m forced to work with currently. :frowning: But since RH supports it until
2017 I thought it was worth pointing out.

Thanks!
Jake


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/foreman-users/-/bxROjvsEN4YJ.

To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

Thanks for pointing this out - I'll be sure to fix the dependency issues when the 1.1RC4 packages are released.

-Sam

··· ----- Original Message ----- From: "jmccann" To: foreman-users@googlegroups.com Sent: Thursday, January 3, 2013 9:13:26 AM Subject: Re: [foreman-users] OpenStack Compute Resource Fog error

Thanks for the pointers on config/ignored_environments.yml.sample, that may be what I need and I’ll check it out.

In our nova environment a system gets a ‘private’ IP ‘by default’. That’s to say when I launch a image into a new instance it’ll automatically get a DHCP addr on 192.168.x.x. We then have a pool of floating IPs that can be assigned to the system as well. The IP that is automatically assigned to the instance is not accessible externally, the floating IPs that can be assigned are. So it sounds like when the instance is created foreman assumes the IP automatically given should be reachable, and since its not in my case I ran into the above issue? :frowning: But it also sounds like a feature is in the works for assigning floating IPs. :slight_smile:

And I know RHEL5 is really old. OK, really really really old … but its what I’m forced to work with currently. :frowning: But since RH supports it until 2017 I thought it was worth pointing out.

Thanks!
Jake


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To view this discussion on the web visit https://groups.google.com/d/msg/foreman-users/-/bxROjvsEN4YJ .
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

Yup, just add:

auto_assign_floating_ip=True

to /etc/nova/nova.conf and restart the network restart.

··· ----- Original Message ----- From: "Ohad Levy" To: foreman-users@googlegroups.com Sent: Thursday, January 3, 2013 9:50:39 AM Subject: Re: [foreman-users] OpenStack Compute Resource Fog error

On Thu, Jan 3, 2013 at 4:13 PM, jmccann < gaferion@gmail.com > wrote:

Thanks for the pointers on config/ignored_ environments.yml.sample, that may be what I need and I’ll check it out.

In our nova environment a system gets a ‘private’ IP ‘by default’. That’s to say when I launch a image into a new instance it’ll automatically get a DHCP addr on 192.168.x.x. We then have a pool of floating IPs that can be assigned to the system as well. The IP that is automatically assigned to the instance is not accessible externally, the floating IPs that can be assigned are. So it sounds like when the instance is created foreman assumes the IP automatically given should be reachable, and since its not in my case I ran into the above issue? :frowning: But it also sounds like a feature is in the works for assigning floating IPs. :slight_smile:

Yes, I’ve seen that the support for it has been recently added to fog, and that we now have multi nic support in foreman, it should be done, however, I didnt not get to it yet.

there is a way for telling nova to auto assign floating ips, if thats an acceptable workaround for now…

Ohad

And I know RHEL5 is really old. OK, really really really old … but its what I’m forced to work with currently. :frowning: But since RH supports it until 2017 I thought it was worth pointing out.

Thanks!

Jake


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To view this discussion on the web visit https://groups.google.com/d/msg/foreman-users/-/bxROjvsEN4YJ .

To post to this group, send email to foreman-users@googlegroups.com .
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com .
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en .


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

Thanks for this protip! I don't manage our current openstack env, but I'll
pass this along as perhaps something they would consider adding for now.

Regards,
Jake