This may need to be in the users group, but I will start here. I have
noticed an issue with the host create api in 1.4.0 (POST /api/hosts). We
are using vmware as a compute resource and use scripts to deploy
application nodes via foreman. In 1.3.x I was able to pass the vmware
network name as defined in vmware (ex cloud-app-dev). In the 1.4.0 api,
this appears to have changed to a network ID. I have not been able to find
where this association is stored. Is there a recommended way to set
compute resource parameters in 1.4? I also attempted to use compute
profiles, but it appears the api does not support using those yet in a host
create workflow.
Here is the POST parameters and the error received back from foreman
POSTBODY: {'host': {'comment': '', 'is_owned_by': '', 'managed': 'true',
'name': 'foremant-1.cloud.dev', 'model_id': '', 'provision_method':
'build', 'enabled': '1', 'hostgroup_id': 4, 'compute_attributes':
{'volumes_attributes': {'0': {'size_gb': '10', 'datastore': 'n1dev1',
'_delete': '', 'name': 'Hard disk', 'thin': 'true'}, 'new_volumes':
{'size_gb': '10', 'datastore': 'n1dev1', '_delete': '', 'name': 'Hard
disk', 'thin': 'true'}}, 'interfaces_attributes': {'0': {'_delete': '',
'type': 'VirtualVmxnet3',* 'network': 'cloud-app-dev'*}, 'new_interfaces':
{'_delete': '', 'network': 'VM Network'}}, 'cpus': '1', 'memory_mb':
'2048', 'cluster': 'CloudCluster', 'path':
'/Datacenters/Mandan/vm/app-dev', 'start': '1'}, 'interfaces_attributes':
{'new_interfaces': {'mac': '', 'name': '', '_destroy': 'false',
'subnet_id': '', 'ip': '', 'provider': 'IPMI', 'type': 'Nic::Managed',
'domain_id': ''}}, 'mac': '', 'build': '1', 'puppetclass_ids': ['', '121'],
'disk': '', 'type': 'Host::Managed', 'overwrite': 'false',
'compute_resource_id': '2'}, 'capabilities': 'build'}\
ERROROUTPUT: {
"error": {"id":null,"errors":{"base":["Failed to create a compute
VMware_mndcldvc (VMWare) instance foremant-1.cloud.dev: Unknown Network ID:
cloud-app-dev\n "]},"full_messages":["Failed to create a compute
VMware_mndcldvc (VMWare) instance foremant-1.cloud.dev: Unknown Network ID:
cloud-app-dev\n "]}
}
When using the UI and checking the logs, I see the following in the post
data for the interface attributes: "0"=>{"type"=>"VirtualVmxnet3",
"network"=>"network-73", "_delete"=>""}
Thanks for any assistance!
-Andrew