Bug #13422
closedcreating a host on a libvirt compute resource throws an invalid MAC error
Description
command used:
hammer -d host create --hostgroup=Default --compute-resource=libvirt --compute-profile="1-Small" --compute-attributes="start=true" --interface="primary=true,compute_type=network,compute_network=default,provision=true" --name="hammer"
Output from -d:
[ INFO 2016-01-28 08:46:25 Init] Initialization of Hammer CLI (0.5.1) has started...
[DEBUG 2016-01-28 08:46:25 Init] Running at ruby 1.9.3-p484
[ INFO 2016-01-28 08:46:25 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-01-28 08:46:25 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[DEBUG 2016-01-28 08:46:25 Connection] Registered: foreman
[DEBUG 2016-01-28 08:46:25 API] Global headers: {
:content_type => "application/json",
:accept => "application/json;version=2",
"Accept-Language" => "en"
}
[ INFO 2016-01-28 08:46:25 Modules] Extension module hammer_cli_foreman (0.5.1) loaded
[DEBUG 2016-01-28 08:46:25 Init] Using locale 'en'
[DEBUG 2016-01-28 08:46:25 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/share/locale'
[DEBUG 2016-01-28 08:46:25 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/share/locale'
[ INFO 2016-01-28 08:46:25 HammerCLI::MainCommand] Called with options: {"option_debug"=>true}
[ INFO 2016-01-28 08:46:25 HammerCLIForeman::Host] Called with options: {}
[ INFO 2016-01-28 08:46:25 HammerCLIForeman::Host::CreateCommand] Called with options: {"option_managed"=>true, "option_build"=>true, "option_enabled"=>true, "option_overwrite"=>true, "option_compute_attributes"=>{"start"=>"true"}, "option_volume_list"=>[], "option_interface_list"=>[{"primary"=>"true", "compute_type"=>"network", "compute_network"=>"default", "provision"=>"true"}], "option_compute_resource_name"=>"libvirt", "option_hostgroup_name"=>"Default", "option_compute_profile_name"=>"1-Small", "option_name"=>"hammer"}
[ INFO 2016-01-28 08:46:25 API] GET /api/compute_resources
[DEBUG 2016-01-28 08:46:25 API] Params: {
:search => "name = \"libvirt\""
}
[DEBUG 2016-01-28 08:46:25 API] Headers: {
:params => {
:search => "name = \"libvirt\""
}
}
[Foreman] Username: admin
[Foreman] Password for admin:
[DEBUG 2016-01-28 08:46:31 API] Response: {
"total" => 1,
"subtotal" => 1,
"page" => 1,
"per_page" => 20,
"search" => "name = \"libvirt\"",
"sort" => {
"by" => nil,
"order" => nil
},
"results" => [
[0] {
"description" => "",
"url" => "qemu+ssh://root@192.168.1.1/system",
"created_at" => "2016-01-27T00:23:21Z",
"updated_at" => "2016-01-27T00:23:21Z",
"id" => 1,
"name" => "libvirt",
"provider" => "Libvirt",
"provider_friendly_name" => "Libvirt",
"display_type" => "VNC",
"set_console_password" => true
}
]
}
[DEBUG 2016-01-28 08:46:31 API] Response headers: {
:date => "Wed, 27 Jan 2016 21:46:31 GMT",
:server => "Apache/2.4.7 (Ubuntu)",
:foreman_version => "1.10.1",
:foreman_api_version => "2",
:apipie_checksum => "23ce322a4d14cf8f8066bfe6f3d1e0ec",
:x_ua_compatible => "IE=Edge,chrome=1",
:cache_control => "must-revalidate, private, max-age=0",
:x_request_id => "b8ee81901d5a075240db51c85ea4525c",
:x_runtime => "0.036656",
:x_rack_cache => "miss",
:x_powered_by => "Phusion Passenger 4.0.37",
:set_cookie => [
[0] "_session_id=4328637385e9d686c0434928fd2b9817; path=/; secure; HttpOnly",
[1] "request_method=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT"
],
:etag => "\"0706fb7a3ecea33b5e3a2fc4b2f32df8\"",
:status => "200 OK",
:connection => "close",
:transfer_encoding => "chunked",
:content_type => "application/json; charset=utf-8"
}
[ INFO 2016-01-28 08:46:31 API] GET /api/hostgroups
[DEBUG 2016-01-28 08:46:31 API] Params: {
:search => "name = \"Default\""
}
[DEBUG 2016-01-28 08:46:31 API] Headers: {
:params => {
:search => "name = \"Default\""
}
}
[DEBUG 2016-01-28 08:46:31 API] Response: {
"total" => 2,
"subtotal" => 1,
"page" => 1,
"per_page" => 20,
"search" => "name = \"Default\"",
"sort" => {
"by" => nil,
"order" => nil
},
"results" => [
[0] {
"subnet_id" => 1,
"subnet_name" => "libvirt",
"operatingsystem_id" => 1,
"operatingsystem_name" => "Ubuntu 14.04.3 LTS",
"domain_id" => 1,
"domain_name" => "internal.devops.removed",
"environment_id" => 2,
"environment_name" => "proddevtest",
"compute_profile_id" => 1,
"compute_profile_name" => "1-Small",
"ancestry" => nil,
"puppet_proxy_id" => 1,
"puppet_ca_proxy_id" => 1,
"ptable_id" => 56,
"ptable_name" => "Preseed default",
"medium_id" => 6,
"medium_name" => "Ubuntu mirror",
"architecture_id" => 1,
"architecture_name" => "x86_64",
"realm_id" => nil,
"realm_name" => nil,
"created_at" => "2016-01-27T04:12:09Z",
"updated_at" => "2016-01-27T04:12:55Z",
"id" => 2,
"name" => "Default",
"title" => "Default"
}
]
}
[DEBUG 2016-01-28 08:46:31 API] Response headers: {
:date => "Wed, 27 Jan 2016 21:46:31 GMT",
:server => "Apache/2.4.7 (Ubuntu)",
:foreman_version => "1.10.1",
:foreman_api_version => "2",
:apipie_checksum => "23ce322a4d14cf8f8066bfe6f3d1e0ec",
:x_ua_compatible => "IE=Edge,chrome=1",
:cache_control => "must-revalidate, private, max-age=0",
:x_request_id => "ee366952711c0fde2f2d8debfc08e4f3",
:x_runtime => "0.038571",
:x_rack_cache => "miss",
:x_powered_by => "Phusion Passenger 4.0.37",
:set_cookie => [
[0] "_session_id=b005be9f3aea634a09627230810d6582; path=/; secure; HttpOnly",
[1] "request_method=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT"
],
:etag => "\"e345d42d5d960f7713a43ae3c11aec91\"",
:status => "200 OK",
:connection => "close",
:transfer_encoding => "chunked",
:content_type => "application/json; charset=utf-8"
}
[ INFO 2016-01-28 08:46:31 API] GET /api/compute_profiles
[DEBUG 2016-01-28 08:46:31 API] Params: {
:search => "name = \"1-Small\""
}
[DEBUG 2016-01-28 08:46:31 API] Headers: {
:params => {
:search => "name = \"1-Small\""
}
}
[DEBUG 2016-01-28 08:46:31 API] Response: {
"total" => 3,
"subtotal" => 1,
"page" => 1,
"per_page" => 20,
"search" => "name = \"1-Small\"",
"sort" => {
"by" => nil,
"order" => nil
},
"results" => [
[0] {
"created_at" => "2016-01-26T23:51:15Z",
"updated_at" => "2016-01-26T23:51:15Z",
"id" => 1,
"name" => "1-Small"
}
]
}
[DEBUG 2016-01-28 08:46:31 API] Response headers: {
:date => "Wed, 27 Jan 2016 21:46:31 GMT",
:server => "Apache/2.4.7 (Ubuntu)",
:foreman_version => "1.10.1",
:foreman_api_version => "2",
:apipie_checksum => "23ce322a4d14cf8f8066bfe6f3d1e0ec",
:x_ua_compatible => "IE=Edge,chrome=1",
:cache_control => "must-revalidate, private, max-age=0",
:x_request_id => "bd931a95fec9e866b84cddc98af81d2a",
:x_runtime => "0.027836",
:x_rack_cache => "miss",
:x_powered_by => "Phusion Passenger 4.0.37",
:set_cookie => [
[0] "_session_id=b02b6ae052e90924ee78a46bc681e5c8; path=/; secure; HttpOnly",
[1] "request_method=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT"
],
:etag => "\"51f759cd3fe314f91ec4781165dffc5f\"",
:status => "200 OK",
:connection => "close",
:transfer_encoding => "chunked",
:content_type => "application/json; charset=utf-8"
}
[ INFO 2016-01-28 08:46:31 API] POST /api/hosts
[DEBUG 2016-01-28 08:46:31 API] Params: {
"host" => {
"name" => "hammer",
"compute_resource_id" => 1,
"hostgroup_id" => 2,
"build" => true,
"enabled" => true,
"managed" => true,
"compute_profile_id" => 1,
"compute_attributes" => {
"start" => "true",
"volumes_attributes" => {}
},
"overwrite" => true,
"host_parameters_attributes" => {},
"interfaces_attributes" => {
"0" => {
"primary" => "true",
"provision" => "true",
"compute_attributes" => {
"type" => "network",
"network" => "default"
}
}
}
}
}
[DEBUG 2016-01-28 08:46:31 API] Headers: {}
[DEBUG 2016-01-28 08:46:33 API] 500 Internal Server Error
{
"error" => {
"message" => "Invalid MAC "
}
}
[ERROR 2016-01-28 08:46:33 Exception] Invalid MAC
Could not create the host:
Invalid MAC
[ERROR 2016-01-28 08:46:33 Exception]
RestClient::InternalServerError (500 Internal Server Error):
/usr/lib/ruby/vendor_ruby/restclient/abstract_response.rb:48:in `return!'
/usr/lib/ruby/vendor_ruby/restclient/request.rb:230:in `process_result'
/usr/lib/ruby/vendor_ruby/restclient/request.rb:178:in `block in transmit'
/usr/lib/ruby/1.9.1/net/http.rb:746:in `start'
/usr/lib/ruby/vendor_ruby/restclient/request.rb:172:in `transmit'
/usr/lib/ruby/vendor_ruby/restclient/request.rb:64:in `execute'
/usr/lib/ruby/vendor_ruby/restclient/request.rb:33:in `execute'
/usr/lib/ruby/vendor_ruby/restclient/resource.rb:67:in `post'
/usr/lib/ruby/vendor_ruby/apipie_bindings/api.rb:286:in `call_client'
/usr/lib/ruby/vendor_ruby/apipie_bindings/api.rb:217:in `http_call'
/usr/lib/ruby/vendor_ruby/apipie_bindings/api.rb:163:in `call'
/usr/lib/ruby/vendor_ruby/apipie_bindings/resource.rb:14:in `call'
/usr/lib/ruby/vendor_ruby/hammer_cli/apipie/command.rb:43:in `send_request'
/usr/lib/ruby/vendor_ruby/hammer_cli_foreman/commands.rb:189:in `send_request'
/usr/lib/ruby/vendor_ruby/hammer_cli/apipie/command.rb:34:in `execute'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:68:in `run'
/usr/lib/ruby/vendor_ruby/hammer_cli/abstract.rb:22:in `run'
/usr/lib/ruby/vendor_ruby/clamp/subcommand/execution.rb:11:in `execute'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:68:in `run'
/usr/lib/ruby/vendor_ruby/hammer_cli/abstract.rb:22:in `run'
/usr/lib/ruby/vendor_ruby/clamp/subcommand/execution.rb:11:in `execute'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:68:in `run'
/usr/lib/ruby/vendor_ruby/hammer_cli/abstract.rb:22:in `run'
/usr/lib/ruby/vendor_ruby/clamp/command.rb:133:in `run'
/usr/bin/hammer:125:in `<main>'
Updated by Dominic Cleal almost 10 years ago
Also posted to https://groups.google.com/forum/#!topic/foreman-users/xPzfQ5kpKxg.
Debug logs from Foreman itself would be useful if you could get them please - see http://theforeman.org/manuals/1.10/index.html#7.2Debugging
Updated by Chris Lord almost 10 years ago
2016-01-29T11:14:54 [app] [I] Started GET "/api/compute_resources?search=name+%3D+%22libvirt%22" for 192.168.1.2 at 2016-01-29 11:14:54 +1100
2016-01-29T11:14:54 [app] [I] Processing by Api::V2::ComputeResourcesController#index as JSON
2016-01-29T11:14:54 [app] [I] Parameters: {"search"=>"name = \"libvirt\"", "apiv"=>"v2", "compute_resource"=>{}}
2016-01-29T11:14:54 [app] [D] Setting current user thread-local variable to foreman_admin
2016-01-29T11:14:54 [app] [D] Setting current user thread-local variable to nil
2016-01-29T11:14:54 [app] [D] Setting current user thread-local variable to foreman_admin
2016-01-29T11:14:54 [app] [D] Setting current user thread-local variable to nil
2016-01-29T11:14:54 [app] [D] Setting current user thread-local variable to admin
2016-01-29T11:14:54 [app] [I] Authorized user admin(Admin User)
2016-01-29T11:14:54 [app] [D] Setting current user thread-local variable to admin
2016-01-29T11:14:54 [app] [I] Rendered api/v2/compute_resources/index.json.rabl within api/v2/layouts/index_layout (5.1ms)
2016-01-29T11:14:54 [app] [D] Body: {
| "total": 1,
| "subtotal": 1,
| "page": 1,
| "per_page": 20,
| "search": "name = \"libvirt\"",
| "sort": {
| "by": null,
| "order": null
| },
| "results": [{"description":"","url":"qemu+ssh://root@192.168.1.1/system","created_at":"2016-01-27T00:23:21Z","updated_at":"2016-01-28T04:40:15Z","id":1,"name":"libvirt","provider":"Libvirt","provider_friendly_name":"Libvirt","display_type":"VNC","set_console_password":true}]
| }
|
2016-01-29T11:14:54 [app] [I] Completed 200 OK in 40.9ms (Views: 10.0ms | ActiveRecord: 9.8ms)
2016-01-29T11:14:56 [app] [I] Started GET "/api/hostgroups?search=name+%3D+%22Default%22" for 192.168.1.2 at 2016-01-29 11:14:56 +1100
2016-01-29T11:14:56 [app] [I] Processing by Api::V2::HostgroupsController#index as JSON
2016-01-29T11:14:56 [app] [I] Parameters: {"search"=>"name = \"Default\"", "apiv"=>"v2", "hostgroup"=>{}}
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to foreman_admin
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to nil
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to foreman_admin
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to nil
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to admin
2016-01-29T11:14:56 [app] [I] Authorized user admin(Admin User)
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to admin
2016-01-29T11:14:56 [app] [I] Rendered api/v2/hostgroups/index.json.rabl within api/v2/layouts/index_layout (16.3ms)
2016-01-29T11:14:56 [app] [D] Body: {
| "total": 2,
| "subtotal": 1,
| "page": 1,
| "per_page": 20,
| "search": "name = \"Default\"",
| "sort": {
| "by": null,
| "order": null
| },
| "results": [{"subnet_id":1,"subnet_name":"libvirt","operatingsystem_id":1,"operatingsystem_name":"Ubuntu 14.04.3 LTS","domain_id":1,"domain_name":"internal.devops.itree","environment_id":2,"environment_name":"proddevtest","compute_profile_id":1,"compute_profile_name":"1-Small","ancestry":null,"puppet_proxy_id":1,"puppet_ca_proxy_id":1,"ptable_id":56,"ptable_name":"Preseed default","medium_id":6,"medium_name":"Ubuntu mirror","architecture_id":1,"architecture_name":"x86_64","realm_id":null,"realm_name":null,"created_at":"2016-01-27T04:12:09Z","updated_at":"2016-01-27T04:12:55Z","id":2,"name":"Default","title":"Default"}]
| }
|
2016-01-29T11:14:56 [app] [I] Completed 200 OK in 40.7ms (Views: 17.8ms | ActiveRecord: 7.5ms)
2016-01-29T11:14:56 [app] [I] Started POST "/api/hosts" for 192.168.1.2 at 2016-01-29 11:14:56 +1100
2016-01-29T11:14:56 [app] [I] Processing by Api::V2::HostsController#create as JSON
2016-01-29T11:14:56 [app] [I] Parameters: {"host"=>{"name"=>"hammer-host8", "compute_resource_id"=>1, "hostgroup_id"=>2, "build"=>true, "enabled"=>true, "managed"=>true, "compute_attributes"=>{"start"=>"true", "volumes_attributes"=>{"0"=>{"pool_name"=>"default", "capacity"=>"10G", "format_type"=>"qcow2"}}}, "overwrite"=>true, "host_parameters_attributes"=>{}, "interfaces_attributes"=>{"0"=>{"primary"=>"true", "provision"=>"true", "mac"=>"", "compute_attributes"=>{"type"=>"network", "network"=>"default", "model"=>"virtio"}}}}, "apiv"=>"v2"}
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to foreman_admin
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to nil
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to foreman_admin
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to nil
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to admin
2016-01-29T11:14:56 [app] [I] Authorized user admin(Admin User)
2016-01-29T11:14:56 [app] [D] Setting current user thread-local variable to admin
2016-01-29T11:14:58 [app] [W] Action failed
| Net::Validations::Error: Invalid MAC
| /usr/share/foreman/lib/net/validations.rb:40:in `validate_mac'
| /usr/share/foreman/lib/net/dhcp/record.rb:7:in `initialize'
| /usr/share/foreman/app/models/concerns/orchestration/dhcp.rb:20:in `new'
| /usr/share/foreman/app/models/concerns/orchestration/dhcp.rb:20:in `dhcp_record'
| /usr/share/foreman/app/models/concerns/orchestration/dhcp.rb:158:in `queue_remove_dhcp_conflicts'
| /usr/share/foreman/app/models/concerns/orchestration/dhcp.rb:111:in `queue_dhcp'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:468:in `_run__204758068697137639__validation__2265155599320345497__callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_validation_callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activemodel-3.2.21/lib/active_model/validations/callbacks.rb:53:in `run_validations!'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activemodel-3.2.21/lib/active_model/validations.rb:195:in `valid?'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/validations.rb:69:in `valid?'
| /usr/share/foreman/app/models/concerns/orchestration.rb:75:in `valid?'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/autosave_association.rb:300:in `association_valid?'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/autosave_association.rb:289:in `block in validate_collection_association'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/autosave_association.rb:289:in `each'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/autosave_association.rb:289:in `validate_collection_association'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/autosave_association.rb:217:in `block in add_autosave_association_callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/autosave_association.rb:161:in `instance_eval'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/autosave_association.rb:161:in `block in define_non_cyclic_method'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:561:in `_run__3714248417403745965__validate__2265155599320345497__callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_validate_callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activemodel-3.2.21/lib/active_model/validations.rb:228:in `run_validations!'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activemodel-3.2.21/lib/active_model/validations/callbacks.rb:53:in `block in run_validations!'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:480:in `_run__3714248417403745965__validation__2265155599320345497__callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_validation_callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activemodel-3.2.21/lib/active_model/validations/callbacks.rb:53:in `run_validations!'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activemodel-3.2.21/lib/active_model/validations.rb:195:in `valid?'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/validations.rb:69:in `valid?'
| /usr/share/foreman/app/models/concerns/orchestration.rb:75:in `valid?'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/validations.rb:77:in `perform_validations'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/validations.rb:50:in `save'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/attribute_methods/dirty.rb:22:in `save'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:259:in `block (2 levels) in save'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in `transaction'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:259:in `block in save'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:258:in `save'
| /usr/share/foreman/app/models/concerns/foreman/sti.rb:29:in `save_with_type'
| /usr/share/foreman/app/controllers/api/v2/hosts_controller.rb:96:in `create'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/abstract_controller/base.rb:167:in `process_action'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/rendering.rb:10:in `process_action'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:584:in `block (5 levels) in _run__3525657113618761277__process_action__119280902557023120__callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7711'
| /usr/share/foreman/app/controllers/api/v2/base_controller.rb:151:in `disable_json_root'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7711'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:550:in `block (4 levels) in _run__3525657113618761277__process_action__119280902557023120__callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7710'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:326:in `around'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:310:in `_callback_around_1973'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7710'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:527:in `block (3 levels) in _run__3525657113618761277__process_action__119280902557023120__callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7709'
| /usr/share/foreman/app/controllers/concerns/application_shared.rb:13:in `set_timezone'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7709'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:526:in `block (2 levels) in _run__3525657113618761277__process_action__119280902557023120__callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7708'
| /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7708'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:448:in `block in _run__3525657113618761277__process_action__119280902557023120__callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7707'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:326:in `around'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:310:in `_callback_around_13'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7707'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:414:in `_run__3525657113618761277__process_action__119280902557023120__callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/abstract_controller/callbacks.rb:17:in `process_action'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/rescue.rb:29:in `process_action'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/notifications.rb:123:in `block in instrument'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/notifications.rb:123:in `instrument'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/abstract_controller/base.rb:121:in `process'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/abstract_controller/rendering.rb:45:in `process'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal.rb:203:in `dispatch'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal.rb:246:in `block in action'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:73:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:36:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/routing/mapper.rb:43:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:608:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/apipie-rails-0.2.6/lib/apipie/static_dispatcher.rb:65:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/apipie-rails-0.2.6/lib/apipie/extractor/recorder.rb:97:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/apipie-rails-0.2.6/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.7/lib/rack/etag.rb:23:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.7/lib/rack/conditionalget.rb:35:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/head.rb:14:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
| /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/flash.rb:242:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.7/lib/rack/session/abstract/id.rb:210:in `context'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.7/lib/rack/session/abstract/id.rb:205:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/cookies.rb:341:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/query_cache.rb:64:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `_run__1692766960840314705__call__2265155599320345497__callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/rack/logger.rb:32:in `call_app'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/rack/logger.rb:18:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/request_id.rb:22:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.7/lib/rack/methodoverride.rb:21:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.7/lib/rack/runtime.rb:17:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.7/lib/rack/lock.rb:15:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/static.rb:83:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/engine.rb:484:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/application.rb:231:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/railtie/configurable.rb:30:in `method_missing'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.7/lib/rack/builder.rb:134:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.7/lib/rack/urlmap.rb:64:in `block in call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.7/lib/rack/urlmap.rb:49:in `each'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.7/lib/rack/urlmap.rb:49:in `call'
| /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
| /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:142:in `accept_and_process_next_request'
| /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
| /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:448:in `block (3 levels) in start_threads'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/logging-2.0.0/lib/logging/diagnostic_context.rb:448:in `call'
| /usr/share/foreman/vendor/ruby/1.9.1/gems/logging-2.0.0/lib/logging/diagnostic_context.rb:448:in `block in create_with_logging_context'
2016-01-29T11:14:58 [app] [I] Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (1.1ms)
2016-01-29T11:14:58 [app] [I] Completed 500 Internal Server Error in 2413.8ms (Views: 7.9ms | ActiveRecord: 11.6ms)
2016-01-29T11:14:59 [app] [I] Started GET "/api/hosts?search=name+%3D+%22hammer-host8.internal.devops.itree%22" for 192.168.1.2 at 2016-01-29 11:14:59 +1100
2016-01-29T11:14:59 [app] [I] Processing by Api::V2::HostsController#index as JSON
2016-01-29T11:14:59 [app] [I] Parameters: {"search"=>"name = \"hammer-host8.internal.devops.itree\"", "apiv"=>"v2", :host=>{}}
2016-01-29T11:14:59 [app] [D] Setting current user thread-local variable to foreman_admin
2016-01-29T11:14:59 [app] [D] Setting current user thread-local variable to nil
2016-01-29T11:14:59 [app] [D] Setting current user thread-local variable to foreman_admin
2016-01-29T11:14:59 [app] [I] Expire fragment views/tabs_and_title_records-3 0.4ms
2016-01-29T11:14:59 [app] [D] Setting current user thread-local variable to nil
2016-01-29T11:14:59 [app] [D] Setting current user thread-local variable to admin
2016-01-29T11:14:59 [app] [I] Authorized user admin(Admin User)
2016-01-29T11:14:59 [app] [D] Setting current user thread-local variable to admin
2016-01-29T11:14:59 [app] [I] Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (1.5ms)
2016-01-29T11:14:59 [app] [D] Body: {
| "total": 2,
| "subtotal": 0,
| "page": 1,
| "per_page": 20,
| "search": "name = \"hammer-host8.internal.devops.itree\"",
| "sort": {
| "by": null,
| "order": null
| },
| "results": []
| }
|
2016-01-29T11:14:59 [app] [I] Completed 200 OK in 39.8ms (Views: 8.1ms | ActiveRecord: 9.3ms)
Sorry if shouldn't have posted to mailing group as well.
I have been able to work around this by randomly generating a value for the MAC address and passing this. However the provisioned host is then unable to register as built and just loops through the pxe boot and install process continuously. I am unsure if this is related to the random value or not though.
Updated by Dominic Cleal almost 10 years ago
- Related to Bug #5859: VM creation fails after IP conflict added
Updated by Dominic Cleal almost 10 years ago
- Project changed from Hammer CLI to Foreman
- Category set to Orchestration
No worries about the list, it's just useful to link the two so we're not duplicating efforts.
I think you might be hitting #5859 which is some bad handling of errors and conflicts in the orchestration code when creating VMs. I think there may be a conflict on your DHCP server with the chosen IP, and while Foreman should remove it, the process doesn't work and it won't create the VM.
Updated by Tomáš Strachota over 9 years ago
- Has duplicate Bug #13573: Overwite with compute resource fails when provisioning via compute resource added
Updated by Otavio Piske over 9 years ago
Hello,
I'd like to provide additional information which, hopefully, can provide additional details to resolve this issue. I have upgraded Foreman to 1.10.2 before running these.
In my case, I managed to create a new host by manually setting the mac. In my command line I append this:
--mac "00:00:00:00:00:00"
Everytime I create a new VM, I have to change the mac (expected, I know). I noticed that the mac address provided in the command line gets added to libvirt default network (see below) which, somehow, allows the host to be created and the installation proceeds.
<host mac='00:00:00:00:00:03' name='<hostname>' ip='192.168.122.47'/>
Despite the odd settings, the VM gets built and works.
Updated by Dominic Cleal over 9 years ago
- Status changed from New to Duplicate
This will be handled under #5859.