I am running a vCenter 6.0 server with a few RedHat Linux 7.x templates.
I am writing a program which must be able to deploy VMs from these templates with customized hostnames and IP addresses.
Using the sample VMClone.java causes the vCenter to log the error:
"A specified parameter was not correct: spec.location.pool"
I am assuming this is because I have to explicitly define the resource pool to use, though the only code the sample has regarding VM specs is:
private VirtualMachineCloneSpec cloneSpec = new VirtualMachineCloneSpec();
private VirtualMachineRelocateSpec relocSpec = new VirtualMachineRelocateSpec();
It appears that the VirtualMachineRelocateSpec object is what defines the resource pool and has methods to change it, though I cannot find any documentation on how exactly to change the pool.
Any help on fixing this error and customizing the hostname and IP during cloning would be greatly appreciated.