When attempting to create a host using the following command:
hammer -v -d host create --compute-resource="libvirt" --hostgroup="Default"
–interface="type=interface,managed=true,primary=true,provision=true,compute_type=network,compute_network=default,compute_model=virtio,mac='
'" --name="test-host"
I get the following output:
[ INFO 2016-01-28 15:02:38 Init] Initialization of Hammer CLI (0.5.1) has
started…
[DEBUG 2016-01-28 15:02:38 Init] Running at ruby 1.9.3-p484
[ INFO 2016-01-28 15:02:38 Init] Configuration from the file /etc/hammer/
cli_config.yml has been loaded
[ INFO 2016-01-28 15:02:38 Init] Configuration from the file /etc/hammer/cli
.modules.d/foreman.yml has been loaded
[DEBUG 2016-01-28 15:02:39 Connection] Registered: foreman
[DEBUG 2016-01-28 15:02:39 API] Global headers: {
:content_type => "application/json",
:accept => "application/json;version=2",
"Accept-Language" => "en"
}
[ INFO 2016-01-28 15:02:39 Modules] Extension module hammer_cli_foreman (0.5
.1) loaded
[DEBUG 2016-01-28 15:02:39 Init] Using locale 'en'
[DEBUG 2016-01-28 15:02:39 Init] 'mo' files for locale domain 'hammer-cli'
loaded from '/usr/share/locale'
[DEBUG 2016-01-28 15:02:39 Init] 'mo' files for locale domain
'hammer-cli-foreman' loaded from '/usr/share/locale'
[ INFO 2016-01-28 15:02:39 HammerCLI::MainCommand] Called with options: {
"option_verbose"=>true, "option_debug"=>true}
[ INFO 2016-01-28 15:02:39 HammerCLIForeman::Host] Called with options: {}
[ INFO 2016-01-28 15:02:39 HammerCLIForeman::Host::CreateCommand] Called
with options: {"option_managed"=>true, "option_build"=>true,
"option_enabled"=>true, "option_overwrite"=>true, "option_volume_list"=>[],
"option_interface_list"=>[{"type"=>"interface", "managed"=>"true", "primary"
=>"true", "provision"=>"true", "compute_type"=>"network", "compute_network"
=>"default", "compute_model"=>"virtio", "mac"=>" "}],
"option_compute_resource_name"=>"libvirt", "option_hostgroup_name"=>
"Default", "option_name"=>"test-host"}
[ INFO 2016-01-28 15:02:39 API] GET /api/compute_resources
[DEBUG 2016-01-28 15:02:39 API] Params: {
:search => "name = "libvirt""
}
[DEBUG 2016-01-28 15:02:39 API] Headers: {
:params => {
:search => "name = "libvirt""
}
}
[DEBUG 2016-01-28 15:02:39 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-28T02:38:16Z", "id" => 1, "name" => "libvirt", "provider" => "Libvirt", "provider_friendly_name" => "Libvirt", "display_type" => "SPICE", "set_console_password" => true } ] } [DEBUG 2016-01-28 15:02:39 API] Response headers: { :date => "Thu, 28 Jan 2016 04:02:39 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 => "3615d20f5781de81becbcdeb2b38539e", :x_runtime => "0.040459", :x_rack_cache => "miss", :x_powered_by => "Phusion Passenger 4.0.37", :set_cookie => [ [0] "_session_id=bd226384657aa830b0c6fb5d35853ba2; path=/; secure; HttpOnly", [1] "request_method=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT" ], :etag => "\"74aab8147a34526211b4831fba7b4dd0\"", :status => "200 OK", :connection => "close", :transfer_encoding => "chunked", :content_type => "application/json; charset=utf-8" } [ INFO 2016-01-28 15:02:39 API] GET /api/hostgroups [DEBUG 2016-01-28 15:02:39 API] Params: { :search => "name = \"Default\"" } [DEBUG 2016-01-28 15:02:39 API] Headers: { :params => { :search => "name = \"Default\"" } } [DEBUG 2016-01-28 15:02:39 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 15:02:39 API] Response headers: { :date => "Thu, 28 Jan 2016 04:02:39 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 => "3ab449a57037dd45032eaf4897fa08ad", :x_runtime => "0.047132", :x_rack_cache => "miss", :x_powered_by => "Phusion Passenger 4.0.37", :set_cookie => [ [0] "_session_id=8d539b4464f8085a7a7eb513b75c7e19; 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 15:02:39 API] POST /api/hosts [DEBUG 2016-01-28 15:02:39 API] Params: { "host" => { "name" => "test-host", "compute_resource_id" => 1, "hostgroup_id" => 2, "build" => true, "enabled" => true, "managed" => true, "compute_attributes" => { "volumes_attributes" => {} }, "overwrite" => true, "host_parameters_attributes" => {}, "interfaces_attributes" => { "0" => { "type" => "interface", "managed" => "true", "primary" => "true", "provision" => "true", "mac" => " ", "compute_attributes" => { "type" => "network", "network" => "default", "model" => "virtio" } } } } } [DEBUG 2016-01-28 15:02:39 API] Headers: {} [DEBUG 2016-01-28 15:02:41 API] 500 Internal Server Error { "error" => { "message" => "Invalid MAC " } } [ERROR 2016-01-28 15:02:41 Exception] Invalid MAC Could not create the host: Invalid MAC [ERROR 2016-01-28 15:02:41 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 `’
Is anyone able to help me troubleshot this error?