Problem:
I have an environment with Foreman + oVirt + FreeIPA. Everything is working just fine. When I need to create a new host I just do it via foreman UI and a new host is created on oVirt and the cloudinit script installs ipa-client and registers my new host on FreeIPA, setting up LDAP authentication on the host and adding it to DNS.
Now, I’m trying to reproduce the same scenario via Foreman REST API, in other words, create new hosts via API using postman.
I started by following the API documentation and I managed to figure out some of the missing fields because the HTTP response was clear enough, but now I’m stuck with the following procedure:
Via postman I’m sending a POST with the following body:
{
"host": {
"name": "banana",
"hostgroup_id": 1,
"environment_id": 1,
"architecture_id": 1,
"domain_id": 1,
"puppet_proxy_id": 1,
"puppet_ca_proxy_id": 1,
"operatingsystem_id": 1,
"provision_method": "image",
"image_id": 1,
"compute_resource_id": 1,
"compute_profile_id": 1,
"realm_id": 2,
"enabled": true,
"managed": true,
"root_pass": "asdfasdfasdf"
}
}
And the return is not very clear, after googling for the following code, it doesn’t show any (good) result (I hope I’m not the first one facing this issue)
{
"error": {
"id": null,
"errors": {
"base": [
"Failed to create a compute oVirt (oVirt) instance banana.europe.intranet: ERF42-0973 [Foreman::Exception]: is not valid, enter id or name\n "
]
},
"full_messages": [
"Failed to create a compute oVirt (oVirt) instance banana.europe.intranet: ERF42-0973 [Foreman::Exception]: is not valid, enter id or name\n "
]
}
}
Expected outcome:
A host created on oVirt, managed by foreman
Product versions:
Foreman Version 2.1.1
oVirt 4.3.10
FreeIPA version: 4.6.6