How to create vm with HAMMER + XenServer?

Hi,

(Foreman 1.10RC2, foreman-xen 0.2.2 compute ressource)

I try to create a vm with hammer :

[root@devops-build-03 ~]# hammer --debug host create --build=1 --name="
nico-test-06.devops.neura-local.com" --hostgroup-id 2
–compute-resource-id=1 --interface primary=true,provision=true,managed=true

But I got this error:

Could not create the host:
resource have no errors

I able to create the vm using the CLI with the same compute resource and
hostgroup. Someone encounters this problem ?

Log on foreman side:

  1. 2015-11-17 10:59:38 [app] [I] Processing by
    Api::V2::HostsController#create as JSON
  2. 2015-11-17 10:59:38 [app] [I] Parameters: {"host"=>{"name"=>"
    nico-test-06.devops.neura-local.com", "compute_resource_id"=>1,
    "hostgroup_id"=>2, "build"=>true, "enabled"=>true, "managed"=>true,
    "compute_attributes"=>{"volumes_attri
  3. butes"=>{}}, "host_parameters_attributes"=>{},
    "interfaces_attributes"=>{"0"=>{"primary"=>"true", "provision"=>"true",
    "managed"=>"true"}}}, "apiv"=>"v2"}
  4. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local
    variable to foreman_admin
  5. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local
    variable to nil
  6. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local
    variable to foreman_admin
  7. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local
    variable to nil
  8. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local
    variable to admin
  9. 2015-11-17 10:59:38 [app] [I] Authorized user admin(Admin User)
  10. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local
    variable to admin
  11. 2015-11-17 10:59:40 [app] [W] Action failed
  12. | RuntimeError: resource have no errors
  13. | /usr/share/foreman/app/controllers/api/base_controller.rb:90:in
    `process_resource_error'
  14. | /usr/share/foreman/app/controllers/api/base_controller.rb:110:in
    `process_response'
  15. |
    /usr/share/foreman/app/controllers/api/v2/hosts_controller.rb:90:in `create'
  16. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in
    `send_action'
  17. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in
    `process_action'
  18. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in
    `process_action'
  19. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in
    `block in process_action'
  20. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:573:in
    `block (5 levels) in
    _run__2597261230471645431__process_action__1529846330735909560__callbacks'
  21. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in
    `block in _conditional_callback_around_8658'
  22. |
    /usr/share/foreman/app/controllers/api/v2/base_controller.rb:151:in
    `disable_json_root'
  23. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in
    `_conditional_callback_around_8658'
  24. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:550:in
    `block (4 levels) in
    _run__2597261230471645431__process_action__1529846330735909560__callbacks'
  25. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in
    `block in _conditional_callback_around_8657'
  26. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in
    `around'
  27. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in
    `_callback_around_2879'
  28. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in
    `_conditional_callback_around_8657'
  29. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:527:in
    `block (3 levels) in
    _run__2597261230471645431__process_action__1529846330735909560__callbacks'
  30. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in
    `block in _conditional_callback_around_8656'
  31. |
    /usr/share/foreman/app/controllers/concerns/application_shared.rb:13:in
    `set_timezone'
  32. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in
    `_conditional_callback_around_8656'
  33. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:526:in
    `block (2 levels) in
    _run__2597261230471645431__process_action__1529846330735909560__callbacks'
  34. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in
    `block in _conditional_callback_around_8655'
  35. |
    /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in
    `clear_thread'
  36. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in
    `_conditional_callback_around_8655'
  37. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:448:in
    `block in
    _run__2597261230471645431__process_action__1529846330735909560__callbacks'
  38. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in
    `block in _conditional_callback_around_8654'
  39. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in
    `around'
  40. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in
    `_callback_around_13'
  41. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in
    `_conditional_callback_around_8654'
  42. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in
    `_run__2597261230471645431__process_action__1529846330735909560__callbacks'
  43. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in
    `__run_callback'
  44. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in
    `_run_process_action_callbacks'
  45. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in
    `run_callbacks'
  46. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in
    `process_action'
  47. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in
    `process_action'
  48. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in
    `block in process_action'
  49. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in
    `block in instrument'
  50. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in
    `instrument'
  51. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in
    `instrument'
  52. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in
    `process_action'
  53. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in
    `process_action'
  54. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:18:in
    `process_action'
  55. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in
    `process'
  56. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in
    `process'
  57. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:203:in
    `dispatch'
  58. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rack_delegation.rb:14:in
    `dispatch'
  59. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:246:in
    `block in action'
  60. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in
    `call'
  61. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in
    `dispatch'
  62. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:36:in
    `call'
  63. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:42:in
    `call'
  64. |
    /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:68:in
    `block in call'
  65. |
    /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in
    `each'
  66. |
    /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in
    `call'
  67. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in
    `call'
  68. |
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/static_dispatcher.rb:65:in
    `call'
  69. |
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/extractor/recorder.rb:97:in
    `call'
  70. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in
    `call'
  71. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in
    `call'
  72. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in
    `call'
  73. |
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/middleware/checksum_in_headers.rb:27:in
    `call'
  74. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:in
    `call'
  75. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/etag.rb:23:in
    `call'
  76. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/conditionalget.rb:35:in
    `call'
  77. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:in
    `call'
  78. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:in
    `call'
  79. | /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:in
    `call'
  80. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:in
    `call'
  81. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in
    `context'
  82. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in
    `call'
  83. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:in
    `call'
  84. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:64:in
    `call'
  85. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in
    `call'
  86. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in
    `block in call'
  87. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in
    `_run__667215844898893561__call__3694175364566407301__callbacks'
  88. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in
    `__run_callback'
  89. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in
    `_run_call_callbacks'
  90. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in
    `run_callbacks'
  91. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in
    `call'
  92. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:32:in
    `call'
  93. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in
    `call'
  94. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in
    `call'
  95. |
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in
    `call_app'
  96. |
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in
    `call'
  97. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in
    `call'
  98. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in
    `call'
  99. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/runtime.rb:17:in
    `call'
  100. |
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in
    `call'
  101. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/lock.rb:15:in
    `call'
  102. |
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in
    `call'
  103. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in
    `forward'
  104. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in
    `pass'
  105. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in
    `invalidate'
  106. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in
    `call!'
  107. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in
    `call'
  108. |
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:479:in
    `call'
  109. |
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:223:in
    `call'
  110. |
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in
    `method_missing'
  111. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/builder.rb:134:in
    `call'
  112. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:64:in
    `block in call'
  113. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in
    `each'
  114. |
    /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in
    `call'
  115. |
    /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in
    `process_request'
  116. |
    /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in
    `accept_and_process_next_request'
  117. |
    /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in
    `main_loop'
  118. |
    /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441:in
    `block (3 levels) in start_threads'
  119. |
    /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in
    `call'
  120. |
    /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in
    `block in create_with_logging_context'
  121. 2015-11-17 10:59:40 [app] [I] Rendered
    api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout
    (0.7ms)
  122. 2015-11-17 10:59:40 [app] [I] Completed 500 Internal Server Error
    in 2483ms (Views: 1.9ms | ActiveRecord: 13.8ms)

Debug activate on hammer cli:

  1. root@devops-build-03 ~]# hammer --debug host create --build=1 --name="
    nico-test-06.devops.neura-local.com" --hostgroup-id 2
    –compute-resource-id=1 --interface primary=true,provision=true,managed=true
  2. [ INFO 2015-11-17 10:59:37 Init] Initialization of Hammer CLI (0.4.0)
    has started…
  3. [DEBUG 2015-11-17 10:59:37 Init] Running at ruby 1.9.3-p484
  4. [ INFO 2015-11-17 10:59:37 Init] Configuration from the file
    /etc/hammer/cli_config.yml has been loaded
  5. [ INFO 2015-11-17 10:59:37 Init] Configuration from the file
    /etc/hammer/cli.modules.d/foreman.yml has been loaded
  6. [ INFO 2015-11-17 10:59:37 Init] Configuration from the file
    /root/.hammer/cli.modules.d/foreman.yml has been loaded
  7. [DEBUG 2015-11-17 10:59:37 Connection] Registered: foreman
  8. [DEBUG 2015-11-17 10:59:37 API] Global headers: {
  9.     :content_type => "application/json",
    
  10.           :accept => "application/json;version=2",
    
  11. "Accept-Language" => "en"
    
  12. }
  13. [ INFO 2015-11-17 10:59:37 Modules] Extension module
    hammer_cli_foreman (0.4.0) loaded
  14. [DEBUG 2015-11-17 10:59:37 Init] Using locale 'en'
  15. [DEBUG 2015-11-17 10:59:37 Init] 'mo' files for locale domain
    'hammer-cli' loaded from
    '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.4.0/locale'
  16. [DEBUG 2015-11-17 10:59:37 Init] 'mo' files for locale domain
    'hammer-cli-foreman' loaded from
    '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.4.0/locale'
  17. [ INFO 2015-11-17 10:59:37 HammerCLI::MainCommand] Called with
    options: {"option_debug"=>true}
  18. [ INFO 2015-11-17 10:59:38 HammerCLIForeman::Host] Called with
    options: {}
  19. [ INFO 2015-11-17 10:59:38 HammerCLIForeman::Host::CreateCommand]
    Called with options: {"option_managed"=>true, "option_build"=>true,
    "option_enabled"=>true, "option_volume_list"=>[],
    "option_interface_list"=>[{"primary"=>"true", "provision"=>"true",
    "managed"=>"true"}], "option_compute_resource_id"=>1,
    "option_hostgroup_id"=>2, "option_name"=>"
    nico-test-06.devops.neura-local.com"}
  20. [ INFO 2015-11-17 10:59:38 API] POST /api/hosts
  21. [DEBUG 2015-11-17 10:59:38 API] Params: {
  22. "host" => {
    
  23.                           "name" => "
    

nico-test-06.devops.neura-local.com",
24. "compute_resource_id" => 1,
25. "hostgroup_id" => 2,
26. "build" => true,
27. "enabled" => true,
28. "managed" => true,
29. "compute_attributes" => {
30. "volumes_attributes" => {}
31. },
32. "host_parameters_attributes" => {},
33. "interfaces_attributes" => {
34. "0" => {
35. "primary" => "true",
36. "provision" => "true",
37. "managed" => "true"
38. }
39. }
40. }
41. }
42. [DEBUG 2015-11-17 10:59:38 API] Hea

Hi Nicolas,

are you still having this issue or did you find a workaround?

I'm getting the same issue trying to create a host over the API in Xen.

Best regards
Thilo

··· Am Montag, 30. November 2015 00:30:09 UTC+1 schrieb Nicolas Carlier: > > > Hi, > > (Foreman 1.10RC2, foreman-xen 0.2.2 compute ressource) > > I try to create a vm with hammer : > > [root@devops-build-03 ~]# hammer --debug host create --build=1 --name=" > nico-test-06.devops.neura-local.com" --hostgroup-id 2 > --compute-resource-id=1 --interface primary=true,provision=true,managed=true > > But I got this error: > > Could not create the host: > resource have no errors > > I able to create the vm using the CLI with the same compute resource and > hostgroup. Someone encounters this problem ? > > > Log on foreman side: > > > 1. 2015-11-17 10:59:38 [app] [I] Processing by > Api::V2::HostsController#create as JSON > 2. 2015-11-17 10:59:38 [app] [I] Parameters: {"host"=>{"name"=>" > nico-test-06.devops.neura-local.com", "compute_resource_id"=>1, > "hostgroup_id"=>2, "build"=>true, "enabled"=>true, "managed"=>true, > "compute_attributes"=>{"volumes_attri > 3. butes"=>{}}, "host_parameters_attributes"=>{}, > "interfaces_attributes"=>{"0"=>{"primary"=>"true", "provision"=>"true", > "managed"=>"true"}}}, "apiv"=>"v2"} > 4. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local > variable to foreman_admin > 5. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local > variable to nil > 6. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local > variable to foreman_admin > 7. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local > variable to nil > 8. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local > variable to admin > 9. 2015-11-17 10:59:38 [app] [I] Authorized user admin(Admin User) > 10. 2015-11-17 10:59:38 [app] [D] Setting current user thread-local > variable to admin > 11. 2015-11-17 10:59:40 [app] [W] Action failed > 12. | RuntimeError: resource have no errors > 13. | /usr/share/foreman/app/controllers/api/base_controller.rb:90:in > `process_resource_error' > 14. | > /usr/share/foreman/app/controllers/api/base_controller.rb:110:in > `process_response' > 15. | > /usr/share/foreman/app/controllers/api/v2/hosts_controller.rb:90:in `create' > 16. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in > `send_action' > 17. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in > `process_action' > 18. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in > `process_action' > 19. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in > `block in process_action' > 20. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:573:in > `block (5 levels) in > _run__2597261230471645431__process_action__1529846330735909560__callbacks' > 21. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in > `block in _conditional_callback_around_8658' > 22. | > /usr/share/foreman/app/controllers/api/v2/base_controller.rb:151:in > `disable_json_root' > 23. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in > `_conditional_callback_around_8658' > 24. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:550:in > `block (4 levels) in > _run__2597261230471645431__process_action__1529846330735909560__callbacks' > 25. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in > `block in _conditional_callback_around_8657' > 26. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in > `around' > 27. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in > `_callback_around_2879' > 28. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in > `_conditional_callback_around_8657' > 29. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:527:in > `block (3 levels) in > _run__2597261230471645431__process_action__1529846330735909560__callbacks' > 30. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in > `block in _conditional_callback_around_8656' > 31. | > /usr/share/foreman/app/controllers/concerns/application_shared.rb:13:in > `set_timezone' > 32. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in > `_conditional_callback_around_8656' > 33. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:526:in > `block (2 levels) in > _run__2597261230471645431__process_action__1529846330735909560__callbacks' > 34. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in > `block in _conditional_callback_around_8655' > 35. | > /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in > `clear_thread' > 36. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in > `_conditional_callback_around_8655' > 37. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:448:in > `block in > _run__2597261230471645431__process_action__1529846330735909560__callbacks' > 38. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in > `block in _conditional_callback_around_8654' > 39. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in > `around' > 40. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in > `_callback_around_13' > 41. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in > `_conditional_callback_around_8654' > 42. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in > `_run__2597261230471645431__process_action__1529846330735909560__callbacks' > 43. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in > `__run_callback' > 44. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in > `_run_process_action_callbacks' > 45. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in > `run_callbacks' > 46. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in > `process_action' > 47. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in > `process_action' > 48. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in > `block in process_action' > 49. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in > `block in instrument' > 50. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in > `instrument' > 51. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in > `instrument' > 52. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in > `process_action' > 53. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in > `process_action' > 54. | > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:18:in > `process_action' > 55. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in > `process' > 56. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in > `process' > 57. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:203:in > `dispatch' > 58. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rack_delegation.rb:14:in > `dispatch' > 59. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:246:in > `block in action' > 60. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in > `call' > 61. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in > `dispatch' > 62. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:36:in > `call' > 63. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:42:in > `call' > 64. | > /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:68:in > `block in call' > 65. | > /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in > `each' > 66. | > /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in > `call' > 67. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in > `call' > 68. | > /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/static_dispatcher.rb:65:in > `call' > 69. | > /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/extractor/recorder.rb:97:in > `call' > 70. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in > `call' > 71. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in > `call' > 72. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in > `call' > 73. | > /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/middleware/checksum_in_headers.rb:27:in > `call' > 74. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:in > `call' > 75. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/etag.rb:23:in > `call' > 76. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/conditionalget.rb:35:in > `call' > 77. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:in > `call' > 78. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:in > `call' > 79. | > /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call' > 80. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:in > `call' > 81. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in > `context' > 82. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in > `call' > 83. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:in > `call' > 84. | > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:64:in > `call' > 85. | > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in > `call' > 86. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in > `block in call' > 87. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in > `_run__667215844898893561__call__3694175364566407301__callbacks' > 88. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in > `__run_callback' > 89. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in > `_run_call_callbacks' > 90. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in > `run_callbacks' > 91. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in > `call' > 92. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:32:in > `call' > 93. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in > `call' > 94. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in > `call' > 95. | > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in > `call_app' > 96. | > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in > `call' > 97. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in > `call' > 98. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in > `call' > 99. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/runtime.rb:17:in > `call' > 100. | > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in > `call' > 101. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/lock.rb:15:in > `call' > 102. | > /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in > `call' > 103. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in > `forward' > 104. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in > `pass' > 105. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in > `invalidate' > 106. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in > `call!' > 107. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in > `call' > 108. | > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:479:in > `call' > 109. | > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:223:in > `call' > 110. | > /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in > `method_missing' > 111. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/builder.rb:134:in > `call' > 112. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:64:in > `block in call' > 113. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in > `each' > 114. | > /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in > `call' > 115. | > /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in > `process_request' > 116. | > /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in > `accept_and_process_next_request' > 117. | > /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in > `main_loop' > 118. | > /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441:in > `block (3 levels) in start_threads' > 119. | > /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in > `call' > 120. | > /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in > `block in create_with_logging_context' > 121. 2015-11-17 10:59:40 [app] [I] Rendered > api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout > (0.7ms) > 122. 2015-11-17 10:59:40 [app] [I] Completed 500 Internal Server Error > in 2483ms (Views: 1.9ms | ActiveRecord: 13.8ms) > > > Debug activate on hammer cli: > > > 1. root@devops-build-03 ~]# hammer --debug host create --build=1 > --name="nico-test-06.devops.neura-local.com" --hostgroup-id 2 > --compute-resource-id=1 --interface primary=true,provision=true,managed=true > 2. [ INFO 2015-11-17 10:59:37 Init] Initialization of Hammer CLI > (0.4.0) has started... > 3. [DEBUG 2015-11-17 10:59:37 Init] Running at ruby 1.9.3-p484 > 4. [ INFO 2015-11-17 10:59:37 Init] Configuration from the file > /etc/hammer/cli_config.yml has been loaded > 5. [ INFO 2015-11-17 10:59:37 Init] Configuration from the file > /etc/hammer/cli.modules.d/foreman.yml has been loaded > 6. [ INFO 2015-11-17 10:59:37 Init] Configuration from the file > /root/.hammer/cli.modules.d/foreman.yml has been loaded > 7. [DEBUG 2015-11-17 10:59:37 Connection] Registered: foreman > 8. [DEBUG 2015-11-17 10:59:37 API] Global headers: { > 9. :content_type => "application/json", > 10.