Comments (5)
First, I would get rid of "name 'mario'" from the machine, it's not needed. What's confusing to me is that :name SHOULD be getting set here:
https://github.com/opscode/chef-metal-fog/blob/master/lib/chef_metal_fog/fog_provisioner.rb#L208
Would you mind putting some prints in your fog_provisioner.rb and see if you can find out what bootstrap_options really looks like? Like, puts bootstrap_options.inspect just before the server.create() call in that method? Thanks, and sorry for the late reply--I've been dug deep in interface code since Friday.
from chef-provisioning.
Yeah sorry that was left from a "grasping at straws test" as I was getting desperate. I didn't work with that there either.
Anyway, thanks for the great tips. I discovered quite a bit, put in an inspect where you suggested and got:
{:flavor_ref=>7, :image_ref=>"df012c92-5eef-4080-aac3-fd83ab3f6ba8", :floating_ip=>nil, :security_groups=>"default", :key_name=>"me", :private_key_path=>"/Users/msplain/openstack_test/me", :public_key_path=>"/Users/msplain/openstack_test/me.pub", :tags=>{"Name"=>"mario", "BootstrapChefServer"=>"http://127.0.0.1:8889", "BootstrapHost"=>"LM-BOS-00872453", "BootstrapUser"=>"msplain", "BootstrapNodeName"=>"mario"}}
Looks like fog is looking for :name
rather than :tags=>{"Name"
Inserting a hard coded bootstrap_options[:name] = 'tester'
worked!
[2014-05-07T22:50:59-04:00] INFO: Processing chef_node[mario] action create (basic_client::block line 110)
[2014-05-07T22:50:59-04:00] INFO: HTTP Request Returned 404 Not Found : Object not found: http://127.0.0.1:8889/nodes/mario
- [mario] create node mario at http://127.0.0.1:8889
- [mario] add normal.tags = ["mydb_master"]
- [mario] add normal.provisioner_options = {:flavor_ref=>7}
- [mario] add normal.provisioner_output = {"provisioner_url"=>"fog:OpenStack:https://*************************************:5443/v2.0/tokens", "provisioner_version"=>"0.4", "creator"=>"msplain", "server_id"=>"cbc8462e-f43b-46aa-aa69-995ec864702e"}
- [mario] update run_list from [] to ["recipe[apt]"]
- [mario] create machine mario on fog:OpenStack:https://************************:5443/v2.0/tokens
- [mario] flavor_ref: 7
- [mario] image_ref: "df012c92-5eef-4080-aac3-fd83ab3f6ba8"
- [mario] floating_ip: nil
- [mario] security_groups: "default"
- [mario] key_name: "me"
- [mario] private_key_path: "/Users/msplain/openstack_test/me"
- [mario] public_key_path: "/Users/msplain/openstack_test/me.pub"
- [mario] tags: {"Name"=>"mario", "BootstrapChefServer"=>"http://127.0.0.1:8889", "BootstrapHost"=>"LM-BOS-00872453", "BootstrapUser"=>"msplain", "BootstrapNodeName"=>"mario"}
- [mario] machine mario created as cbc8462e-f43b-46aa-aa69-995ec864702e on fog:OpenStack:https://********************************:5443/v2.0/tokens[2014-05-07T22:53:11-04:00] WARN: Server has no public ip address. Using private ip '***************'.
So assuming name is inserted into bootstrap_options here: https://github.com/opscode/chef-metal-fog/blob/master/lib/chef_metal_fog/fog_provisioner.rb#L208, I added an inspect before and after just to make sure, here's the output:
*********** Before bootstrap_options.merge(:name => action_handler.new_resource.name)
{:flavor_ref=>7, :image_ref=>"df012c92-5eef-4080-aac3-fd83ab3f6ba8", :floating_ip=>nil, :security_groups=>"default", :key_name=>"me", :private_key_path=>"/Users/msplain/openstack_test/me", :public_key_path=>"/Users/msplain/openstack_test/me.pub", :tags=>{"Name"=>"mario", "BootstrapChefServer"=>"http://127.0.0.1:8889", "BootstrapHost"=>"LM-BOS-00872453", "BootstrapUser"=>"msplain", "BootstrapNodeName"=>"mario"}}
************ After merge
{:flavor_ref=>7, :image_ref=>"df012c92-5eef-4080-aac3-fd83ab3f6ba8", :floating_ip=>nil, :security_groups=>"default", :key_name=>"me", :private_key_path=>"/Users/msplain/openstack_test/me", :public_key_path=>"/Users/msplain/openstack_test/me.pub", :tags=>{"Name"=>"mario", "BootstrapChefServer"=>"http://127.0.0.1:8889", "BootstrapHost"=>"LM-BOS-00872453", "BootstrapUser"=>"msplain", "BootstrapNodeName"=>"mario"}}
from chef-provisioning.
OH. I think I know the issue. Try bootstrap_options = bootstrap_options.merge(...). The issue is that merge doesn't modify the actual hash.
If that fixes it, I'll make the change and check it in.
Thanks much :)
from chef-provisioning.
That did it! Thanks so much! I submitted a PR:
chef-boneyard/chef-provisioning-fog#9
from chef-provisioning.
Closing this since it was fixed in chef-metal-fog.
from chef-provisioning.
Related Issues (20)
- LoadError: cannot load such file -- chef/provisioning
- machine_file fails with NoMethodError: undefined method `[]' for nil:NilClass
- How to run multiple chef-client processes in parallel HOT 1
- setting up chef_version doesn't seems to be working HOT 2
- 401 error on node \ client precreation HOT 1
- driver template HOT 1
- with_machine_options() being ignored 100% with machine_batch
- with_machine_options() being ignored 100% with machine_batch HOT 1
- Where does specs_and_options get defined at?
- "Cannot forward a socketless Chef Zero server" error when following Vagrant try it out HOT 1
- machine_batch resource fails with chef 13 HOT 2
- winrm available? function exception when using SSL
- [Q] Can this autoprovision BMC ports and PXE NIC on the server?
- Chef-client -z -j xyz.json /var/chef/cache/cookbooks/xyz/recipes/default.rb
- Feature request: KVM drivers
- undefined method `[]' for nil:NilClass () HOT 2
- Error: Unsupported reporting protocol version - While querying chef reporting api HOT 1
- Allow use of net-ssh 5.2.0 gem HOT 1
- chef-provisisioning does not work with new license acceptance framework HOT 1
- Dependabot can't parse your Gemfile
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chef-provisioning.