-
Notifications
You must be signed in to change notification settings - Fork 114
Unable to create instance with knife. #94
Comments
This is throwing an error here: https://github.com/fog/fog/blob/master/lib/fog/rackspace/core.rb#L145 It looks like fog.io updated this recently too. I'm betting the issue lies with fog not this gem. But i'd like someone else to reconfirm this. |
I've begun testing it by downgrading fog then removing the newer version (so it would stop using it) Last error I saw: This would be easier if I had a version number to test against. Any idea when the change came out? |
Utilizing fog I am able to create a machine: server = Compute.new({:provider => 'rackspace', :rackspace_region => :dfw}).servers.create({:name => "Test Fog Instance", :flavor_id => 2, :image_id => "8aac6fb5-4bd3-4256-bf6e-ff8500bf60cd" }) |
It looks like it's an issue w/ passing the flavor ID as an integer vs a string, which makes it interesting that you can do it directly in fog w/ However, before you go any further you might want to take a look at the list of supported server flavors. In case you're not aware, flavor ID "2" (for "512 MB Standard Instance") is "being phased out and should not be used for new servers". I recommend updating to the smallest general flavor: "general1-1", a "1 GB General Purpose v1". @jjasghar actually I see this is coming from a default value in this gem, so it probably makes sense to change the default value at https://github.com/chef/knife-rackspace/blob/c05cf2161bac8a010238e7d4fe7b492d0c760989/lib/chef/knife/rackspace_server_create.rb#L49 from |
I can confirm: Waiting server Waiting for sshddone This appears to be purely a problem with the default behavior. I also successfully passed a -f "2". This purely seems to be an issue when no flavor id is passed. |
Starting from a blank CentOS 7 (PVHVM 512MB Standard Instance)
ssh -l root serverip
yum groupinstall 'Development Tools'
yum install ruby ruby-devel libxml2 libxml2-devel
gem install chef
gem install knife-rackspace
adduser knifeuser
su - knifeuser
mkdir .chef
chmod 700 .chef
cat << EOF > ~/.chef/knife.rb
knife[:rackspace_api_username] = "apiuser"
knife[:rackspace_api_key] = "apikey"
knife[:rackspace_region] = "DFW"
EOF
knife rackspace server create -VV -I 8aac6fb5-4bd3-4256-bf6e-ff8500bf60cd
To which I get the output of:
INFO: Using configuration from /home/knifeuser/.chef/knife.rb
DEBUG: version (config)
DEBUG: version v2 (cli)
DEBUG: rackspace_api_key apikey
DEBUG: rackspace_username
DEBUG: rackspace_api_username apiuser
DEBUG: rackspace_auth_url
DEBUG: rackspace_auth_url
DEBUG: rackspace_auth_url https://identity.api.rackspacecloud.com/v2.0 (using)
DEBUG: rackspace_region DFW
DEBUG: rackspace_region DFW
DEBUG: rackspace v2
DEBUG: https_proxy (config)
DEBUG: http_proxy (config)
DEBUG: using proxy (config)
DEBUG: ssl_verify_peer (config)
Instance ID: a75bc74f-3930-4ac8-9d6f-ff48a503a5ec
Name: rs-00203265389326035
/usr/local/share/gems/gems/fog-1.27.0/lib/fog/rackspace/core.rb:145:in
escape': undefined method
gsub' for 2:Fixnum (NoMethodError)from /usr/local/share/gems/gems/fog-1.27.0/lib/fog/rackspace/requests/compute_v2/get_flavor.rb:26:in
get_flavor' from /usr/local/share/gems/gems/fog-1.27.0/lib/fog/rackspace/models/compute_v2/flavors.rb:31:in
get'from /usr/local/share/gems/gems/fog-1.27.0/lib/fog/rackspace/models/compute_v2/server.rb:327:in
flavor' from /usr/local/share/gems/gems/knife-rackspace-0.10.0/lib/chef/knife/rackspace_server_create.rb:379:in
run'from /usr/local/share/gems/gems/chef-12.0.3/lib/chef/knife.rb:417:in
block in run_with_pretty_exceptions' from /usr/local/share/gems/gems/chef-12.0.3/lib/chef/local_mode.rb:38:in
with_server_connectivity'from /usr/local/share/gems/gems/chef-12.0.3/lib/chef/knife.rb:416:in
run_with_pretty_exceptions' from /usr/local/share/gems/gems/chef-12.0.3/lib/chef/knife.rb:213:in
run'from /usr/local/share/gems/gems/chef-12.0.3/lib/chef/application/knife.rb:139:in
run' from /usr/local/share/gems/gems/chef-12.0.3/bin/knife:25:in
<top (required)>'▽
'from /usr/local/bin/knife:23:in
load' from /usr/local/bin/knife:23:in
The text was updated successfully, but these errors were encountered: