Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attaching floating IP addresses #77

Closed
zambon opened this issue Dec 3, 2014 · 11 comments
Closed

Attaching floating IP addresses #77

zambon opened this issue Dec 3, 2014 · 11 comments
Assignees
Milestone

Comments

@zambon
Copy link

zambon commented Dec 3, 2014

driver.rb:462 defines a method to attach a floating IP to a server that takes 3 arguments.

driver.rb:455 invokes it with 2 arguments only.

An exception is raised when I try to boot a server with an attached floating ip by specifying a pool.

bsteinfeld added a commit to bsteinfeld/chef-provisioning-fog that referenced this issue Dec 3, 2014
Remove allocation_id from code and use Fog::Compute::OpenStack::Server#associate_address method now to associate floating ip with a a server.
@Sliim
Copy link

Sliim commented Feb 20, 2015

👍

@Sliim
Copy link

Sliim commented Feb 20, 2015

I have the same issue with OpenStack provider.

Here is the content of my chef-stacktrace.out:

Generated at 2015-02-20 18:23:49 +0100
ArgumentError: machine[beef] (pentestlab-provisioning::beef line 24) had an error: ArgumentError: wrong number of arguments (2 for 3)
/home/sliim/codz/pentest/pentestlab/pentestlab-provisioning/vendor/chef-provisioning-fog/lib/chef/provisioning/fog_driver/driver.rb:462:in `attach_ip'
/home/sliim/codz/pentest/pentestlab/pentestlab-provisioning/vendor/chef-provisioning-fog/lib/chef/provisioning/fog_driver/driver.rb:455:in `block in attach_ip_from_pool'
/home/sliim/codz/pentest/pentestlab/pentestlab-provisioning/vendor/chef-provisioning-fog/lib/chef/provisioning/fog_driver/driver.rb:447:in `synchronize'
/home/sliim/codz/pentest/pentestlab/pentestlab-provisioning/vendor/chef-provisioning-fog/lib/chef/provisioning/fog_driver/driver.rb:447:in `attach_ip_from_pool'
/home/sliim/codz/pentest/pentestlab/pentestlab-provisioning/vendor/chef-provisioning-fog/lib/chef/provisioning/fog_driver/driver.rb:432:in `block in attach_floating_ips'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/mixin/why_run.rb:52:in `call'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/mixin/why_run.rb:52:in `add_action'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/provider.rb:180:in `converge_by'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-provisioning-0.18/lib/chef/provisioning/chef_provider_action_handler.rb:54:in `perform_action'
/home/sliim/codz/pentest/pentestlab/pentestlab-provisioning/vendor/chef-provisioning-fog/lib/chef/provisioning/fog_driver/driver.rb:431:in `attach_floating_ips'
/home/sliim/codz/pentest/pentestlab/pentestlab-provisioning/vendor/chef-provisioning-fog/lib/chef/provisioning/fog_driver/driver.rb:203:in `ready_machine'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-provisioning-0.18/lib/chef/provider/machine.rb:34:in `block in <class:Machine>'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/provider/lwrp_base.rb:60:in `instance_eval'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/provider/lwrp_base.rb:60:in `recipe_eval_with_update_check'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/provider/lwrp_base.rb:45:in `block in action'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/provider.rb:145:in `run_action'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource.rb:582:in `run_action'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/runner.rb:49:in `run_action'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/runner.rb:81:in `each'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/runner.rb:81:in `block in converge'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/resource_list.rb:83:in `block in execute_each_resource'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/resource_list.rb:81:in `execute_each_resource'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/runner.rb:80:in `converge'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/client.rb:315:in `converge'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/client.rb:400:in `block in run'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/client.rb:399:in `catch'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/client.rb:399:in `run'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:261:in `block in fork_chef_client'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:249:in `fork'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:249:in `fork_chef_client'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:215:in `block in run_chef_client'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/local_mode.rb:38:in `with_server_connectivity'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:201:in `run_chef_client'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application/client.rb:355:in `block in interval_run_chef_client'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application/client.rb:345:in `loop'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application/client.rb:345:in `interval_run_chef_client'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application/client.rb:335:in `run_application'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:58:in `run'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-12.0.3/bin/chef-client:26:in `<top (required)>'
/home/sliim/.rbenv/versions/2.0.0-p451/bin/chef-client:23:in `load'
/home/sliim/.rbenv/versions/2.0.0-p451/bin/chef-client:23:in `<main>'

Proposed PR fix this issue..

@jkeiser
Copy link
Contributor

jkeiser commented Feb 20, 2015

@Sliim I think #47 is the fix for OpenStack ... would you mind giving that a try? If it does work, we'll merge it (we're working on reproing right now).

@jkeiser jkeiser added this to the 1.0 milestone Feb 20, 2015
@Sliim
Copy link

Sliim commented Feb 21, 2015

Hi @jkeiser,
Yeah, I merged #47 changes into the actual HEAD (930eb79) and it fix this issue for the OpenStack provider :).

But @zambon mentioned the driver.rb file, where I also think there is an error for the attach_ip method, so it's good for OpenStack provider, but the bug is still present..

Thx

@jkeiser
Copy link
Contributor

jkeiser commented Feb 21, 2015

@Sliim damn straight. I see what you're pointing at. I kept looking at the other attach_ip for some reason.

@jkeiser
Copy link
Contributor

jkeiser commented Feb 21, 2015

@zambon, the thing I'm not understanding here is whether we do, or do not, need the :allocation_id. The patch feels like a loss of information (like, we should have flipped the patch and turned on allocation_id for the other caller). But I'll bone up on floating IPs on Monday and figure it out if you don't end up getting a chance to reply :) I appreciate the patch!

@tyler-ball
Copy link
Contributor

@jkeiser I think :allocation_id is only needed for AWS. Because we want to stop using fog with aws and start having people use chef-provisioning-aws, I removed :allocation_id from my local working copy.

@zambon
Copy link
Author

zambon commented Feb 23, 2015

Hey @jkeiser, if memory serves, allocation_id is optional for OpenStack. @bsteinfeld's patch assumes the given floating IP address is available and associates it.

A reason for having the other caller use allocation_id would be to create a new floating IP address and then associating it. Therefore, don't think it makes sense to have both the allocation_id and ip as arguments.

@tyler-ball
Copy link
Contributor

Can anyone who has this issue speak to their Openstack setup? Mainly, do you know if it is Nova or Neutron networking, and what version of Openstack is it? I want to make sure I am testing against the correct configuration.

@zambon
Copy link
Author

zambon commented Feb 27, 2015

I used OpenStack Juno (2014.2.1) with Nova networking.

@jkeiser
Copy link
Contributor

jkeiser commented Feb 28, 2015

@tyler-ball I'm moving this out of In Progress into Backlog so we get a clearer idea of what's actually In Progress. I'm assuming this is fixed by #86; if it isn't, please move it back :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants