Original Message:
Sent: Nov 12, 2024 09:37 PM
From: dwilde
Subject: Deploying to vCenter Folder
Thanks for that however the constraint is a tag. It wont work without the Key:Value.
Cheers
-----------------------------------------------------------------------
This email, and any attachments, may be confidential and also privileged. If you are not the intended recipient, please notify the sender and delete all copies of this transmission along with any attachments immediately. You should not copy or use it for any purpose, nor disclose its contents to any other person.
Original Message:
Sent: 11/12/2024 3:32:00 AM
From: Kjell Konstali
Subject: RE: Deploying to vCenter Folder
Hm, perhaps it's something to do with the colon in the const value when you test the "String" value? Can you try with just a simple string like this?
datacenter:
type: string
title: Datacenter
description: Enter the Required DC
oneOf:
- title: DC1
const: SomeName
- title: DC2
const: AnotherName
Original Message:
Sent: Nov 07, 2024 03:59 PM
From: dwilde
Subject: Deploying to vCenter Folder
Thanks Guys
I had started with the const and changed to the Title just in case. Reverting to the const and omitting the whitespaces still produces the same undesired result.
Original Message:
Sent: Nov 07, 2024 03:46 AM
From: DizzyMurloc
Subject: Deploying to vCenter Folder
Hi @dwilde
Your folderName atributte should look like this:
folderName: '${input.datacenter == "Datacenter:SomeName" ? "DC1_Virtual_Machines/Windows_Servers" : "DC2_Virtual_Machines/Windows_Servers"}'
The expression must be validated againts the const, not the tittle.
Regards
Original Message:
Sent: Nov 05, 2024 11:57 PM
From: dwilde
Subject: Deploying to vCenter Folder
Howdy
Following is a cut down version of my cloud template....
formatVersion: 1
inputs:
hostName:
type: string
title: VM Name
vmNotes:
type: string
title: Notes for vCenter
datacenter:
type: string
title: Datacenter
description: Enter the Required DC
oneOf:
- title: DC1
const: Datacenter:SomeName
- title: DC2
const: Datacenter:AnotherName
resources:
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
addVCNotes: 'yes'
name: ${input.hostName}
hostname: ${input.hostName}
requser: ${env.requestedBy}
folderName: '${input.datacenter == "DC1" ? "DC1_Virtual_Machines/Windows_Servers" : "DC2_Virtual_Machines/Windows_Servers"}'
constraints:
- tag: ResourcePool:RP
- tag: ${input.datacenter}
Infoblox.IPAM.Network.enableDns: false
networks:
- network: ${resource.Cloud_vSphere_Network_1.id}
assignment: static
Cloud_vSphere_Network_1:
type: Cloud.vSphere.Network
properties:
networkType: existing
constraints:
- tag: VLAN:0000
For clarity, the DC1 and DC2 are different Cloud Zones/vCenters in two separate sites.
The intent is to add the deployed VM into the respective folder in each VC. The folder structure is essentially the same at each site.
Currently VM's deployed to DC2 are being created in the correct folder i.e. "DC2_Virtual_Machines/Windows_Servers". VM's deployed to DC1 are being created in a new folder, also named "DC2_Virtual_Machines/Windows_Servers" that is being created under the root folder of DC1.
What am I missing here?
Cheers