When applying a custom_attribute, the key must already exist at the vSphere level otherwise you'll receive a less than helpful error, "InvalidArgument: A specified parameter was not correct: key", when running vagrant up.
If you run vagrant up --debug and trace the failure to clone.rb and then refer to the documentation for setCustomValue you'll see that InvalidArgument is "Thrown if no custom field with that key exists.". You then need to take the leap to understand that the error means you need to create the attribute at the vSphere level before being able to assign that attribute on a VM.
When applying a
custom_attribute
, the key must already exist at the vSphere level otherwise you'll receive a less than helpful error, "InvalidArgument: A specified parameter was not correct: key", when runningvagrant up
.This issue is not obvious, see https://github.com/ansible/ansible/issues/32004 and https://groups.google.com/forum/#!topic/ansible-project/Hk7gJNVz1dE, and not directly the fault of vagrant-sphere, however the documentation for
custom_attribute
could be improved to indicate that the key must already exist. Alternatively, the error could be caught in clone.rb and a more friendly error returned to the user.If you run
vagrant up --debug
and trace the failure to clone.rb and then refer to the documentation for setCustomValue you'll see thatInvalidArgument
is "Thrown if no custom field with that key exists.". You then need to take the leap to understand that the error means you need to create the attribute at the vSphere level before being able to assign that attribute on a VM.