fog / fog-xenserver

Module for the 'fog' gem to support XENSERVER
MIT License
16 stars 22 forks source link

"xenserver has no compute service" #60

Closed NeilHanlon closed 7 years ago

NeilHanlon commented 8 years ago

When using fog-xenserver with Foreman as a compute resource, I get this message when trying to list vms:

There was an error listing VMs: xenserver has no compute service

Is this plugin actively maintained anymore? What can I do to spark life back into it?

plribeiro3000 commented 8 years ago

Yes. It is being maintained.

Can you provide more feedback on the issue?

plribeiro3000 commented 8 years ago

It does not have heavy development anymore because it does support almost the whole API already if not all. Whats left are bugs i believe.

plribeiro3000 commented 8 years ago

Can you post the version og fog adn fog-core?

fernandes commented 8 years ago

and we run this gem in production 😎

NeilHanlon commented 8 years ago

@plribeiro3000

[root@c4katello01 gems]# ls | grep fog
fog-1.37.0
fog-aws-0.7.4
fog-azure-0.0.2
fog-core-1.35.0
fog-google-0.1.0
fog-json-1.0.2
fog-vsphere-0.6.3
fog-xenserver-0.2.3
fog-xml-0.1.2

Also: good to know it's still being supported, and that it's feature complete. Afaik the actual foreman integration of it doesn't have an active maintainer.

plribeiro3000 commented 8 years ago

Can you try the latest fog-core (1.42.0)?

NeilHanlon commented 8 years ago

I believe I just updated to the latest fog-core, and the issue persists.

Here's what I believe are relevant log lines.

2016-08-16 16:28:26 [app] [W] Error has occurred while listing VMs on C4 Xen (Xenserver)
 | Fog::Service::NotFound: xenserver has no compute service
 | /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/fog-core-1.42.0/lib/fog/core/services_mixin.rb:18:in `rescue in new'
 | /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/fog-core-1.42.0/lib/fog/core/services_mixin.rb:8:in `new'
 | /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/fog-core-1.42.0/lib/fog/compute.rb:54:in `new'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_xen-0.3.0/app/models/foreman_xen/xenserver.rb:367:in `client'
 | /usr/share/foreman/app/models/compute_resource.rb:136:in `vms'
 | /usr/share/foreman/app/controllers/compute_resources_vms_controller.rb:4:in `index'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/abstract_controller/base.rb:189:in `process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal/rendering.rb:10:in `process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
plribeiro3000 commented 8 years ago

I checked the connection initialization here and it seems to be doing it right. The fact that foreman_xen has fog-xenserver as a dependency here it should have been loaded correctly by bundler.

Since fog-xenserver work as standalone and as a dependency of fog i'm out of ideas why it does not work inside foreman. Is there any other piece of code you can share that might be related? Is it breaking only on this feature or anything else works?

NeilHanlon commented 8 years ago

I'm gonna keep trying to dig into this myself and see if I can get it to work. Gonna spin up an instance on my local machine to see if I can reproduce the issue.

It is, for the record, all features that cause this error to be shown. :(

NeilHanlon commented 8 years ago

So I've just installed and setup a new foreman server and installed this plugin... but I still get "xenserver has no compute service". The only thing I changed is editing the connection.rb file in lib/fog/xen_server to change the XMLRPC call to use SSL over port 443--since we're sending passwords here and it's probably not safe to just send them over HTTP... plus I've only opened :443 through the firewall.

NeilHanlon commented 7 years ago

Any thoughts on where I could begin to look at this? I see that it's not just the xenserver fog plugin.

plribeiro3000 commented 7 years ago

@NeilHanlon My guess it is related to fog-core and service loading. Did you try another version of the lib?

NeilHanlon commented 7 years ago

@plribeiro3000 I've upgraded to the most recent versions, but that doesn't seem to change anything, unfortunately. Should I try downgrading versions? Any specific one you think I should target?

plribeiro3000 commented 7 years ago

None i can think of from the top of my head. =s

NeilHanlon commented 7 years ago

I've figured this out. Long story short, I tried to modify the code to connect over SSL, but didn't understand how function arguments work in ruby.. so I tried just adding a use_ssl=true to the XMLRPC call for .new(), but this was setting port=true. Down the line, it tried to run @port.to_i, which created a NoMethodError. This was finally caught by the foreman_xen gem as a NameError, and rethrown.

I'll probably be putting a PR against this to add SSL support.

plribeiro3000 commented 7 years ago

So this is not a fog-xenserver bug, right?

Can i close this ticket?

NeilHanlon commented 7 years ago

It is not a bug directly. It was caused by the need for a feature.

In short, yes. I will close this.

bdonnahue commented 5 years ago

Hey @NeilHanlon , This is still not sorted out.

I am using XenServer 7.2 with Foreman 1.19.

Was a PR ever created to fix this? Is the short term fix to turn off ssl?

plribeiro3000 commented 5 years ago

@NeilHanlon issue was related to something else completely if i'm not mistaken.

And no, no one has worked on this yet. You are welcome to send a PR if you find some spare time!