chef-boneyard / chef-provisioning-fog

Fog driver for Chef Provisioning
Apache License 2.0
54 stars 74 forks source link

[softlayer] NoMethodError: undefined method `status' #170

Closed username-is-already-taken2 closed 8 years ago

username-is-already-taken2 commented 8 years ago

Hi there

I wanted to contribute a working example for softlayer so I went to create one this evening.

I've got it provisioning the machines but its failing with this error at the very end.

`NoMethodError

undefined method status for #<Fog::Compute::Softlayer::Server:0x007fd781e9bac8>`

It successfully initiates the new instance on softlayer

Here is my stack trace

Generated at 2016-02-22 22:11:09 +0000
NoMethodError: machine[mario] (@recipe_files::/Users/gary/chef-repo/cookbooks/chef-provision-softlayer/recipes/softlayer.rb line 14) had an error: NoMethodError: undefined method status for #<Fog::Compute::Softlayer::Server:0x007fd781e9bac8>
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-fog-0.16.0/lib/chef/provisioning/fog_driver/driver.rb:374:in start_server
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-fog-0.16.0/lib/chef/provisioning/fog_driver/driver.rb:209:in ready_machine
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-1.6.0/lib/chef/provider/machine.rb:39:in block in <class:Machine>
(eval):2:in block in action_ready
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/provider.rb:360:in instance_eval
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/provider.rb:360:in compile_and_converge_action
(eval):2:in action_ready
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-1.6.0/lib/chef/provider/machine.rb:56:in block in <class:Machine>
(eval):2:in block in action_converge
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/provider.rb:360:in instance_eval
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/provider.rb:360:in compile_and_converge_action
(eval):2:in action_converge
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/provider.rb:144:in run_action
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource.rb:596:in run_action
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/runner.rb:73:in run_action
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/runner.rb:105:in block (2 levels) in converge
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/runner.rb:105:in each
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/runner.rb:105:in block in converge
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource_collection/resource_list.rb:83:in block in execute_each_resource
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource_collection/stepable_iterator.rb:116:in call
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource_collection/stepable_iterator.rb:116:in call_iterator_block
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource_collection/stepable_iterator.rb:85:in step
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource_collection/stepable_iterator.rb:104:in iterate
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource_collection/stepable_iterator.rb:55:in each_with_index
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource_collection/resource_list.rb:81:in execute_each_resource
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/runner.rb:104:in converge
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/client.rb:668:in block in converge
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/client.rb:663:in catch
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/client.rb:663:in converge
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/client.rb:702:in converge_and_save
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/client.rb:280:in run
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:270:in block in fork_chef_client
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:258:in fork
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:258:in fork_chef_client
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:223:in block in run_chef_client
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/local_mode.rb:44:in with_server_connectivity
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:211:in run_chef_client
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application/client.rb:433:in block in interval_run_chef_client
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application/client.rb:423:in loop
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application/client.rb:423:in interval_run_chef_client
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application/client.rb:412:in run_application
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:58:in run
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/bin/chef-client:26:in <top (required)>
/usr/local/bin/chef-client:50:in load
/usr/local/bin/chef-client:50:in <main>

This is my provisioning script

require 'chef/provisioning’

with_machine_options({
                       :bootstrap_options => {
                         :domain => ‘supernintendo.com’,
                         :flavor_id => 'm1.tiny’,
                         :os_code => ‘UBUNTU_LATEST’,
                         :datacenter => ‘ams03’,
                         :hourly_billing_flag => ‘true’,
                         :ephemeral_storage => ‘true’
                         },
                     })

machine ‘mario’

I would appreciate your help

Thanks

Gary

jjasghar commented 8 years ago

ah yes. Are you checking out master? If not, can you roll back to https://github.com/chef/chef-provisioning-fog/releases/tag/v0.15.3 the newest one on rubygems is broken. I'm waiting on fog to release a new version to get the fix in.

jjasghar commented 8 years ago

@username-is-already-taken2 any chance you've taken a look here? I'm going to close this per the statement above, if not, don't hesitate to reopen this issue.

chilicheech commented 8 years ago

Ah. Nice find. I just ran into this problem using the latest chefdk 0.11.2:

NoMethodError: undefined method `status' for #<Fog::Compute::OpenStack::Server:0x007fb4f03e14d8>

/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-fog-0.16.0/lib/chef/provisioning/fog_driver/driver.rb:374:in `start_server'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-fog-0.16.0/lib/chef/provisioning/fog_driver/driver.rb:209:in `ready_machine'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-1.6.0/lib/chef/provisioning/driver.rb:250:in `block in ready_machines'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:267:in `call'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:267:in `process_input'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:257:in `process_one'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/chef_fs/parallelizer.rb:93:in `call'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/chef_fs/parallelizer.rb:93:in `worker_loop'
jjasghar commented 8 years ago

Yep, @chilicheech this won't be fixed till the next release of Fog. https://github.com/fog/fog/pull/3849

chilicheech commented 8 years ago

Nice, thanks for the update.

username-is-already-taken2 commented 8 years ago

Thanks very much, I'll submit a pull request with a softlayer example when it's out

Sent from Outlook Mobilehttps://aka.ms/qtex0l

On Thu, Mar 10, 2016 at 10:36 AM -0800, "JJ Asghar" notifications@github.com<mailto:notifications@github.com> wrote:

Yep, @chilicheechhttps://github.com/chilicheech this won't be fixed till the next release of Fog. fog/fog#3849https://github.com/fog/fog/pull/3849

— Reply to this email directly or view it on GitHubhttps://github.com/chef/chef-provisioning-fog/issues/170#issuecomment-194993834.

This e-mail and/or attachment(s) ("email") is/are confidential and may be legally privileged. Any information, statements or opinions contained in this email are given by the author and are not given on behalf of niu Solutions unless subsequently confirmed by an individual other than the author who is duly authorised to represent niu Solutions. This email is intended solely for the addressee(s) only and access to this email by anyone else is unauthorised. If you have received this email and you are not the intended recipient or the employee or agent responsible for delivering this email to the intended recipient, please immediately inform the sender of this email and then delete this email from your system. If you are not a named addressee you must not use, disclose, disseminate, distribute, copy, print or rely on this email. Although niu Solutions routinely screens for viruses, addressees should scan this email for viruses. niu Solutions makes no representation or warranty as to the absence of viruses in this email and accepts no liability in respect of any damage sustained as a result of viruses. Please note that for the protection of its clients and business, niu Solutions may monitor emails sent to and from its server(s).

The private limited companies listed below are registered in England and Wales and are wholly owned subsidiaries of niu Solutions Holdings Limited a private limited company registered in England and Wales with company number 7828487 and registered office address of Head Office, New Fetter Place West, 55 Fetter Lane, London, EC4A 1AA:-

chilicheech commented 8 years ago

@jjasghar I'm still getting this issue with chefdk 0.12.0. There's a new fog gem '1.38.0'. I believe that PR was merged. My issue is with openstack, though, not softlayer.

jjasghar commented 8 years ago

yep, i'm attempting to release the gem today. But I've verifying both DO and OpenStack before i can release.

jjasghar commented 8 years ago

So interestingly enough on DigitalOcean i get this now:


    ================================================================================
    Error executing action `converge` on resource 'machine[bowser]'
    ================================================================================

    NoMethodError
    -------------
    undefined method `status' for #<Fog::Compute::DigitalOceanV2::Real:0x000001078c5db8>

    Resource Declaration:
    ---------------------
    # In /Users/jasghar/repo/chef-provisioning-fog/demo.rb

     16: machine 'bowser' do
     17:   tag 'loadbalancer'
     18: end

It seems the alias isn't working.

jjasghar commented 8 years ago

I'm moving this to https://github.com/chef/chef-provisioning-fog/issues/172 now. I'm holding off releasing until DigitalOcean is fixed.