Project

General

Profile

Actions

Bug #13680

closed

Cannot create hosts with Foreman API on VMware (error: mac cannot be blank) with compute_profile_name

Added by Tom Moraux over 8 years ago. Updated almost 7 years ago.

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

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.

Actions #1

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

Actions #2

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
Actions #3

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

Actions #4

Updated by Anonymous almost 7 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF