Hi,
I have multiple vcenter integrated to morpheus, and i made a catalog form so user able to choose which vcenter that they want to placed the instance. Also i have different policy name for each vcenter, let say if VM deployed to VCSA1 then hostname/vmname should be named with prefix VC1xxx, and if VM goes to VCSA2, then hostname/vmname should be named with prefix VC2xxx.
VCSA1 cloud ID is 12, and VCSA2 cloud ID is 15, so i made the catalog condition for hostname and vmname as this below code.
“name”: “<%=if (customOptions.cloudname == 12 ){‘VC1’} else {‘VC2’}%><%=customOptions.hostname.toUpperCase()%>”,
“hostName”: “<%=if (customOptions.cloudname == 12 ){‘VC1’} else {‘VC2’}%><%=customOptions.hostname.toUpperCase()%>”,
In form catalog, field for cloud option have 2 lists in dropdown/select list, VCSA1 and VCSA2. When i go to this catalog is VCSA1, and submitted it, it was works as name format expected that use VC1xxx, also if i choose VCSA2, it was works as expected too using VC2xxx,
BUT when i choose VCSA2, then going back to choose VCSA1, the name still using VC2 which is used by VCSA2, it supposed to using VC1xxx.
Please help if there something i missed to make it happen