Aria Automation Cloud Template Sample 1

October 29, 2024 0 By Allan Kjaer

I have a custom that needed to have a Cloud template where it was possible to use both automatic and static IP assignment for the network on the deployment of VM’s

The requirements for this is to configured Network Profiles and also have configured IP Ranges on the networks.

The static Assigned address needs to be inside the IP Range on the network, when assigning the IP Address statically it also registers the Address as used in the IPAM.

I have build in a lot of check in the forms validation on the Service Broker, I have not taking this into this blog, I will maybe later write about that.

Here is a sample of a Cloud Template that uses this.

formatVersion: 1
inputs
  VLAN:
    type: string
  ipAddress:
    type: string
    default: Automatic
    pattern: '^((Automatic)$|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))$'
resources:
  VM:
    type: Cloud.vSphere.Machine
    properties:
      imageRef: W2K22-TMPL
      size: small
      customizationSpec: vRA8_in_domain_local
      networks:
        - network: ${resource.Network1.id}
          assignment: static
          address: ${input.ipAddress != 'Automatic' ? input.ipAddress:""}
  Network1:
    type: Cloud.vSphere.Network
    properties:
      networkType: existing
      constraints:
        - tag: vra.network.vlan:${input.VLAN}

NOTE: All other IP setting like domain, search domain, DNS server, IP mask, Gateway and etc. are taken from the network configuration in Aria Automation.

Please share this page if you find it usefull: