Adding prefix to VM name

Hello, a new ManageIQ user here. I am trying to figure out a way to prepend tenant (or group) name to each of the VMs created by the self service users.

I have a few service dialogs with option for VM name, CPU and Memory all working fine. When a self service user submit request for a new VM/service I want to prepend the user’s group or tenant name to the vm_name. Any help would be much appreciated.

You can check the link VM Naming Change for a better undestanding on vm naming and updating vm name,

You can get the tenant object from miq_provision object and you can update the vm name by using the method update_vm_name. you can check from the above link.

1 Like

@amitkumarpatel Thanks a lot for your response. The post you linked to was very helpful.

I couldn’t figure out the appropriate object name for tenant but I was able to achieve what I wanted - avoid VM name conflict, by appending/prepending auto generate numbers.