I need to add up to 4 disks of different sizes. I tried setting the count to ${input.optionalDisk1Size == 0? 0 : 1} but that stops me from adding any other disks to the blueprint. I can't seem to figure out how to add UP to 4 disks where the sizes vary. It seems that I need 4 separate disks on the blueprint that may or may not be provisioned.
Any suggestions gratefully accepted.
Carl L.
resources:
#Additional disk 1
Cloud_vSphere_Disk_1:
type: Cloud.vSphere.Disk
properties:
type: HDD
capacityGb: '${input.additional-disk-size}'
count: '${input.number-of-additional-disks > 0 ? 1 : 0}'
constraints:
- tag: VSAN
#Additional disk 2
Cloud_vSphere_Disk_2:
type: Cloud.vSphere.Disk
properties:
type: HDD
capacityGb: '${input.additional-disk-size-2}'
count: '${input.number-of-additional-disks > 1 ? 1 : 0}'
constraints:
- tag: VSAN
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
resourceGroupName: vRA-Deployment/vra-machines
image: Windows-Server-2016-2
flavor: Medium-Size
storage:
constraints:
- tag: VSAN
attachedDisks: '${map_to_object(resource.Cloud_vSphere_Disk_1[*].id + resource.Cloud_vSphere_Disk_2[*].id, "source")}'
Here you go, knowing that you can add up to 4 disks of various sizes is not a problem. Use custom form for inputs customization.
*Note - My example only shows up to 2 additional disks
I should have also said: vRA 8.1
resources:
#Additional disk 1
Cloud_vSphere_Disk_1:
type: Cloud.vSphere.Disk
properties:
type: HDD
capacityGb: '${input.additional-disk-size}'
count: '${input.number-of-additional-disks > 0 ? 1 : 0}'
constraints:
- tag: VSAN
#Additional disk 2
Cloud_vSphere_Disk_2:
type: Cloud.vSphere.Disk
properties:
type: HDD
capacityGb: '${input.additional-disk-size-2}'
count: '${input.number-of-additional-disks > 1 ? 1 : 0}'
constraints:
- tag: VSAN
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
resourceGroupName: vRA-Deployment/vra-machines
image: Windows-Server-2016-2
flavor: Medium-Size
storage:
constraints:
- tag: VSAN
attachedDisks: '${map_to_object(resource.Cloud_vSphere_Disk_1[*].id + resource.Cloud_vSphere_Disk_2[*].id, "source")}'
Here you go, knowing that you can add up to 4 disks of various sizes is not a problem. Use custom form for inputs customization.
*Note - My example only shows up to 2 additional disks
I saw some references to map_to_object in some other discussions. Thanks so much!
Carl L.