Is it possible to enforce unique VM names in the OpenNebula Sunstone “Instantiate VM Template” interface?
I have set up the VM creation to generate DNS records based what you type into the “VM name” field and it would be nice to prevent users from generating duplicate VM names.
I run OpenNebula 5.4.6 on Ubuntu and VMware Vsphere 6.0.
Yes I see what you mean.
If a Dev reads this:
It would be necessary to run a custom check script (defined in the template) when pressing “Create” Button. In this user created script all variables for the new VM and the ONE cli commands need to be accessible. The return value would determine if OpenNebula should continue instantiating the VM or not. Another return value for description can be shown in the error message (e.g. “Hostname not unique”). Just an idea…
Hello, your script can check for unique name and if is already used, them don;t create DNS record and write info about error to VM user template, so user can see it and can change vm name.