In our environment, we don’t want end users to be able to provide their own names for VMs provisioned as part of service catalog items.
I’ve modified the vm_name method to handle this case, where it generates a number to be in each name based on the number of vms and/or highest vm number currently in use. BUT, there is an issue if the user requests provisioning of multiple services simultaneously, both service provision requests generate an identical VM name in multiple services.
Is there a way to determine how many in progress provisioning requests for the user there are, and do something like a active_requests.find_index(current_prov_id), to try to get unique modifier for the number?
I’ve thought about trying to store the highest VM number on the user, but I don’t see how to do that, and I don’t think it would solve the problem, since both naming calls could be reading the variable simultaneously.
I’ve seen the $n rails value referenced in the original naming, but that seems focused on the case of someone creating a single service with multiple VMs to create an index, whereas my case is multiple services with single VMs.