GithubHelp home page GithubHelp logo

Comments (5)

jkeiser avatar jkeiser commented on May 29, 2024

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.

mikesplain avatar mikesplain commented on May 29, 2024

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.

jkeiser avatar jkeiser commented on May 29, 2024

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.

mikesplain avatar mikesplain commented on May 29, 2024

That did it! Thanks so much! I submitted a PR:

chef-boneyard/chef-provisioning-fog#9

from chef-provisioning.

mikesplain avatar mikesplain commented on May 29, 2024

Closing this since it was fixed in chef-metal-fog.

from chef-provisioning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.