On 09/22/2011 02:41 AM, Jan Provaznik wrote:
On 09/22/2011 11:33 AM, Michal Fojtik wrote:
>
> On Sep 22, 2011, at 9:33 AM, Jan Provaznik wrote:
>
>> On 09/22/2011 02:38 AM, Richard Su wrote:
>>> Is task.instance.create_auth_key expected to work for all providers.
>>> RHEV deltacloud-core doesn't know how to respond to the request and
>>> returns this:
>>>
>>> /usr/bin/deltacloudd[17507]: 10.3.113.54 - - [21/Sep/2011 19:32:27]
>>> "GET
>>> /api/keys HTTP/1.1" 403 13014 0.0678
>>>
>>> I had to comment out a few lines below to get things working.
>>>
>>
>>
>> yes - create_auth_key is Instance model method, and inside this
>> method is done checking for authentication_key feature:
>> app/models/instance.rb:245
>> return nil unless client&& client.feature?(:instances,
>> :authentication_key)
>>
>> So if instance key is not supported, it doesn't try to create a key
>> -> maybe a bug in API? CCing Michal.
>
> The key->create operation is supported only for EC2 backend. Other
> clouds doesn't have it.
> You should first check if collection 'keys' is present and then try
> to create a new key.
> I think without key collection is the CREATE call on it ignored (404
> or 405 is returned).
>
> -- Michal
>
client.feature?(:instances, :authentication_key) is called _before_
any create_key call.
Jan
This problem is the result of moving to single deltacloud-core.
client.feature? returns true because the default driver, mock, has the
authentication_key feature.
Look at the connect method in provider_account.rb and initialize in
/usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.4.0/lib/deltacloud.rb.
When the client is created, @features in deltacloud.rb is filled with
features for the mock driver. The subsequent call to
client.with_config(opts) in provider_account.rb to switch the driver to
rhevm doesn't reset the features to those only supported by the rhevm
driver.
In deltacloud.rb, with_config calls use_driver which calls
discover_entry_points. This discover_entry_points call doesn't reset
@features because @entry_points would have been filled in by a prior
execution by initialize. To fix this, I think we need to add this line
before discover_entry_points is called in use_driver in deltacloud.rb
@features, @entry_points = {}, {}
In the create_dcloud_instance method in taskomatic.rb we also need to change
:keyname => (instance.instance_key.name))
to
:keyname => (instance.instance_key.name
rescue nil))
because the instance_key would not be available for rhevm and vsphere
What do you guys think?
---
Some background information
1. Here are the features supported by each driver
mock
<feature name="hardware_profiles">
<feature name="user_name">
<feature name="user_data">
<feature name="authentication_key">
ec2
<feature name="user_data">
<feature name="authentication_key">
<feature name="firewalls">
<feature name="instance_count">
<feature name="attach_snapshot">
<feature name="bucket_location">
rhevm
<feature name="user_name">
<feature name="hardware_profiles">
vsphere
<feature name="user_iso">
<feature name="user_data">
<feature name="user_name">
2. backtrace
Method not allowed for this resource
/usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.4.0/lib/deltacloud.rb:402:in
`handle_backend_error'
/usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.4.0/lib/deltacloud.rb:310:in
`method_missing'
/usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.4.0/lib/deltacloud.rb:362:in
`request'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:218:in
`call'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:218:in
`process_result'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:169:in
`transmit'
/usr/lib/ruby/1.8/net/http.rb:543:in `start'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:166:in
`transmit'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:60:in
`execute'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:31:in
`execute'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/resource.rb:63:in
`post'
/usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.4.0/lib/deltacloud.rb:359:in
`send'
/usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.4.0/lib/deltacloud.rb:359:in
`request'
/usr/lib/ruby/gems/1.8/gems/deltacloud-client-0.4.0/lib/deltacloud.rb:306:in
`method_missing'
/usr/share/aeolus-conductor/app/models/instance.rb:249:in `create_auth_key'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.9/lib/active_record/associations/association_proxy.rb:222:in
`send'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.9/lib/active_record/associations/association_proxy.rb:222:in
`method_missing'
/usr/share/aeolus-conductor/app/util/taskomatic.rb:30:in `create_instance'
/usr/share/aeolus-conductor/app/models/deployment.rb:175:in `launch'
/usr/share/aeolus-conductor/app/models/deployment.rb:152:in `each'
/usr/share/aeolus-conductor/app/models/deployment.rb:152:in `launch'
/usr/share/aeolus-conductor/app/controllers/deployments_controller.rb:76:in
`create'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal/mime_responds.rb:264:in
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal/mime_responds.rb:264:in
`retrieve_response_from_mimes'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal/mime_responds.rb:191:in
`respond_to'
/usr/share/aeolus-conductor/app/controllers/deployments_controller.rb:74:in
`create'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal/implicit_render.rb:4:in
`send_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal/implicit_render.rb:4:in
`send_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/abstract_controller/base.rb:150:in
`process_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal/rendering.rb:11:in
`process_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/abstract_controller/callbacks.rb:18:in
`process_action'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:441:in
`_run__1359547276__process_action__1623385099__callbacks'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:410:in
`send'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:410:in
`_run_process_action_callbacks'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:94:in
`send'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:94:in
`run_callbacks'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/abstract_controller/callbacks.rb:17:in
`process_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal/instrumentation.rb:30:in
`process_action'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/notifications.rb:52:in
`instrument'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/notifications/instrumenter.rb:21:in
`instrument'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/notifications.rb:52:in
`instrument'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal/instrumentation.rb:29:in
`process_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal/rescue.rb:17:in
`process_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/abstract_controller/base.rb:119:in
`process'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/abstract_controller/rendering.rb:41:in
`process'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal.rb:138:in
`dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal/rack_delegation.rb:14:in
`dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_controller/metal.rb:178:in
`action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/routing/route_set.rb:62:in
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/routing/route_set.rb:62:in
`dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/routing/route_set.rb:27:in
`call'
/usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/route_set.rb:150:in
`call'
/usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/code_generation.rb:93:in
`recognize'
/usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/code_generation.rb:75:in
`optimized_each'
/usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/code_generation.rb:92:in
`recognize'
/usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/route_set.rb:141:in
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/routing/route_set.rb:493:in
`call'
/usr/lib/ruby/gems/1.8/gems/warden-1.0.3/lib/warden/manager.rb:35:in `call'
/usr/lib/ruby/gems/1.8/gems/warden-1.0.3/lib/warden/manager.rb:34:in `catch'
/usr/lib/ruby/gems/1.8/gems/warden-1.0.3/lib/warden/manager.rb:34:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/methodoverride.rb:24:in
`call'
/usr/lib/ruby/gems/1.8/gems/rack-restful_submit-1.1.2/lib/rack/rack-restful_submit.rb:25:in
`call'
/usr/lib/ruby/gems/1.8/gems/sass-3.1.4/lib/sass/../sass/plugin/rack.rb:54:in
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/best_standards_support.rb:17:in
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/head.rb:14:in
`call'
/usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/methodoverride.rb:24:in
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/params_parser.rb:21:in
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/flash.rb:182:in
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/session/abstract_store.rb:149:in
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/cookies.rb:302:in
`call'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.9/lib/active_record/query_cache.rb:32:in
`call'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in
`cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.9/lib/active_record/query_cache.rb:12:in
`cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.9/lib/active_record/query_cache.rb:31:in
`call'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/callbacks.rb:46:in
`call'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:416:in
`_run_call_callbacks'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/callbacks.rb:44:in
`call'
/usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/sendfile.rb:102:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/remote_ip.rb:48:in
`call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/show_exceptions.rb:47:in
`call'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/rack/logger.rb:13:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/runtime.rb:17:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/lock.rb:34:in `call'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/application.rb:168:in
`call'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/application.rb:77:in `send'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/application.rb:77:in
`method_missing'
/usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/urlmap.rb:52:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/urlmap.rb:46:in `each'
/usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/urlmap.rb:46:in `call'
/usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:84:in
`pre_process'
/usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:82:in `catch'
/usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:82:in
`pre_process'
/usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:57:in
`process'
/usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:42:in
`receive_data'
/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in
`run_machine'
/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in
`run'
/usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/backends/base.rb:61:in
`start'
/usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/server.rb:159:in `start'
/usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in `send'
/usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in
`run_command'
/usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:151:in `run!'
/usr/lib/ruby/gems/1.8/gems/thin-1.2.11/bin/thin:6
/usr/bin/thin:19:in `load'
/usr/bin/thin:19