以下是我传递给connection.spot_requests.create()
的参数。
{:price=>"1", :image_id=>"ami-63be790a", :groups=>["mcsl-web", "default"], :flavor_id=>"m1.xlarge", :key_name=>"mcsl", :availability_zone=>"us-east-1a", :block_device_mapping=>[{"DeviceName"=>"/dev/sda1", "Ebs.VolumeSize"=>"8", "Ebs.DeleteOnTermination"=>"true"}]}
这是错误:
/Users/wedtm/.rvm/gems/ruby-1.9.2-p180@global/gems/fog-0.11.0/lib/fog/compute/parsers/aws/spot_instance_requests.rb:37:in `[]=': can't convert String into Integer (Excon::Errors::SocketError)
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180@global/gems/fog-0.11.0/lib/fog/compute/parsers/aws/spot_instance_requests.rb:37:in `end_element'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180@global/gems/nokogiri-1.5.0/lib/nokogiri/xml/sax/document.rb:127:in `end_element_namespace'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180@global/gems/nokogiri-1.5.0/lib/nokogiri/xml/sax/push_parser.rb:47:in `native_write'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180@global/gems/nokogiri-1.5.0/lib/nokogiri/xml/sax/push_parser.rb:47:in `write'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180@global/gems/fog-0.11.0/lib/fog/core/connection.rb:16:in `block in request'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/excon-0.6.6/lib/excon/response.rb:46:in `parse'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/excon-0.6.6/lib/excon/connection.rb:174:in `request'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180@global/gems/fog-0.11.0/lib/fog/core/connection.rb:20:in `request'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180@global/gems/fog-0.11.0/lib/fog/compute/aws.rb:280:in `request'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180@global/gems/fog-0.11.0/lib/fog/compute/requests/aws/request_spot_instances.rb:77:in `request_spot_instances'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180@global/gems/fog-0.11.0/lib/fog/compute/models/aws/spot_request.rb:76:in `save'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180@global/gems/fog-0.11.0/lib/fog/core/collection.rb:50:in `create'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/knife-ec2-0.5.6/lib/chef/knife/ec2_server_create.rb:259:in `run'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/chef-0.10.4/lib/chef/knife.rb:391:in `run_with_pretty_exceptions'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/chef-0.10.4/lib/chef/knife.rb:166:in `run'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/chef-0.10.4/lib/chef/application/knife.rb:128:in `run'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/chef-0.10.4/bin/knife:25:in `<top (required)>'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bin/knife:19:in `load'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bin/knife:19:in `<main>'