Hey Anthony,
yes its possible, you have to input your machines via Object-Array and map it under the properties in the Ressource-Part of the Cloud Template.
Here is a simple example, to Install Ubuntu and Windows machines. Important is the "allcoatePerInstance" Property, so every VM is configured individually.
# important property: allocatePerInstance: true
FormatVersion: 1
inputs:
win:
type: array
title: Windows
minItems: 0
maxItems: 10
items:
type: object
properties:
os:
type: string
title: OS
default: '2019'
enum:
- '2016'
- '2019'
- '2022'
flavor:
type: string
title: Flavor
description: |-
<b> Select the size of the deployment. </b> <br>
Micro = 1 CPU - 1 GB RAM, <br>
Small = 1 CPU - 2 GB RAM, <br>
Medium = 2 CPU - 4 GB RAM, <br>
Large = 2 CPU - 8 GB RAM <br>
enum:
- tiny
- small
- medium
- large
name:
type: string
title: Hostname
maxLength: 10
ubu:
type: array
title: Ubuntu
minItems: 0
maxItems: 10
items:
type: object
properties:
os:
type: string
title: OS version
default: '2004'
enum:
- '1804'
- '2004'
- '2104'
flavor:
type: string
title: Flavor
description: |-
<b> Select the size of the deployment. </b> <br>
Micro = 1 CPU - 1 GB RAM, <br>
Small = 1 CPU - 2 GB RAM, <br>
Medium = 2 CPU - 4 GB RAM, <br>
Large = 2 CPU - 8 GB RAM <br>
enum:
- tiny
- small
- medium
- large
name:
type: string
title: Hostname
maxLength: 10
resources:
Windows:
type: Cloud.vSphere.Machine
allocatePerInstance: true
properties:
image: Win${input.win[count.index].os}-CS
flavor: ${input.win[count.index].flavor}
name: win${input.win[count.index].os}
count: ${length(input.win)}
customizationSpec: forensik-workgroup
networks:
- network: ${resource.Cloud_vSphere_Network_1.id}
assignment: static
Ubuntu:
type: Cloud.vSphere.Machine
allocatePerInstance: true
properties:
image: Ubuntu${input.ubu[count.index].os}
flavor: ${input.ubu[count.index].flavor}
name: ubu${input.ubu[count.index].os}
count: ${length(input.ubu)}
networks:
- network: ${resource.Cloud_vSphere_Network_1.id}
assignment: static
Cloud_vSphere_Network_1:
type: Cloud.vSphere.Network
properties:
networkType: existing
constraints:
- tag: np:default
Original Message:
Sent: Dec 08, 2024 08:08 PM
From: Anthony Hughes
Subject: VRA multi machine build with different OS type
Hey All,
Thought I'd ask out to the brains trust with a few things I am trying to work out this is all around building multiple machines with various OS types.
So currently for operating system I use these two to build for one os type multiple machines.
operatingSystem:
type: string
default: ubuntu2204
title: Operating System
description: Choose Operating System to install <br><b>
oneOf:
- title: Linux RHEL 8
const: rhel8
- title: Ubuntu 20.04
const: ubuntu2004
- title: Linux RHEL 9
const: rhel9
- title: Ubuntu 22.04
const: ubuntu2204
- title: Windows Server 2022
const: win2022
- title: Windows Server 2019
const: win2019
and
numvms:
type: integer
title: Number of Machines
minimum: 1
maximum: 3
default: 1
resources:
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
leaseDays: ${input.leaseDays}
image: ${input.operatingSystem}
flavor: ${input.flavorSize}
count: ${input.numvms}
So the issue I have is this being only build one OS multiples at a time ideally I'd want to be able to build say 4 windows then 6 Linux machines all a part of the same deployment would changing the OperatingSytem to array work issue is then how does it pass in the const I am using as the image to use? Then the numvms how is it best to allow building multiple for the different os types?
I've seen a few examples which I've borrowed from but they all usually say multiple builds of 1 os type not a mix and match scenario.