Cloudstack Compute Resource

Hello,

I have recently modified Foreman to create a new compute resource for
Cloudstack. I have created a class Cloudstack which is a subclass of
ComputeResource. I have added this class to Foreman, made the
configurations and U/I changes and can now add this compute resource to
Foreman. The problem I run into is when I am trying to create a new image
for this compute resource. The class Cloudstack has a method "def
capabilities" which returns an array with "[:image]" as the value. When I
click on the "new image" link for this compute resource I get a SocketError
as stated below. When I comment out the "image_field(f)" code on line 8 I
am able to successfully render the page. This leads me to believe there is
something funny going on with the call to render images. I'm stuck as to
why this could cause a problem. I've configured the Cloudstack class to
return a correctly configured "Fog" object for the method "def client" so I
know my configuration is correct.

Any help is appreciated!

TIA

Amir

Excon::Errors::SocketError in Images#new

Showing /usr/share/foreman/app/views/images/_form.html.erb where line #8raised:

getaddrinfo: Name or service not known (SocketError)

Extracted source (around line #8):

5: <%= select_f f, :operatingsystem_id, Operatingsystem.all, :id, :to_label %>

6: <%= select_f f, :architecture_id, Architecture.all, :id, :to_label %>

7: <%= text_f f, :username, :value => @image.username || "root", :help_inline => _("The user that is used to ssh into the instance, normally cloud-user, ec2-user, ubuntu, root etc") %>

8: <% image_field(f) %>

9: <%= checkbox_f f, :user_data, :help_inline => _("Does this image support user data input (e.g. via cloud-init)?") %>

10: <% if @compute_resource.provider == 'EC2' %>

11: <%# TODO - Get IAM roles from AWS and display in select drop %>

Trace of template inclusion: app/views/images/new.html.erb

Rails.root: /usr/share/foreman

Application Trace<http://foremanstage1.ops.expertcity.com/compute_resources/16/images/new>| Framework
Trace<http://foremanstage1.ops.expertcity.com/compute_resources/16/images/new>| Full
Trace<http://foremanstage1.ops.expertcity.com/compute_resources/16/images/new>

app/helpers/images_helper.rb:6:in `any?'

app/helpers/images_helper.rb:6:in `image_field'

app/views/images/_form.html.erb:8:in `block in _app_views_images__form_html_erb__2777779080878012596_47635220'

app/helpers/layout_helper.rb:218:in `form_for'

app/views/images/_form.html.erb:1:in `_app_views_images__form_html_erb__2777779080878012596_47635220'

app/views/images/new.html.erb:3:in `_app_views_images_new_html_erb__4269853836933691796_47616260'

app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'

lib/middleware/catch_json_parse_errors.rb:9:in `call'

Hello,

I see your pull request now, is this still valid or you worked it out?

LZ

··· On Mon, Mar 31, 2014 at 04:14:06PM -0700, amirinator1 wrote: > > > Hello, > > I have recently modified Foreman to create a new compute resource for > Cloudstack. I have created a class Cloudstack which is a subclass of > ComputeResource. I have added this class to Foreman, made the > configurations and U/I changes and can now add this compute resource to > Foreman. The problem I run into is when I am trying to create a new image > for this compute resource. The class Cloudstack has a method "def > capabilities" which returns an array with "[:image]" as the value. When I > click on the "new image" link for this compute resource I get a SocketError > as stated below. When I comment out the "image_field(f)" code on line 8 I > am able to successfully render the page. This leads me to believe there is > something funny going on with the call to render images. I'm stuck as to > why this could cause a problem. I've configured the Cloudstack class to > return a correctly configured "Fog" object for the method "def client" so I > know my configuration is correct. > > Any help is appreciated! > > > TIA > > Amir > > > > > > > > > Excon::Errors::SocketError in Images#new > > Showing */usr/share/foreman/app/views/images/_form.html.erb* where line *#8*raised: > > getaddrinfo: Name or service not known (SocketError) > > Extracted source (around line *#8*): > > 5: <%= select_f f, :operatingsystem_id, Operatingsystem.all, :id, :to_label %> > > 6: <%= select_f f, :architecture_id, Architecture.all, :id, :to_label %> > > 7: <%= text_f f, :username, :value => @image.username || "root", :help_inline => _("The user that is used to ssh into the instance, normally cloud-user, ec2-user, ubuntu, root etc") %> > > 8: <% image_field(f) %> > > 9: <%= checkbox_f f, :user_data, :help_inline => _("Does this image support user data input (e.g. via cloud-init)?") %> > > 10: <% if @compute_resource.provider == 'EC2' %> > > 11: <%# TODO - Get IAM roles from AWS and display in select drop %> > > Trace of template inclusion: app/views/images/new.html.erb > > Rails.root: /usr/share/foreman > > Application Trace| Framework > Trace| Full > Trace > > app/helpers/images_helper.rb:6:in `any?' > > app/helpers/images_helper.rb:6:in `image_field' > > app/views/images/_form.html.erb:8:in `block in _app_views_images__form_html_erb__2777779080878012596_47635220' > > app/helpers/layout_helper.rb:218:in `form_for' > > app/views/images/_form.html.erb:1:in `_app_views_images__form_html_erb__2777779080878012596_47635220' > > app/views/images/new.html.erb:3:in `_app_views_images_new_html_erb__4269853836933691796_47616260' > > app/models/concerns/foreman/thread_session.rb:33:in `clear_thread' > > lib/middleware/catch_json_parse_errors.rb:9:in `call' > > > > -- > You received this message because you are subscribed to the Google Groups "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

We have figured this one out.

··· On Friday, April 4, 2014 3:19:20 AM UTC-7, Lukas Zapletal wrote: > > Hello, > > I see your pull request now, is this still valid or you worked it out? > > LZ > > On Mon, Mar 31, 2014 at 04:14:06PM -0700, amirinator1 wrote: > > > > > > Hello, > > > > I have recently modified Foreman to create a new compute resource for > > Cloudstack. I have created a class Cloudstack which is a subclass of > > ComputeResource. I have added this class to Foreman, made the > > configurations and U/I changes and can now add this compute resource to > > Foreman. The problem I run into is when I am trying to create a new > image > > for this compute resource. The class Cloudstack has a method "def > > capabilities" which returns an array with "[:image]" as the value. When > I > > click on the "new image" link for this compute resource I get a > SocketError > > as stated below. When I comment out the "image_field(f)" code on line 8 > I > > am able to successfully render the page. This leads me to believe there > is > > something funny going on with the call to render images. I'm stuck as to > > why this could cause a problem. I've configured the Cloudstack class to > > return a correctly configured "Fog" object for the method "def client" > so I > > know my configuration is correct. > > > > Any help is appreciated! > > > > > > TIA > > > > Amir > > > > > > > > > > > > > > > > > > Excon::Errors::SocketError in Images#new > > > > Showing */usr/share/foreman/app/views/images/_form.html.erb* where line > *#8*raised: > > > > getaddrinfo: Name or service not known (SocketError) > > > > Extracted source (around line *#8*): > > > > 5: <%= select_f f, :operatingsystem_id, Operatingsystem.all, :id, > :to_label %> > > > > 6: <%= select_f f, :architecture_id, Architecture.all, :id, :to_label > %> > > > > 7: <%= text_f f, :username, :value => @image.username || "root", > :help_inline => _("The user that is used to ssh into the instance, normally > cloud-user, ec2-user, ubuntu, root etc") %> > > > > 8: <% image_field(f) %> > > > > 9: <%= checkbox_f f, :user_data, :help_inline => _("Does this image > support user data input (e.g. via cloud-init)?") %> > > > > 10: <% if @compute_resource.provider == 'EC2' %> > > > > 11: <%# TODO - Get IAM roles from AWS and display in select drop %> > > > > Trace of template inclusion: app/views/images/new.html.erb > > > > Rails.root: /usr/share/foreman > > > > Application Trace< > http://foremanstage1.ops.expertcity.com/compute_resources/16/images/new>| > Framework > > Trace< > http://foremanstage1.ops.expertcity.com/compute_resources/16/images/new>| > Full > > Trace< > http://foremanstage1.ops.expertcity.com/compute_resources/16/images/new> > > > > app/helpers/images_helper.rb:6:in `any?' > > > > app/helpers/images_helper.rb:6:in `image_field' > > > > app/views/images/_form.html.erb:8:in `block in > _app_views_images__form_html_erb__2777779080878012596_47635220' > > > > app/helpers/layout_helper.rb:218:in `form_for' > > > > app/views/images/_form.html.erb:1:in > `_app_views_images__form_html_erb__2777779080878012596_47635220' > > > > app/views/images/new.html.erb:3:in > `_app_views_images_new_html_erb__4269853836933691796_47616260' > > > > app/models/concerns/foreman/thread_session.rb:33:in `clear_thread' > > > > lib/middleware/catch_json_parse_errors.rb:9:in `call' > > > > > > > > -- > > You received this message because you are subscribed to the Google > Groups "foreman-dev" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to foreman-dev...@googlegroups.com . > > For more options, visit https://groups.google.com/d/optout. > > -- > Later, > > Lukas "lzap" Zapletal > irc: lzap #theforeman >