Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the documentation and/or error handling around custom attributes #260

Open
jessemcallister opened this issue May 18, 2018 · 0 comments

Comments

@jessemcallister
Copy link

jessemcallister commented May 18, 2018

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.

This issue is not obvious, see ansible/ansible#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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant