Actions
Bug #9970
closedCreating hosts with NICs on vmWare fails with "Unknown Network ID:"
Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Compute resources - VMware
Target version:
-
Description
hammer -d host create --name dn101 --hostgroup-id 7 --compute-resource-id 2 --provision-method image --image-id 5 --enabled true --managed true --environment-id 1 --domain-id 2 --interface "compute_network=SDC1_111" --subnet-id 2 --compute-attributes "cluster=BD_LAB,memory_mb=16384,cpus=4,start=1" --volume "datastore=BDH04_DISK3,name=HDD,size_gb=100"
Fails with:
Could not create the host: Failed to create a compute VC02_BIGD (VMware) instance dn101.pldc1.example.com: Unknown Network ID:
It seems that parameters being sent in the log are correct.
There is suspicious part of the code that raises the exception. The data structures changed a bit since the primary NIC extraction has been merged and it tries to compare missing data. Compute related data has been moved under a key "compute_attributes" in the interface structure. The fix is most likely just adding the "compute_attributes" key.
https://github.com/theforeman/foreman/blob/develop/app/models/compute_resources/foreman/model/vmware.rb#L305
Files
Actions