Foreman Error creating compute resource

I'm using Ubuntu 14.04. I'm trying to make a compute resource in foreman
using libvirt. I followed the instructions, but I keep getting the
following error when I enter my url: "Unable to save, uninitialized
constant Libvirt".

Any help on how to fix this is greatly appreciated. Note: I posted this to
the Foreman Users google group but received no replies from anyone;
therefore, I'm asking for help in this group.

Here is output from the log file when I try to test the url when creating a
compute resource:

2016-05-02T08:54:07 [app] [I] Started PUT
"/compute_resources/test_connection" for 127.0.0.1 at 2016-05-02 08:54:07
+0700

2016-05-02T08:54:07 [app] [I] Processing by
ComputeResourcesController#test_connection as /

2016-05-02T08:54:07 [app] [I] Parameters: {"utf8"=>"✓",
"authenticity_token"=>"k0E16W45aQJHl3G4GPQ0QgY6omp6n4Ad7FewtktcA9s=",
"compute_resource"=>{"name"=>"test", "description"=>"qemu+ssh://
root@hypervisor.antothijah.lis.asianhope.org/system", "url"=>"qemu+ssh://
antothijah.lis.asianhope.org", "display_type"=>"VNC",
"set_console_password"=>"[FILTERED]"}, "cr_id"=>"1"}

2016-05-02T08:54:07 [app] [I] CR_ID IS 1

2016-05-02T08:54:07 [app] [I] Rendered
compute_resources/form/_libvirt.html.erb (4.0ms)

2016-05-02T08:54:07 [app] [I] Rendered compute_resources/_form.html.erb
(14.2ms)

2016-05-02T08:54:07 [app] [I] Completed 200 OK in 38ms (Views: 17.8ms |
ActiveRecord: 2.3ms)

Hi,
I see from your log that connection to Libvirt can be established when
testing. Could you go to /etc/foreman/settings.yml, change log level to
'debug', restart server, try to create libvirt compute resource again?
Something should turn up in logs pointing in the direction of the problem.
Also check if you have :unattended: true in /etc/foreman/settings.yml. What
foreman version are you running?

>
>
> I'm using Ubuntu 14.04. I'm trying to make a compute resource in foreman
> using libvirt. I followed the instructions, but I keep getting the
> following error when I enter my url: "Unable to save, uninitialized
> constant Libvirt".
>
> Any help on how to fix this is greatly appreciated. Note: I posted this to
> the Foreman Users google group but received no replies from anyone;
> therefore, I'm asking for help in this group.

Do you have the 'foreman-libvirt' package? If not, please install it
then restart the httpd service.

··· On 05/04, Byron Injeeli wrote:

Here is output from the log file when I try to test the url when creating a
compute resource:

2016-05-02T08:54:07 [app] [I] Started PUT
"/compute_resources/test_connection" for 127.0.0.1 at 2016-05-02 08:54:07
+0700

2016-05-02T08:54:07 [app] [I] Processing by
ComputeResourcesController#test_connection as /

2016-05-02T08:54:07 [app] [I] Parameters: {“utf8”=>“✓”,
“authenticity_token”=>“k0E16W45aQJHl3G4GPQ0QgY6omp6n4Ad7FewtktcA9s=”,
“compute_resource”=>{“name”=>“test”, “description”=>“qemu+ssh://
root@hypervisor.antothijah.lis.asianhope.org/system”, “url”=>“qemu+ssh://
antothijah.lis.asianhope.org”, “display_type”=>“VNC”,
“set_console_password”=>"[FILTERED]"}, “cr_id”=>“1”}

2016-05-02T08:54:07 [app] [I] CR_ID IS 1

2016-05-02T08:54:07 [app] [I] Rendered
compute_resources/form/_libvirt.html.erb (4.0ms)

2016-05-02T08:54:07 [app] [I] Rendered compute_resources/_form.html.erb
(14.2ms)

2016-05-02T08:54:07 [app] [I] Completed 200 OK in 38ms (Views: 17.8ms |
ActiveRecord: 2.3ms)


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.


Daniel Lobato Garcia

@dLobatog
blog.daniellobato.me
daniellobato.me

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Keybase: https://keybase.io/elobato

Thanks for the reply. I installed foreman-libvirt. Now I'm getting this
error:
Error making a connection to libvirt URI
qemu+ssh://root@hypervisor.antothijah.lis.asianhope.org/system: Call to
virConnectOpen failed: Cannot recv data: ssh: Could not resolve hostname
hypervisor.antothijah.lis.asianhope.org: Name or service not known:
Connection reset by peer

Sorry, but I'm not sure what you mean by "resolve that name from the
Foreman host". I can ping the domain name: antothijah.lis.asianhope.org.

··· -- Asian Hope

Thanks for the clarification. I cannot ping
hypervisor.antothijah.lis.asianhope.org
<http://www.google.com/url?q=http%3A%2F%2Fhypervisor.antothijah.lis.asianhope.org&sa=D&sntz=1&usg=AFQjCNEapeFdlGLxPSxD-mGWI7Bukay3-w>.
It says unknown host.

Thanks again Greg. Can you please tell me how I can troubleshoot the DNS
error? I really don't know where to start.

I changed the log level to debug and checked that the unattended level is
true, then I restarted the server, but that did not help. Here is the
System Information: Version 1.11.0 © 2009-2016.

(e.g. via ping) ?

··· On 16 May 2016 at 03:09, Byron Injeeli wrote:

Thanks for the reply. I installed foreman-libvirt. Now I’m getting this
error:
Error making a connection to libvirt URI qemu+ssh://
root@hypervisor.antothijah.lis.asianhope.org/system: Call to
virConnectOpen failed: Cannot recv data: ssh: Could not resolve hostname
hypervisor.antothijah.lis.asianhope.org: Name or service not known:
Connection reset by peer

Sounds like DNS issues - can you resolve that name from the Foreman host

You can ping "antothijah.lis.asianhope.org" but you've used "
hypervisor.antothijah.lis.asianhope.org" in your Compute Resource
configuration. Check that you can ping the latter, from the Foreman host.

Greg

··· On 17 May 2016 at 02:43, Byron Injeeli wrote:

Sorry, but I’m not sure what you mean by “resolve that name from the
Foreman host”. I can ping the domain name: antothijah.lis.asianhope.org.

Then you have a DNS problem which you'll need to solve before you can move
forwards.

Greg

··· On 18 May 2016 at 02:37, Byron Injeeli wrote:

Thanks for the clarification. I cannot ping
hypervisor.antothijah.lis.asianhope.org
http://www.google.com/url?q=http%3A%2F%2Fhypervisor.antothijah.lis.asianhope.org&sa=D&sntz=1&usg=AFQjCNEapeFdlGLxPSxD-mGWI7Bukay3-w.
It says unknown host.