Actions
Bug #4417
openEditing Compute Resource breaks host creation
Status:
New
Priority:
Normal
Assignee:
-
Category:
Compute resources
Target version:
-
Description
Only tested on Openstack.
When an existing compute resource is edited, the Openstack key pair is still stored in Foreman for the old compute resource. Hence, since the key pair does not exist in the new edited compute resource, host creation fails with an ugly 500 "string cannot be nil" when actually the log says what is actually going on " Invalid key_name provided."
Started POST "/hosts" for 127.0.0.1 at 2014-02-23 10:27:36 +0100 Processing by HostsController#create as */* Parameters: {"utf8"=>"✓", "authenticity_token"=>"+3dyCyDKUGpJIEtENaYlkhgbVU2bdlg0M+XqY2a8/08=", "host"=>{"name"=>"aaaaa", "hostgroup_id"=>"", "compute_resource_id"=>"24", "environment_id"=>"16", "puppet_proxy_id"=>"", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "compute_attributes"=>{"flavor_ref"=>"1", "tenant_id"=>"ebfc00c9ef80421380542aec08b0a156", "security_group"=>"", "network"=>"", "image_ref"=>"9e2378a0-d5c8-499d-9482-c2f361eda7d6"}, "mac"=>"", "domain_id"=>"2", "ip"=>"", "interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false", "type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"", "provider"=>"IPMI"}}, "architecture_id"=>"1", "operatingsystem_id"=>"17", "provision_method"=>"image", "build"=>"1", "medium_id"=>"2", "ptable_id"=>"", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"image"} Rendering UserData template for aaaaa.localdomain Revoked old certificates and enabled autosign for UserData Adding Compute instance for aaaaa.localdomain failed to create vm: Invalid key_name provided. Failed to create a compute openstackhome (OpenStack) instance aaaaa.localdomain: Invalid key_name provided. /home/daniel/workspace/foreman/cleanforeman/app/models/compute_resources/foreman/model/openstack.rb:64:in `rescue in create_vm' /home/daniel/workspace/foreman/cleanforeman/app/models/compute_resources/foreman/model/openstack.rb:53:in `create_vm' /home/daniel/workspace/foreman/cleanforeman/app/models/concerns/orchestration/compute.rb:62:in `setCompute' /home/daniel/workspace/foreman/cleanforeman/app/models/concerns/orchestration.rb:148:in `execute' /home/daniel/workspace/foreman/cleanforeman/app/models/concerns/orchestration.rb:88:in `block in process' /home/daniel/workspace/foreman/cleanforeman/app/models/concerns/orchestration.rb:80:in `each' /home/daniel/workspace/foreman/cleanforeman/app/models/concerns/orchestration.rb:80:in `process' /home/daniel/workspace/foreman/cleanforeman/app/models/concerns/orchestration.rb:18:in `on_save' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:638:in `_run__2230364410368124623__save__2120439120557390228__callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:405:in `__run_callback' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:385:in `_run_save_callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:81:in `run_callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/callbacks.rb:264:in `create_or_update' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/persistence.rb:84:in `save' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/validations.rb:50:in `save' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/attribute_methods/dirty.rb:22:in `save' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/transactions.rb:259:in `block (2 levels) in save' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/transactions.rb:208:in `transaction' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/transactions.rb:311:in `with_transaction_returning_status' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/transactions.rb:259:in `block in save' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/transactions.rb:270:in `rollback_active_record_state!' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/transactions.rb:258:in `save' /home/daniel/workspace/foreman/cleanforeman/app/models/concerns/foreman/sti.rb:29:in `save_with_type' /home/daniel/workspace/foreman/cleanforeman/app/controllers/hosts_controller.rb:95:in `create' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_controller/metal/implicit_render.rb:4:in `send_action' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/abstract_controller/base.rb:167:in `process_action' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_controller/metal/rendering.rb:10:in `process_action' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/abstract_controller/callbacks.rb:18:in `block in process_action' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:527:in `block (3 levels) in _run__2880236789093410755__process_action__840605431410591841__callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_5690' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:326:in `around' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:310:in `_callback_around_837' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_5690' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:526:in `block (2 levels) in _run__2880236789093410755__process_action__840605431410591841__callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_5689' /home/daniel/workspace/foreman/cleanforeman/app/models/concerns/foreman/thread_session.rb:33:in `clear_thread' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_5689' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:415:in `block in _run__2880236789093410755__process_action__840605431410591841__callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_5688' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:326:in `around' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:310:in `_callback_around_13' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_5688' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:414:in `_run__2880236789093410755__process_action__840605431410591841__callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:405:in `__run_callback' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:81:in `run_callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/abstract_controller/callbacks.rb:17:in `process_action' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_controller/metal/rescue.rb:29:in `process_action' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/notifications.rb:123:in `block in instrument' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/notifications/instrumenter.rb:20:in `instrument' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/notifications.rb:123:in `instrument' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_controller/metal/instrumentation.rb:29:in `process_action' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_controller/metal/params_wrapper.rb:207:in `process_action' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/railties/controller_runtime.rb:18:in `process_action' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/abstract_controller/base.rb:121:in `process' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/abstract_controller/rendering.rb:45:in `process' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_controller/metal.rb:203:in `dispatch' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_controller/metal.rb:246:in `block in action' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/routing/route_set.rb:73:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/routing/route_set.rb:73:in `dispatch' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/routing/route_set.rb:36:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/journey-1.0.4/lib/journey/router.rb:56:in `each' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/journey-1.0.4/lib/journey/router.rb:56:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/routing/route_set.rb:608:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/apipie-rails-0.0.24/lib/apipie/static_dispatcher.rb:65:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-openid-1.4.2/lib/rack/openid.rb:98:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/etag.rb:23:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/conditionalget.rb:35:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/head.rb:14:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/params_parser.rb:21:in `call' /home/daniel/workspace/foreman/cleanforeman/lib/middleware/catch_json_parse_errors.rb:9:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/flash.rb:242:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/cookies.rb:341:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/query_cache.rb:64:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:405:in `_run__2653290797337772252__call__2120439120557390228__callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:405:in `__run_callback' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:385:in `_run_call_callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:81:in `run_callbacks' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/callbacks.rb:27:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/remote_ip.rb:31:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.16/lib/rails/rack/logger.rb:32:in `call_app' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.16/lib/rails/rack/logger.rb:16:in `block in call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/tagged_logging.rb:22:in `tagged' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.16/lib/rails/rack/logger.rb:16:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/request_id.rb:22:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.16/lib/active_support/cache/strategy/local_cache.rb:72:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.16/lib/action_dispatch/middleware/static.rb:63:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.16/lib/rails/engine.rb:484:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.16/lib/rails/application.rb:231:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.16/lib/rails/railtie/configurable.rb:30:in `method_missing' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/builder.rb:134:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/urlmap.rb:64:in `block in call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `each' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.16/lib/rails/rack/debugger.rb:20:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.16/lib/rails/rack/log_tailer.rb:17:in `call' /home/daniel/.rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service' /home/daniel/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' /home/daniel/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' /home/daniel/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' Rolling back due to a problem: [Set up compute instance aaaaa.localdomain 2 failed [#<Host::Managed id: nil, name: "aaaaa.localdomain", ip: nil, last_compile: nil, last_freshcheck: nil, last_report: nil, updated_at: nil, source_file_id: nil, created_at: nil, mac: nil, root_pass: "$1$fD23ZM0b$Nv1ucYthcelJ0wrNSZfAB0", serial: nil, puppet_status: 0, domain_id: 2, architecture_id: 1, operatingsystem_id: 17, environment_id: 16, subnet_id: nil, ptable_id: nil, medium_id: 2, build: true, comment: "", disk: "", installed_at: nil, model_id: nil, hostgroup_id: nil, owner_id: nil, owner_type: nil, enabled: true, puppet_ca_proxy_id: nil, managed: true, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: 24, puppet_proxy_id: nil, certname: nil, image_id: 4, organization_id: nil, location_id: nil, type: "Host::Managed", compute_profile_id: nil>, :setCompute]] Failed to save: Failed to create a compute openstackhome (OpenStack) instance aaaaa.localdomain: Invalid key_name provided.
Actions