Project

General

Profile

Actions

Bug #13573

closed

Overwite with compute resource fails when provisioning via compute resource

Added by Dirk Mayer over 8 years ago. Updated about 8 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Issuing the following command results in a error station invalid MAC.
The problem is, creating a new VM autogenerates a MAC address. It should not be necessary to add the --MAC option, because u its unknown which mac is getting generated.

hammer --debug host create --environment-id 1 --architecture-id 1 --domain-id 1 --puppet-proxy-id 1 --operatingsystem-id 2 --hostgroup-id 4 --provision-method image --compute-resource-id 1 --interface "primary=true,provision=true,compute_type=bridge,compute_bridge=br0,compute_model=virtio,ip=172.17.31.11" --interface "compute_type=bridge,compute_bridge=br1,compute_model=virtio" --name 'host01.localdomain' --subnet-id 1 --compute-attributes "cpus=4,memory=8589934592,start=1,image_id=/var/lib/libvirt/images/win2k8-tsnode.qcow2" --volume "pool_name=virt-images,capacity=600G,format_type=qcow2,allocation=0G" --build 1 --enabled 1 --managed 1 --puppet-ca-proxy-id 1 --compute-profile '02-TsNode'

Resulting error message:

[ INFO 2016-02-05 11:51:00 Init] Initialization of Hammer CLI (0.5.1) has started...
[DEBUG 2016-02-05 11:51:00 Init] Running at ruby 1.9.3-p484
[ INFO 2016-02-05 11:51:00 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-02-05 11:51:00 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2016-02-05 11:51:00 Init] Configuration from the file /root/.hammer/cli.modules.d/foreman.yml has been loaded
[DEBUG 2016-02-05 11:51:00 Connection] Registered: foreman
[DEBUG 2016-02-05 11:51:00 API] Global headers: {
:content_type => "application/json",
:accept => "application/json;version=2",
"Accept-Language" => "en"
}
[ INFO 2016-02-05 11:51:00 Modules] Extension module hammer_cli_foreman (0.5.1) loaded
[DEBUG 2016-02-05 11:51:00 Init] Using locale 'en'
[DEBUG 2016-02-05 11:51:00 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1/locale'
[DEBUG 2016-02-05 11:51:00 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1/locale'
[ INFO 2016-02-05 11:51:00 HammerCLI::MainCommand] Called with options: {"option_debug"=>true}
[ INFO 2016-02-05 11:51:00 HammerCLIForeman::Host] Called with options: {}
[ INFO 2016-02-05 11:51:00 HammerCLIForeman::Host::CreateCommand] Called with options: {"option_managed"=>true, "option_build"=>true, "option_enabled"=>true, "option_overwrite"=>true, "option_compute_attributes"=>{"cpus"=>"4", "memory"=>"8589934592", "start"=>"1", "image_id"=>"/var/lib/libvirt/images/win2k8-tsnode.qcow2"}, "option_volume_list"=>[{"pool_name"=>"virt-images", "capacity"=>"600G", "format_type"=>"qcow2", "allocation"=>"0G"}], "option_interface_list"=>[{"primary"=>"true", "provision"=>"true", "compute_type"=>"bridge", "compute_bridge"=>"br0", "compute_model"=>"virtio", "ip"=>"172.17.31.11"}, {"compute_type"=>"bridge", "compute_bridge"=>"br1", "compute_model"=>"virtio"}], "option_provision_method"=>"image", "option_environment_id"=>1, "option_architecture_id"=>1, "option_domain_id"=>1, "option_operatingsystem_id"=>2, "option_subnet_id"=>1, "option_compute_resource_id"=>1, "option_hostgroup_id"=>4, "option_compute_profile_name"=>"02-TsNode", "option_name"=>"host01.localdomain", "option_puppet_proxy_id"=>1, "option_puppet_ca_proxy_id"=>1}
[ INFO 2016-02-05 11:51:00 API] GET /api/compute_profiles
[DEBUG 2016-02-05 11:51:00 API] Params: {
:search => "name = \"02-TsNode\""
}
[DEBUG 2016-02-05 11:51:00 API] Headers: {
:params => {
:search => "name = \"02-TsNode\""
}
}
[DEBUG 2016-02-05 11:51:00 API] Response: {
"total" => 5,
"subtotal" => 1,
"page" => 1,
"per_page" => 20,
"search" => "name = \"02-TsNode\"",
"sort" => {
"by" => nil,
"order" => nil
},
"results" => [
[0] {
"created_at" => "2016-02-05T09:36:46Z",
"updated_at" => "2016-02-05T09:36:46Z",
"id" => 5,
"name" => "02-TsNode"
}
]
}
[DEBUG 2016-02-05 11:51:00 API] Response headers: {
:date => "Fri, 05 Feb 2016 10:51:00 GMT",
:server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
:foreman_version => "1.10.1",
:foreman_api_version => "2",
:apipie_checksum => "f0f3e47100190cdea747b2a8d62334d1",
:x_ua_compatible => "IE=Edge,chrome=1",
:cache_control => "must-revalidate, private, max-age=0",
:x_request_id => "261b16cd6302060cbea9bc8c599b59f8",
:x_runtime => "0.048916",
:x_rack_cache => "miss",
:x_powered_by => "Phusion Passenger 4.0.18",
:set_cookie => [
[0] "_session_id=a2cdd0ee4b87144b99ba30cc1121469e; path=/; secure; HttpOnly",
[1] "request_method=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT"
],
:etag => "\"022f438a217b5a3f7695f27306cfe717\"",
:status => "200 OK",
:connection => "close",
:transfer_encoding => "chunked",
:content_type => "application/json; charset=utf-8"
}
[ INFO 2016-02-05 11:51:00 API] POST /api/hosts
[DEBUG 2016-02-05 11:51:00 API] Params: {
"host" => {
"name" => "host01.localdomain",
"environment_id" => 1,
"architecture_id" => 1,
"domain_id" => 1,
"puppet_proxy_id" => 1,
"operatingsystem_id" => 2,
"subnet_id" => 1,
"compute_resource_id" => 1,
"hostgroup_id" => 4,
"puppet_ca_proxy_id" => 1,
"build" => true,
"enabled" => true,
"provision_method" => "image",
"managed" => true,
"compute_profile_id" => 5,
"compute_attributes" => {
"cpus" => "4",
"memory" => "8589934592",
"start" => "1",
"image_id" => "/var/lib/libvirt/images/win2k8-tsnode.qcow2",
"volumes_attributes" => {
"0" => {
"pool_name" => "virt-images",
"capacity" => "600G",
"format_type" => "qcow2",
"allocation" => "0G"
}
}
},
"overwrite" => true,
"host_parameters_attributes" => {},
"interfaces_attributes" => {
"0" => {
"primary" => "true",
"provision" => "true",
"ip" => "172.17.31.11",
"compute_attributes" => {
"type" => "bridge",
"bridge" => "br0",
"model" => "virtio"
}
},
"1" => {
"compute_attributes" => {
"type" => "bridge",
"bridge" => "br1",
"model" => "virtio"
}
}
}
}
}
[DEBUG 2016-02-05 11:51:00 API] Headers: {}
[DEBUG 2016-02-05 11:51:01 API] 500 Internal Server Error {
"error" => {
"message" => "Invalid MAC "
}
}
[ERROR 2016-02-05 11:51:01 Exception] Invalid MAC
Could not create the host:
Invalid MAC
[ERROR 2016-02-05 11:51:01 Exception]

RestClient::InternalServerError (500 Internal Server Error):
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
/opt/rh/ruby193/root/usr/share/ruby/net/http.rb:746:in `start'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:67:in `post'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/api.rb:286:in `call_client'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/api.rb:217:in `http_call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/api.rb:163:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/resource.rb:14:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1/lib/hammer_cli/apipie/command.rb:43:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1/lib/hammer_cli_foreman/commands.rb:189:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1/lib/hammer_cli/apipie/command.rb:34:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1/lib/hammer_cli/abstract.rb:22:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1/lib/hammer_cli/abstract.rb:22:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1/lib/hammer_cli/abstract.rb:22:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1/bin/hammer:125:in `<top (required)>'
/usr/bin/hammer:23:in `load'
/usr/bin/hammer:23:in `<main>'

OS:
RHEL 7.2, Foreman 1.10.1


Files

foreman_production.log foreman_production.log 32.9 KB foreman server side log file Dirk Mayer, 02/10/2016 11:08 AM
guest.sh guest.sh 2.55 KB reproducer script Dirk Mayer, 02/23/2016 05:15 AM
guest.log guest.log 9.39 KB output of the reproducer script Dirk Mayer, 02/23/2016 05:15 AM
production.log production.log 28.7 KB log of foreman server side Dirk Mayer, 02/23/2016 05:15 AM

Related issues 2 (0 open2 closed)

Is duplicate of Foreman - Bug #13422: creating a host on a libvirt compute resource throws an invalid MAC errorDuplicate01/27/2016Actions
Is duplicate of Foreman - Bug #5859: VM creation fails after IP conflictClosedIvan Necas05/21/2014Actions
Actions

Also available in: Atom PDF