Bug #13680
closedCannot create hosts with Foreman API on VMware (error: mac cannot be blank) with compute_profile_name
Description
Hello,
I try to create an host in foreman using the API.
Here is the JSON I send:
{
"host": {
"name": "xxxxxxxxxxxxxxx",
"hostgroup_name": "XXX/XXX/XXX/VM/APP",
"compute_profile_name": "XXXX_XXX",
"compute_resource_id": 1,
"build": "true",
"ip": "10.XXX.XXX.XXX"
}
}
The provider of the compute resource is VMware and the ID is correct.
But when I send it i receive the error:
"error": {"id":null,"errors":{"interfaces.mac":["can't be blank"]},"full_messages":["Mac can't be blank"]}
If i try to create an host with the web interface it works perfectly.
So why does the API say "Mac can't be blank" when the doc says "not required if it’s a virtual machine" ?
Thank you.
Updated by Tom Moraux over 8 years ago
Solved,
You cannot use "compute_profile_name" you have to use "compute_profile_id".
Can you make it possible to use "compute_profile_name"?
Thank you
Updated by Dominic Cleal over 8 years ago
- Subject changed from Cannot create hosts with Foreman API on VMware (error: mac cannot be blank) to Cannot create hosts with Foreman API on VMware (error: mac cannot be blank) with compute_profile_name
- Priority changed from Immediate to Normal
Updated by Guido Günther over 8 years ago
Tom Moraux wrote:
Solved,
You cannot use "compute_profile_name" you have to use "compute_profile_id".
Can you make it possible to use "compute_profile_name"?
Thank you
Very likely related to http://projects.theforeman.org/issues/13507