Mac value is blank

Hi,
I have Foreman 1.7.1 installed on Centos linux.
It is configured to create virtual hosts on Vcenter. I can successfully
create new host using compute-profile via Foreman Web GUI.

However, both my rest api call and hammer cli call return the same error
"mac value is blank".

See my command below. I collected the parameter values from web gui via
chrome's network inspector, all IDs are correct.

Is this a bug or what am I missing ?

[root@foreman ~]# hammer host create --environment-id=1
–architecture-id=1 --domain-id=1
–compute-attributes="cpus=2,memory_mb=1024,cluster=135.243.90.106,path=/Datacenters/ALCATEL-TR/vm"
–operatingsystem-id=1 --puppet-proxy-id="" --name="guvenc2"
–volume="datastore=NETAPP,size_gb=5,name=Hard disk" --partition-table-id=7
–compute-resource-id=1 --root-password="12345678" --compute-profile-id=4
–medium-id=1 --image-id="Template" --provision-method=image

Could not create the host:

  • mac value is blank!*

Thanks in advance.

Hello,
I don't see anything wrong at first glance. It could be a bug. Mac
requirement should be skipped when a compute resource is provided. Can
you please paste us output od the same command using hammer -d ... so
that we see full log with the parameters that are being sent on the server?

Tomas

··· On 01/22/2015 04:21 PM, Guvenc Kazanci wrote: > Hi, > I have Foreman 1.7.1 installed on Centos linux. > It is configured to create virtual hosts on Vcenter. I can successfully > create new host using compute-profile via Foreman Web GUI. > > However, both my rest api call and hammer cli call return the same error > "mac value is blank". > > See my command below. I collected the parameter values from web gui via > chrome's network inspector, all IDs are correct. > > Is this a bug or what am I missing ? > *[root@foreman ~]# hammer host create --environment-id=1 > --architecture-id=1 --domain-id=1 > --compute-attributes="cpus=2,memory_mb=1024,cluster=135.243.90.106,path=/Datacenters/ALCATEL-TR/vm" > --operatingsystem-id=1 --puppet-proxy-id="" --name="guvenc2" > --volume="datastore=NETAPP,size_gb=5,name=Hard disk" > --partition-table-id=7 --compute-resource-id=1 > --root-password="12345678" --compute-profile-id=4 --medium-id=1 > --image-id="Template" --provision-method=image* > *Could not create the host:* > * mac value is blank!* > > > Thanks in advance. >

Hi,

I have the same error with nightly build rpms. Any suggestion to over come
the error would be appreciated …

[p2181976@dtdesktop Apps]$ rpm -qa | grep hammer
rubygem-hammer_cli_foreman-0.2.0-1.el6.noarch
rubygem-hammer_cli-0.2.0-1.el6.noarch
Thanks.

[ INFO 2015-04-30 12:38:10 HammerCLIForeman::Host::CreateCommand] Called
with options: {"option_operatingsystem_title"=>"Woking_RHEL 6.6",
"option_compute_resource_name"=>"lxtrevm01",
"option_domain_name"=>"pgds.local", "option_enabled"=>true,
"option_root_password"=>"***", "option_subnet_name"=>"PGDS Build (VLAN2118
Spanned)", "option_volume_list"=>[], "option_name"=>"d-test2",
"option_environment_name"=>"dhawal_env", "option_build"=>true,
"option_ptable_name"=>"Woking_Partition", "option_architecture_id"=>"1",
"option_compute_attributes"=>{"start"=>"true"}, "option_managed"=>false,
"option_operatingsystem_id"=>"12", "option_hostgroup_name"=>"Woking PGDS
Hostgroup", "option_compute_profile_name"=>"Woking PGDS",
"option_provision_method"=>"build",
"option_interface_list"=>[{"provision"=>"true",
"compute_network"=>"default", "compute_type"=>"network", "primary"=>"true",
"managed"=>"false"}]}
[ INFO 2015-04-30 12:38:10 API] GET /api/environments
[DEBUG 2015-04-30 12:38:10 API] Params: {
:search => "name = "dhawal_env""
}
[DEBUG 2015-04-30 12:38:10 API] Headers: {
:params => {
:search => "name = "dhawal_env""
}
}
[DEBUG 2015-04-30 12:38:10 API] Response: {
"total" => 11,
"search" => "name = "dhawal_env"",
"results" => [
[0] {
"created_at" => "2015-04-17T13:29:21Z",
"id" => 9,
"name" => "dhawal_env",
"updated_at" => "2015-04-17T13:29:21Z"
}
],
"sort" => {
"by" => nil,
"order" => nil
},
"per_page" => 20,
"subtotal" => 1,
"page" => 1
}
[DEBUG 2015-04-30 12:38:10 API] Response headers: {
:x_runtime => "0.298286",
:status => "200 OK",
:set_cookie => [
[0] "_session_id=1d7db3f54c8cd7bedf458fd236f0dfb8; path=/; HttpOnly"
],
:x_ua_compatible => "IE=Edge,chrome=1",
:x_powered_by => "Phusion Passenger 4.0.18",
:cache_control => "must-revalidate, private, max-age=0",
:etag => ""08fe12fc319acf334d84cbf72244d123"",
:foreman_version => "1.7.2",
:content_type => "application/json; charset=utf-8",
:x_request_id => "1ca313daa20a2a7062ac315192cf5086",
:foreman_api_version => "2",
:x_rack_cache => "miss",
:date => "Thu, 30 Apr 2015 11:38:10 GMT",
:transfer_encoding => "chunked",
:server => "Apache/2.2.15 (Red Hat)",
:apipie_checksum => "29ae6031014a2060f3b8fbfcb9002c52",
:connection => "close"
}
[ INFO 2015-04-30 12:38:10 API] GET /api/domains
[DEBUG 2015-04-30 12:38:10 API] Params: {
:search => "name = "pgds.local""
}
[DEBUG 2015-04-30 12:38:10 API] Headers: {
:params => {
:search => "name = "pgds.local""
}
}
[DEBUG 2015-04-30 12:38:10 API] Response: {
"total" => 2,
"search" => "name = "pgds.local"",
"results" => [
[0] {
"created_at" => "2015-02-28T20:17:35Z",
"fullname" => nil,
"id" => 1,
"dns_id" => nil,
"name" => "pgds.local",
"updated_at" => "2015-02-28T20:17:35Z"
}
],
"sort" => {
"by" => nil,
"order" => nil
},
"per_page" => 20,
"subtotal" => 1,
"page" => 1
}
[DEBUG 2015-04-30 12:38:10 API] Response headers: {
:x_runtime => "0.246398",
:status => "200 OK",
:set_cookie => [
[0] "_session_id=e1bfd7c6247c821860e9278dd72ba8c2; path=/; HttpOnly"
],
:x_ua_compatible => "IE=Edge,chrome=1",
:x_powered_by => "Phusion Passenger 4.0.18",
:cache_control => "must-revalidate, private, max-age=0",
:etag => ""f79078730e37bfc97b0de69f41d1b3df"",
:foreman_version => "1.7.2",
:content_type => "application/json; charset=utf-8",
:x_request_id => "925955d6f2d4bb302dcfc4653e5d5d8b",
:foreman_api_version => "2",
:x_rack_cache => "miss",
:date => "Thu, 30 Apr 2015 11:38:10 GMT",
:transfer_encoding => "chunked",
:server => "Apache/2.2.15 (Red Hat)",
:apipie_checksum => "29ae6031014a2060f3b8fbfcb9002c52",
:connection => "close"
}
[ INFO 2015-04-30 12:38:10 API] GET /api/ptables
[DEBUG 2015-04-30 12:38:10 API] Params: {
:search => "name = "Woking_Partition""
}
[DEBUG 2015-04-30 12:38:10 API] Headers: {
:params => {
:search => "name = "Woking_Partition""
}
}
[DEBUG 2015-04-30 12:38:11 API] Response: {
"total" => 11,
"search" => "name = "Woking_Partition"",
"results" => [
[0] {
"created_at" => "2015-04-24T13:55:29Z",
"os_family" => "Redhat",
"id" => 12,
"name" => "Woking_Partition",
"updated_at" => "2015-04-24T13:55:29Z"
}
],
"sort" => {
"by" => nil,
"order" => nil
},
"per_page" => 20,
"subtotal" => 1,
"page" => 1
}
[DEBUG 2015-04-30 12:38:11 API] Response headers: {
:x_runtime => "0.259149",
:status => "200 OK",
:set_cookie => [
[0] "_session_id=7e6698832fa5adad38c3540546a98d12; path=/; HttpOnly"
],
:x_ua_compatible => "IE=Edge,chrome=1",
:x_powered_by => "Phusion Passenger 4.0.18",
:cache_control => "must-revalidate, private, max-age=0",
:etag => ""963a329519ae432c67dfcaefa1e67d96"",
:foreman_version => "1.7.2",
:content_type => "application/json; charset=utf-8",
:x_request_id => "4686654c3b8a129d6d05be0bfd545680",
:foreman_api_version => "2",
:x_rack_cache => "miss",
:date => "Thu, 30 Apr 2015 11:38:10 GMT",
:transfer_encoding => "chunked",
:server => "Apache/2.2.15 (Red Hat)",
:apipie_checksum => "29ae6031014a2060f3b8fbfcb9002c52",
:connection => "close"
}
[ INFO 2015-04-30 12:38:11 API] GET /api/subnets
[DEBUG 2015-04-30 12:38:11 API] Params: {
:search => "name = "PGDS Build (VLAN2118 Spanned)""
}
[DEBUG 2015-04-30 12:38:11 API] Headers: {
:params => {
:search => "name = "PGDS Build (VLAN2118 Spanned)""
}
}
[DEBUG 2015-04-30 12:38:11 API] Response: {
"total" => 2,
"search" => "name = "PGDS Build (VLAN2118 Spanned)"",
"results" => [
[0] {
"created_at" => "2015-03-24T11:58:13Z",
"mask" => "255.255.254.0",
"cidr" => 23,
"network_address" => "10.240.218.0/23",
"to" => "10.240.219.11",
"id" => 1,
"ipam" => "DHCP",
"dns" => nil,
"vlanid" => "",
"priority" => nil,
"network" => "10.240.218.0",
"boot_mode" => "DHCP",
"from" => "10.240.219.1",
"gateway" => "10.240.218.1",
"name" => "PGDS Build (VLAN2118 Spanned)",
"tftp" => {
"id" => 4,
"url" => "http://lxpfrmn01v.pgds.local:8000",
"name" => "DHCP"
},
"dns_primary" => "10.240.162.11",
"dhcp" => {
"id" => 4,
"url" => "http://lxpfrmn01v.pgds.local:8000",
"name" => "DHCP"
},
"updated_at" => "2015-04-21T14:32:12Z",
"dns_secondary" => "10.240.162.12"
}
],
"sort" => {
"by" => nil,
"order" => nil
},
"per_page" => 20,
"subtotal" => 1,
"page" => 1
}
[DEBUG 2015-04-30 12:38:11 API] Response headers: {
:x_runtime => "0.394550",
:status => "200 OK",
:set_cookie => [
[0] "_session_id=0e94d2c96c7d9bc718dd04006769bee9; path=/; HttpOnly"
],
:x_ua_compatible => "IE=Edge,chrome=1",
:x_powered_by => "Phusion Passenger 4.0.18",
:cache_control => "must-revalidate, private, max-age=0",
:etag => ""4e00df49a90c7564dd9bdb48123f0fb7"",
:foreman_version => "1.7.2",
:content_type => "application/json; charset=utf-8",
:x_request_id => "533e19dd61b2524a4b607516b074c5fa",
:foreman_api_version => "2",
:x_rack_cache => "miss",
:date => "Thu, 30 Apr 2015 11:38:11 GMT",
:transfer_encoding => "chunked",
:server => "Apache/2.2.15 (Red Hat)",
:apipie_checksum => "29ae6031014a2060f3b8fbfcb9002c52",
:connection => "close"
}
[ INFO 2015-04-30 12:38:11 API] GET /api/compute_resources
[DEBUG 2015-04-30 12:38:11 API] Params: {
:search => "name = "lxtrevm01""
}
[DEBUG 2015-04-30 12:38:11 API] Headers: {
:params => {
:search => "name = "lxtrevm01""
}
}
[DEBUG 2015-04-30 12:38:11 API] Response: {
"total" => 3,
"search" => "name = "lxtrevm01"",
"results" => [
[0] {
"created_at" => "2015-03-18T14:53:00Z",
"provider" => "oVirt",
"description" => "",
"id" => 3,
"url" => "https://lxtrevm01.pgds.local/api",
"name" => "lxtrevm01",
"user" => "admin@internal",
"datacenter" => "0a932442-8599-41a4-a15c-151f76569c86",
"updated_at" => "2015-03-18T14:53:00Z"
}
],
"sort" => {
"by" => nil,
"order" => nil
},
"per_page" => 20,
"subtotal" => 1,
"page" => 1
}
[DEBUG 2015-04-30 12:38:11 API] Response headers: {
:x_runtime => "0.251327",
:status => "200 OK",
:set_cookie => [
[0] "_session_id=2aad1fdff25cfd29985026c40c8026c5; path=/; HttpOnly"
],
:x_ua_compatible => "IE=Edge,chrome=1",
:x_powered_by => "Phusion Passenger 4.0.18",
:cache_control => "must-revalidate, private, max-age=0",
:etag => ""ea17efa59746e595682b167c8c5fa99a"",
:foreman_version => "1.7.2",
:content_type => "application/json; charset=utf-8",
:x_request_id => "a1d7d5695a3eb399d695606ce9e413a3",
:foreman_api_version => "2",
:x_rack_cache => "miss",
:date => "Thu, 30 Apr 2015 11:38:11 GMT",
:transfer_encoding => "chunked",
:server => "Apache/2.2.15 (Red Hat)",
:apipie_checksum => "29ae6031014a2060f3b8fbfcb9002c52",
:connection => "close"
}
[ INFO 2015-04-30 12:38:11 API] GET /api/hostgroups
[DEBUG 2015-04-30 12:38:11 API] Params: {
:search => "name = "Woking PGDS Hostgroup""
}
[DEBUG 2015-04-30 12:38:11 API] Headers: {
:params => {
:search => "name = "Woking PGDS Hostgroup""
}
}
[DEBUG 2015-04-30 12:38:12 API] Response: {
"total" => 3,
"search" => "name = "Woking PGDS Hostgroup"",
"results" => [
[0] {
"created_at" => "2015-04-21T14:40:24Z",
"compute_profile_id" => 14,
"operatingsystem_id" => 12,
"subnet_name" => "PGDS Build (VLAN2118 Spanned)",
"puppet_ca_proxy_id" => nil,
"ancestry" => nil,
"compute_profile_name" => "Woking PGDS",
"subnet_id" => 1,
"environment_name" => nil,
"medium_id" => 7,
"ptable_name" => "Woking_Partition",
"ptable_id" => 12,
"domain_name" => "pgds.local",
"id" => 4,
"domain_id" => 1,
"realm_id" => nil,
"architecture_name" => "x86_64",
"operatingsystem_name" => "Woking_RHEL 6.6",
"name" => "Woking PGDS Hostgroup",
"realm_name" => nil,
"title" => "Woking PGDS Hostgroup",
"updated_at" => "2015-04-28T16:50:08Z",
"architecture_id" => 1,
"medium_name" => "Redhat 6.6",
"puppet_proxy_id" => 3,
"environment_id" => nil
}
],
"sort" => {
"by" => nil,
"order" => nil
},
"per_page" => 20,
"subtotal" => 1,
"page" => 1
}
[DEBUG 2015-04-30 12:38:12 API] Response headers: {
:x_runtime => "0.312094",
:status => "200 OK",
:set_cookie => [
[0] "_session_id=4fecb7dc3440f87fc7202e55274d144e; path=/; HttpOnly"
],
:x_ua_compatible => "IE=Edge,chrome=1",
:x_powered_by => "Phusion Passenger 4.0.18",
:cache_control => "must-revalidate, private, max-age=0",
:etag => ""7642fa08b35d503763715459fcc7bfb5"",
:foreman_version => "1.7.2",
:content_type => "application/json; charset=utf-8",
:x_request_id => "06c8f3c645f79c123616ce9661c72cfe",
:foreman_api_version => "2",
:x_rack_cache => "miss",
:date => "Thu, 30 Apr 2015 11:38:11 GMT",
:transfer_encoding => "chunked",
:server => "Apache/2.2.15 (Red Hat)",
:apipie_checksum => "29ae6031014a2060f3b8fbfcb9002c52",
:connection => "close"
}
[ INFO 2015-04-30 12:38:12 API] GET /api/compute_profiles
[DEBUG 2015-04-30 12:38:12 API] Params: {
:search => "name = "Woking PGDS""
}
[DEBUG 2015-04-30 12:38:12 API] Headers: {
:params => {
:search => "name = "Woking PGDS""
}
}
[DEBUG 2015-04-30 12:38:12 API] Response: {
"total" => 7,
"search" => "name = "Woking PGDS"",
"results" => [
[0] {
"created_at" => "2015-04-28T15:54:53Z",
"id" => 14,
"name" => "Woking PGDS",
"updated_at" => "2015-04-28T15:54:53Z"
}
],
"sort" => {
"by" => nil,
"order" => nil
},
"per_page" => 20,
"subtotal" => 1,
"page" => 1
}
[DEBUG 2015-04-30 12:38:12 API] Response headers: {
:x_runtime => "0.411321",
:status => "200 OK",
:set_cookie => [
[0] "_session_id=205ce5c00adc5c4955ce59774886da32; path=/; HttpOnly"
],
:x_ua_compatible => "IE=Edge,chrome=1",
:x_powered_by => "Phusion Passenger 4.0.18",
:cache_control => "must-revalidate, private, max-age=0",
:etag => ""43c8846eb65e64feb20c3ae6ea31c4fd"",
:foreman_version => "1.7.2",
:content_type => "application/json; charset=utf-8",
:x_request_id => "04883f459bf0273316334ccd30be0380",
:foreman_api_version => "2",
:x_rack_cache => "miss",
:date => "Thu, 30 Apr 2015 11:38:12 GMT",
:transfer_encoding => "chunked",
:server => "Apache/2.2.15 (Red Hat)",
:apipie_checksum => "29ae6031014a2060f3b8fbfcb9002c52",
:connection => "close"
}
[ INFO 2015-04-30 12:38:12 API] POST /api/hosts
[DEBUG 2015-04-30 12:38:12 API] Params: {
"host" => {
"compute_profile_id" => 14,
"hostgroup_id" => 4,
"operatingsystem_id" => "12",
"build" => true,
"subnet_id" => 1,
"interfaces_attributes" => {
"0" => {
"provision" => "true",
"primary" => "true",
"compute_attributes" => {
"type" => "network",
"network" => "default"
},
"managed" => "false"
}
},
"enabled" => true,
"ptable_id" => 12,
"compute_resource_id" => 3,
"domain_id" => 1,
"root_pass" => "scratchy",
"compute_attributes" => {
"start" => "true",
"volumes_attributes" => {}
},
"provision_method" => "build",
"name" => "d-test2",
"managed" => false,
"host_parameters_attributes" => {},
"architecture_id" => "1",
"environment_id" => 9
}
}
[DEBUG 2015-04-30 12:38:12 API] Headers: {}
[DEBUG 2015-04-30 12:38:17 API] 422 Unprocessable Entity
{
"error" => {
"id" => nil,
"full_messages" => [
[0] "mac value is blank!"
],
"errors" => {
"base" => [
[0] "mac value is blank!"
]
}
}
}
[ERROR 2015-04-30 12:38:17 Exception] mac value is blank!
Could not create the host:
mac value is blank!

··· On Friday, 23 January 2015 09:12:39 UTC, Tomas Strachota wrote:

On 01/22/2015 04:21 PM, Guvenc Kazanci wrote:

Hi,
I have Foreman 1.7.1 installed on Centos linux.
It is configured to create virtual hosts on Vcenter. I can successfully
create new host using compute-profile via Foreman Web GUI.

However, both my rest api call and hammer cli call return the same error
"mac value is blank".

See my command below. I collected the parameter values from web gui via
chrome’s network inspector, all IDs are correct.

Is this a bug or what am I missing ?
*[root@foreman ~]# hammer host create --environment-id=1
–architecture-id=1 --domain-id=1

–compute-attributes=“cpus=2,memory_mb=1024,cluster=135.243.90.106,path=/Datacenters/ALCATEL-TR/vm”

–operatingsystem-id=1 --puppet-proxy-id="" --name=“guvenc2”
–volume=“datastore=NETAPP,size_gb=5,name=Hard disk”
–partition-table-id=7 --compute-resource-id=1
–root-password=“12345678” --compute-profile-id=4 --medium-id=1
–image-id=“Template” --provision-method=image*
*Could not create th