Hi,
creating of a host via the foreman API is not working anymore as expected.
Creating a host via the web interface works fine.
We use the following versions:
Foreman 2.1.4
vSphere 7.0
API call:
curl -H “Accept:application/json,version=2” -H “Content-Type:application/json” -X POST -u user:password -k -d ‘{“name”:“servername”,“hostgroup_name”:“hostgroup-name”,“build”:true,“organization_id”:“1”,“location_id”:“2”,“interfaces_attributes”:{“0”:{"_destroy":“0”, “type”:“Nic::Managed”, “mac”:"", “identifier”:"", “name”:"", “domain_id”:“1”, “subnet_id”:“1”, “ip”:"", “ip6”:"", “managed”:“1”, “primary”:“0”, “provision”:“1”, “virtual”:“0”, “tag”:"", “attached_to”:"", “compute_attributes”:{“type”:“VirtualVmxnet3”, “network”:“dvportgroup-14333”}}, “1”:{"_destroy":“0”, “type”:“Nic::Managed”, “mac”:"", “identifier”:"", “name”:“servername”, “domain_id”:“1”, “subnet_id”:“2”, “ip”:“10.X.X.X”, “ip6”:"", “managed”:“1”, “primary”:“1”, “provision”:“0”, “virtual”:“0”, “tag”:"", “attached_to”:"", “compute_attributes”:{“type”:“VirtualVmxnet3”, “network”:“dvportgroup-33”}}},“compute_attributes”:{“start”: “1”,“memory_mb”: 4096,“cpus”: 4,“volumes_attributes”:{“0”:{“size_gb”:82}}}}’ https://foreman-master/api/v2/hosts
Error message:
“error”: {“id”:null,“errors”:{“base”:[“Set up compute instance servername task failed with the following error: too few arguments”]},“full_messages”:[“Set up compute instance servername task failed with the following error: too few arguments”
We recently updated our VMware vCenter to version 7.0 from 6.7. After the update a creation of new hosts worked via the API for some days. We get this error on our foreman test and live environment.
At the moment we migrate the hypervisors from version 6.7 to 7.0.
Thanks in advance.
Regards
Michael