Help with ec2 deployment using hammer

Hi everybody. I am using hammer-cli-foreman in attempt to provision a
system onto an ec2 VPC. I need a little help understanding why my launch is
failing. It appears that ec2 is defaulting to the ec2 classic, instead of
placing the instance into the VPC associated with the subnet_id. The exact
error message I am seeing is:

[ERROR 2015-09-17 16:01:03 Exception] Failed to create a compute
_aws_us-west-1 (us-west-1-EC2) instance ec2testbox.lab.flamed.us:
InvalidParameterCombination => VPC security groups may not be used for a
non-VPC launch

The command I am running is:

hammer -d --verbose host create --compute-resource-id=9
–compute-attributes="flavor_id=m3.medium, managed_ip=private,
image_id=ami-xxxxxxxx, security_group_ids=[sg-xxxxxxxx]"
–name="ec2testbox" --environment-id=1 --architecture-id=1 --domain-id=1
–operatingsystem-id=2 --partition-table-id=53 --puppet-proxy-id=1
–build=false --interface="provision=true, primary=true, type=interface,
subnet_id=subnet-xxxxxxxx"

I've verified that the templates are correct. I can get the system to
launch with default, which seems to be ec2 classic.

providing the output:

[ INFO 2015-09-17 16:05:26 HammerCLIForeman::Host::CreateCommand] Called
with options: {"option_managed"=>true, "option_build"=>false,
"option_enabled"=>true,
"option_compute_attributes"=>{"flavor_id"=>"m3.medium",
"managed_ip"=>"private", "image_id"=>"ami-xxxxxxxx",
"security_group_ids"=>["sg-xxxxxxxx"]}, "option_volume_list"=>[],
"option_interface_list"=>[{"provision"=>"true", "primary"=>"true",
"type"=>"interface", "SubnetId"=>"subnet-xxxxxxxx"}],
"option_environment_id"=>1, "option_architecture_id"=>1,
"option_domain_id"=>1, "option_operatingsystem_id"=>2,
"option_ptable_id"=>53, "option_compute_resource_id"=>9,
"option_name"=>"ec2testbox", "option_puppet_proxy_id"=>1}
[ INFO 2015-09-17 16:05:26 API] POST /api/hosts
[DEBUG 2015-09-17 16:05:26 API] Params: {
"host" => {
"name" => "ec2testbox",
"environment_id" => 1,
"architecture_id" => 1,
"domain_id" => 1,
"puppet_proxy_id" => 1,
"operatingsystem_id" => 2,
"ptable_id" => 53,
"compute_resource_id" => 9,
"build" => false,
"enabled" => true,
"managed" => true,
"compute_attributes" => {
"flavor_id" => "m3.medium",
"managed_ip" => "private",
"image_id" => "ami-xxxxxxxx",
"security_group_ids" => [
[0] "sg-xxxxxxxx"
],
"volumes_attributes" => {}
},
"host_parameters_attributes" => {},
"interfaces_attributes" => {
"0" => {
"provision" => "true",
"primary" => "true",
"type" => "interface",
"SubnetId" => "subnet-xxxxxxxx"
}
}
}
}

meanwhile in /var/log/foreman/production.log on the foreman server, I am
seeing this:

2015-09-17 19:05:26 [app] [I]
>
> Started POST "/api/hosts" for 10.12.253.15 at 2015-09-17 19:05:26 -0400
2015-09-17 19:05:26 [app] [I] Processing by Api::V2::HostsController#create
as JSON
2015-09-17 19:05:26 [app] [I] Parameters: {"host"=>{"name"=>"ec2testbox",
"environment_id"=>1, "architecture_id"=>1, "domain_id"=>1,
"puppet_proxy_id"=>1, "operatingsystem_id"=>2, "ptable_id"=>53,
"compute_resource_id"=>9, "build"=>false, "enabled"=>true, "managed"=>true,
"compute_attributes"=>{"flavor_id"=>"m3.medium", "managed_ip"=>"private",
"image_id"=>"ami-xxxxxxxx", "security_group_ids"=>["sg-xxxxxxxx"],
"volumes_attributes"=>{}}, "host_parameters_attributes"=>{},
"interfaces_attributes"=>{"0"=>{"provision"=>"true", "primary"=>"true",
"type"=>"interface", "SubnetId"=>"subnet-xxxxxxxx"}}}, "apiv"=>"v2"}
2015-09-17 19:05:26 [app] [I] Authorized user admin(Admin User)
2015-09-17 19:05:26 [sql] [I] Adding Compute instance for
ec2testbox.lab.flamed.us
2015-09-17 19:05:26 [sql] [I] Successfully decrypted field for
Foreman::Model::EC2 _aws_us-west-1
2015-09-17 19:05:27 [app] [W] Unhandled EC2 error
> Fog::Compute::AWS::Error: InvalidParameterCombination => VPC security
groups may not be used for a non-VPC launch
>
/opt/rh/ruby193/root/usr/share/gems/gems/excon-0.45.3/lib/excon/middlewares/expects.rb:10:in
response_call' > /opt/rh/ruby193/root/usr/share/gems/gems/excon-0.45.3/lib/excon/middlewares/response_parser.rb:8:inresponse_call'
>
/opt/rh/ruby193/root/usr/share/gems/gems/excon-0.45.3/lib/excon/connection.rb:372:in
response' > /opt/rh/ruby193/root/usr/share/gems/gems/excon-0.45.3/lib/excon/connection.rb:236:inrequest'
>
/opt/rh/ruby193/root/usr/share/gems/gems/fog-xml-0.1.2/lib/fog/xml/sax_parser_connection.rb:35:in
request' > /opt/rh/ruby193/root/usr/share/gems/gems/fog-xml-0.1.2/lib/fog/xml/connection.rb:7:inrequest'
>
/opt/rh/ruby193/root/usr/share/gems/gems/fog-aws-0.6.0/lib/fog/aws/compute.rb:527:in
_request' > /opt/rh/ruby193/root/usr/share/gems/gems/fog-aws-0.6.0/lib/fog/aws/compute.rb:522:inrequest'
>
/opt/rh/ruby193/root/usr/share/gems/gems/fog-aws-0.6.0/lib/fog/aws/requests/compute/run_instances.rb:146:in
run_instances' > /opt/rh/ruby193/root/usr/share/gems/gems/fog-aws-0.6.0/lib/fog/aws/models/compute/servers.rb:158:insave_many'
>
/opt/rh/ruby193/root/usr/share/gems/gems/fog-aws-0.6.0/lib/fog/aws/models/compute/server.rb:201:in
save' > /opt/rh/ruby193/root/usr/share/gems/gems/fog-core-1.32.0/lib/fog/core/collection.rb:51:increate'
> /usr/share/foreman/app/models/compute_resource.rb:151:in create_vm' > /usr/share/foreman/app/models/compute_resources/foreman/model/ec2.rb:49:increate_vm'
> /usr/share/foreman/app/models/concerns/orchestration/compute.rb:76:in
setCompute' > /usr/share/foreman/app/models/concerns/orchestration.rb:152:inexecute'
> /usr/share/foreman/app/models/concerns/orchestration.rb:97:in block in process' > /usr/share/foreman/app/models/concerns/orchestration.rb:89:ineach'
> /usr/share/foreman/app/models/concerns/orchestration.rb:89:in process' > /usr/share/foreman/app/models/concerns/orchestration.rb:19:inon_save'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:660:in
_run__3478623084252191866__save__3063770953157761678__callbacks' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in__run_callback'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in
_run_save_callbacks' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:inrun_callbacks'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/callbacks.rb:264:in
create_or_update' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/persistence.rb:84:insave'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:50:in
save' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:22:insave'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:241:in
block (2 levels) in save' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:inblock in with_transaction_returning_status'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
transaction' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:intransaction'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in
with_transaction_returning_status' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:241:inblock in save'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:252:in
rollback_active_record_state!' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:240:insave'
> /usr/share/foreman/app/models/concerns/foreman/sti.rb:29:in
save_with_type' > /usr/share/foreman/app/controllers/api/v2/hosts_controller.rb:87:increate'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in
send_action' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:inprocess_action'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in
process_action' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:inblock in process_action'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:573:in
block (5 levels) in _run__4192552180732259917__process_action__1206192807730564402__callbacks' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:inblock in _conditional_callback_around_7651'
> /usr/share/foreman/app/controllers/api/v2/base_controller.rb:151:in
disable_json_root' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in_conditional_callback_around_7651'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:550:in
block (4 levels) in _run__4192552180732259917__process_action__1206192807730564402__callbacks' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:inblock in _conditional_callback_around_7650'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in
around' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in_callback_around_3077'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in
_conditional_callback_around_7650' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:527:inblock (3 levels) in
_run__4192552180732259917__process_action__1206192807730564402__callbacks'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in
block in _conditional_callback_around_7649' > /usr/share/foreman/app/controllers/concerns/application_shared.rb:13:inset_timezone'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in
_conditional_callback_around_7649' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:526:inblock (2 levels) in
_run__4192552180732259917__process_action__1206192807730564402__callbacks'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in
block in _conditional_callback_around_7648' > /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:inclear_thread'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in
_conditional_callback_around_7648' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:448:inblock in
_run__4192552180732259917__process_action__1206192807730564402__callbacks'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in
block in _conditional_callback_around_7647' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:inaround'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in
_callback_around_13' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in_conditional_callback_around_7647'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in
_run__4192552180732259917__process_action__1206192807730564402__callbacks' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in__run_callback'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in
_run_process_action_callbacks' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:inrun_callbacks'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in
process_action' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:inprocess_action'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in
block in process_action' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:inblock in instrument'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in
instrument' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:ininstrument'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in
process_action' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:inprocess_action'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:18:in
process_action' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:inprocess'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in
process' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:203:indispatch'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rack_delegation.rb:14:in
dispatch' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:246:inblock in action'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:indispatch'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:36:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:42:incall'
>
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:68:in
block in call' > /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:ineach'
>
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:incall'
>
/opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/static_dispatcher.rb:65:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/extractor/recorder.rb:97:incall'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/middleware/checksum_in_headers.rb:27:incall'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/etag.rb:23:incall'
>
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/conditionalget.rb:35:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:incall'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:in
call' > /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:incall'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:incontext'
>
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:incall'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:64:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:incall'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in
block in call' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in_run__971102423457248360__call__3063770953157761678__callbacks'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in
__run_callback' > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in_run_call_callbacks'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in
run_callbacks' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:incall'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:incall'
>
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:incall_app'
>
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in
call' > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:incall'
>
/opt/rh/

I'm not particularly familiar with EC2, but I guess the first question
would be: does it work if provisioned in the UI? That will narrow down
if the problem is in Hammer or in Foreman.

Greg