How do you pass an input array of object as a property of a machine resource?
inputs:
disks:
type: array
title: Disks
items:
type: object
properties:
tier:
type: string
title: Tier
enum:
- Gold
- Silver
- Bronze
size:
type: number
title: Size GB
minimum: 80
maximum: 1000
resources:
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
disks: '${input.disks}'
Errors out with: Cannot deserialize instance of `String` out of START_ARRAY token at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.vmware.admiral.compute.content.TemplateComputeDescription["disks"])
Did you try with attachedDisks: ${input.disks} instead of Disks: ${input.disks}?
That does not produce the error above but does not do anything to the VM and does not send the properties to vRO in the inputProperties properties set.
I ended up modifying the resource property to be:
resources:
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
disks: '${to_string(input.disks)}'
Then in vRO i just treat the inputProperties variable as a JSON string and parse it to grab my disk objects.
with this you can add multiple disks with same size.
As per your requirement, you may need to grab the user input and write some vRO code same as day-2 operation( add disk)